Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
Remove credit card samples (#896)
Browse files Browse the repository at this point in the history
* removed credit card payment samples
* update docs to reflect sample changes
* update readme to recommend braintree for direct card payments
  • Loading branch information
Randy authored Aug 3, 2017
1 parent e3aadb4 commit 14e814d
Show file tree
Hide file tree
Showing 23 changed files with 81 additions and 756 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ __Welcome to PayPal PHP SDK__. This repository contains PayPal's PHP SDK and sam
- PHP 5.3 or above
- [curl](https://secure.php.net/manual/en/book.curl.php), [json](https://secure.php.net/manual/en/book.json.php) & [openssl](https://secure.php.net/manual/en/book.openssl.php) extensions must be enabled


## Direct Credit Card Support
[Braintree Direct](https://www.braintreepayments.com/products/braintree-direct) is PayPal's preferred integration solution for accepting direct credit card payments in your mobile app or website. Braintree, a PayPal service, is the easiest way to accept credit cards, PayPal, and many other payment methods.


## License

Read [License](LICENSE) for more licensing information.
Expand Down
111 changes: 0 additions & 111 deletions sample/billing/CreateBillingAgreementWithCreditCard.php

This file was deleted.

81 changes: 0 additions & 81 deletions sample/doc/billing/CreateBillingAgreementWithCreditCard.html

This file was deleted.

11 changes: 4 additions & 7 deletions sample/doc/payments/AuthorizationCapture.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
<p>This sample code demonstrates how you can capture
a previously authorized payment.
API used: /v1/payments/payment
<a href="https://developer.paypal.com/webapps/developer/docs/api/#capture-an-authorization">https://developer.paypal.com/webapps/developer/docs/api/#capture-an-authorization</a></p></div></div><div class="code"><div class="wrapper"><span class="hljs-comment">/** <span class="hljs-doctag">@var</span> Authorization $authorization */</span>
<span class="hljs-variable">$authorization</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'GetAuthorization.php'</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Amount</span>;
<a href="https://developer.paypal.com/webapps/developer/docs/api/#capture-an-authorization">https://developer.paypal.com/webapps/developer/docs/api/#capture-an-authorization</a></p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Amount</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Authorization</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Capture</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="capture-payment">Capture Payment</h3>
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Capture</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Replace $authorizationId with any static Id you might already have. </p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$authorizationId</span> = <span class="hljs-string">"&lt;your authorization id here&gt;"</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="capture-payment">Capture Payment</h3>
<p>You can capture and process a previously created authorization
by invoking the $authorization-&gt;capture method
with a valid ApiContext (See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
<span class="hljs-variable">$authId</span> = <span class="hljs-variable">$authorization</span>-&gt;getId();
with a valid ApiContext (See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Retrieve the authorization</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$authorization</span> = Authorization::get(<span class="hljs-variable">$authorizationId</span>, <span class="hljs-variable">$apiContext</span>);

<span class="hljs-variable">$amt</span> = <span class="hljs-keyword">new</span> Amount();
<span class="hljs-variable">$amt</span>-&gt;setCurrency(<span class="hljs-string">"USD"</span>)
Expand All @@ -23,4 +20,4 @@
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Capture Payment"</span>, <span class="hljs-string">"Authorization"</span>, <span class="hljs-variable">$getCapture</span>-&gt;getId(), <span class="hljs-variable">$capture</span>, <span class="hljs-variable">$getCapture</span>);

<span class="hljs-keyword">return</span> <span class="hljs-variable">$getCapture</span>;</div></div></div></div></body></html>
<span class="hljs-keyword">return</span> <span class="hljs-variable">$getCapture</span>;</div></div></div></div></body></html>
Loading

0 comments on commit 14e814d

Please sign in to comment.