Merge pull request #682 from paypal/payments-experience-v1.3

Payments experience v1.3
This commit is contained in:
Steve Coffey
2016-10-18 13:49:17 -07:00
committed by GitHub
14 changed files with 505 additions and 3164 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -10,4 +10,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">"Get all Templates"</span>, <span class="hljs-string">"Templates"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$templates</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$templates</span>;</div></div></div></div></body></html>
<span class="hljs-keyword">return</span> <span class="hljs-variable">$templates</span>;</div></div></div></div></body></html>

View File

@@ -16,4 +16,4 @@ Template ID
<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">"Get Invoice Template"</span>, <span class="hljs-string">"Template"</span>, <span class="hljs-variable">$template</span>-&gt;getTemplateId(), <span class="hljs-variable">$templateId</span>, <span class="hljs-variable">$template</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$template</span>;</div></div></div></div></body></html>
<span class="hljs-keyword">return</span> <span class="hljs-variable">$template</span>;</div></div></div></div></body></html>

View File

@@ -4,11 +4,8 @@ an invoice.</p></div></div><div class="code"><div class="wrapper"><span class="h
<span class="hljs-variable">$invoice</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'CreateInvoice.php'</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">Invoice</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>For Sample Purposes Only.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$request</span> = <span class="hljs-keyword">clone</span> <span class="hljs-variable">$invoice</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="update-invoice">Update Invoice</h3>
<p>Lets update some information</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$invoice</span>-&gt;setInvoiceDate(<span class="hljs-string">"2014-12-16 PST"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="note-these-are-the-work-around-added-to-the">NOTE: These are the work-around added to the</h3>
<p>sample, to get past the bug in PayPal APIs.
There is already an internal ticket #PPTIPS-1932 created for it.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$invoice</span>-&gt;setDiscount(<span class="hljs-keyword">null</span>);
<span class="hljs-variable">$billingInfo</span> = <span class="hljs-variable">$invoice</span>-&gt;getBillingInfo()[<span class="hljs-number">0</span>];
<span class="hljs-variable">$billingInfo</span>-&gt;setAddress(<span class="hljs-keyword">null</span>);
<span class="hljs-variable">$invoice</span>-&gt;getPaymentTerm()-&gt;setDueDate(<span class="hljs-keyword">null</span>);
<p>sample, to get past the bug in PayPal APIs.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$invoice</span>-&gt;setDiscount(<span class="hljs-keyword">null</span>);
<span class="hljs-variable">$invoice</span>-&gt;getItems()[<span class="hljs-number">1</span>]-&gt;setDiscount(<span class="hljs-keyword">null</span>);
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="update-invoice">Update Invoice</h3>
<p>Update an invoice by calling the invoice-&gt;update() method
@@ -26,4 +23,4 @@ Invoice ID
<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">"Get Invoice (Not Required - For Sample Only)"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-variable">$invoice</span>-&gt;getId(), <span class="hljs-variable">$invoice</span>-&gt;getId(), <span class="hljs-variable">$invoice</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$invoice</span>;</div></div></div></div></body></html>
<span class="hljs-keyword">return</span> <span class="hljs-variable">$invoice</span>;</div></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View File

@@ -13,6 +13,10 @@ $flowConfig = new \PayPal\Api\FlowConfig();
$flowConfig->setLandingPageType("Billing");
// The URL on the merchant site for transferring to after a bank transfer payment.
$flowConfig->setBankTxnPendingUrl("http://www.yeowza.com/");
// When set to "commit", the buyer is shown an amount, and the button text will read "Pay Now" on the checkout page.
$flowConfig->setUserAction("commit");
// Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`.
$flowConfig->setReturnUriHttpMethod("GET");
// Parameters for style and presentation.
$presentation = new \PayPal\Api\Presentation();
@@ -22,7 +26,11 @@ $presentation->setLogoImage("http://www.yeowza.com/favico.ico")
// A label that overrides the business name in the PayPal account on the PayPal pages.
->setBrandName("YeowZa! Paypal")
// Locale of pages displayed by PayPal payment experience.
->setLocaleCode("US");
->setLocaleCode("US")
// A label to use as hypertext for the return to merchant link.
->setReturnUrlLabel("Return")
// A label to use as the title for the note to seller field. Used only when `allow_note` is `1`.
->setNoteToSellerLabel("Thanks!");
// Parameters for input fields customization.
$inputFields = new \PayPal\Api\InputFields();
@@ -43,7 +51,9 @@ $webProfile->setName("YeowZa! T-Shirt Shop" . uniqid())
// Parameters for style and presentation.
->setPresentation($presentation)
// Parameters for input field customization.
->setInputFields($inputFields);
->setInputFields($inputFields)
// Indicates whether the profile persists for three hours or permanently. Set to `false` to persist the profile permanently. Set to `true` to persist the profile for three hours.
->setTemporary(true);
// For Sample Purposes Only.
$request = clone $webProfile;