forked from LiveCarta/PayPal-PHP-SDK
Updated Samples Documentation
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -8,13 +8,8 @@ API used: /v1/payments/billing-plans</p></div></div></div><div class="segment"><
|
|||||||
|
|
||||||
<span class="hljs-keyword">try</span> {
|
<span class="hljs-keyword">try</span> {
|
||||||
<span class="hljs-variable">$result</span> = <span class="hljs-variable">$createdPlan</span>->delete(<span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-variable">$result</span> = <span class="hljs-variable">$createdPlan</span>->delete(<span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<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">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$createdPlan</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$createdPlan</span>;</div></div></div></div></body></html>
|
||||||
@@ -8,13 +8,8 @@ API used: /v1/payments/billing-plans</p></div></div></div><div class="segment"><
|
|||||||
|
|
||||||
<span class="hljs-keyword">try</span> {
|
<span class="hljs-keyword">try</span> {
|
||||||
<span class="hljs-variable">$plan</span> = Plan::get(<span class="hljs-variable">$createdPlan</span>->getId(), <span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-variable">$plan</span> = Plan::get(<span class="hljs-variable">$createdPlan</span>->getId(), <span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<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">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$plan</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$plan</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$plan</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$plan</span>;</div></div></div></div></body></html>
|
||||||
@@ -9,10 +9,6 @@ all invoice from history.</p></div></div><div class="code"><div class="wrapper">
|
|||||||
static <code>get_all</code> method on the Invoice class.
|
static <code>get_all</code> method on the Invoice class.
|
||||||
Refer the method doc for valid values for keys
|
Refer the method doc for valid values for keys
|
||||||
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::getAll(<span class="hljs-keyword">array</span>(<span class="hljs-string">'page'</span> => <span class="hljs-number">0</span>, <span class="hljs-string">'page_size'</span> => <span class="hljs-number">4</span>, <span class="hljs-string">'total_count_required'</span> => <span class="hljs-string">"true"</span>), <span class="hljs-variable">$apiContext</span>);
|
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::getAll(<span class="hljs-keyword">array</span>(<span class="hljs-string">'page'</span> => <span class="hljs-number">0</span>, <span class="hljs-string">'page_size'</span> => <span class="hljs-number">4</span>, <span class="hljs-string">'total_count_required'</span> => <span class="hljs-string">"true"</span>), <span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<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">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>
|
|
||||||
@@ -20,10 +20,6 @@ Using the new way to inject raw json string to constructor</p></div></div><div c
|
|||||||
static <code>search</code> method on the Invoice class.
|
static <code>search</code> method on the Invoice class.
|
||||||
Refer the method doc for valid values for keys
|
Refer the method doc for valid values for keys
|
||||||
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::search(<span class="hljs-variable">$search</span>, <span class="hljs-variable">$apiContext</span>);
|
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::search(<span class="hljs-variable">$search</span>, <span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<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">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$search</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$search</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>
|
|
||||||
@@ -7,13 +7,8 @@ that contains the web profile ID.</p></div></div><div class="code"><div class="w
|
|||||||
<span class="hljs-variable">$createProfileResponse</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'CreateWebProfile.php'</span>;
|
<span class="hljs-variable">$createProfileResponse</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'CreateWebProfile.php'</span>;
|
||||||
|
|
||||||
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>If your request is successful, the API returns a web_profile object response that contains the profile details.</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$webProfile</span> = \PayPal\Api\WebProfile::get(<span class="hljs-variable">$createProfileResponse</span>->getId(), <span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>If your request is successful, the API returns a web_profile object response that contains the profile details.</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$webProfile</span> = \PayPal\Api\WebProfile::get(<span class="hljs-variable">$createProfileResponse</span>->getId(), <span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (\PayPal\<span class="hljs-keyword">Exception</span>\PayPalConnectionException <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (\PayPal\<span class="hljs-keyword">Exception</span>\PayPalConnectionException <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<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 Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$webProfile</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$webProfile</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$webProfile</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$webProfile</span>;</div></div></div></div></body></html>
|
||||||
@@ -67,16 +67,11 @@ The return object contains the state and the
|
|||||||
url to which the buyer must be redirected to
|
url to which the buyer must be redirected to
|
||||||
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
||||||
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
||||||
<p>The API response provides the url that you must redirect
|
<p>The API response provides the url that you must redirect
|
||||||
the buyer to. Retrieve the url from the $payment->getLinks()
|
the buyer to. Retrieve the url from the $payment->getLinks()
|
||||||
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();
|
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();</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">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
||||||
@@ -64,16 +64,11 @@ The return object contains the state and the
|
|||||||
url to which the buyer must be redirected to
|
url to which the buyer must be redirected to
|
||||||
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
||||||
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
||||||
<p>The API response provides the url that you must redirect
|
<p>The API response provides the url that you must redirect
|
||||||
the buyer to. Retrieve the url from the $payment->getApprovalLink()
|
the buyer to. Retrieve the url from the $payment->getApprovalLink()
|
||||||
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();
|
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();</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">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
||||||
@@ -64,16 +64,11 @@ The return object contains the state and the
|
|||||||
url to which the buyer must be redirected to
|
url to which the buyer must be redirected to
|
||||||
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
||||||
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
||||||
<p>The API response provides the url that you must redirect
|
<p>The API response provides the url that you must redirect
|
||||||
the buyer to. Retrieve the url from the $payment->getApprovalLink()
|
the buyer to. Retrieve the url from the $payment->getApprovalLink()
|
||||||
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();
|
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();</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">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
||||||
@@ -64,16 +64,11 @@ The return object contains the state and the
|
|||||||
url to which the buyer must be redirected to
|
url to which the buyer must be redirected to
|
||||||
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
||||||
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
<span class="hljs-variable">$payment</span>->create(<span class="hljs-variable">$apiContext</span>);
|
||||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</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::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
|
|
||||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
|
||||||
<p>The API response provides the url that you must redirect
|
<p>The API response provides the url that you must redirect
|
||||||
the buyer to. Retrieve the url from the $payment->getApprovalLink()
|
the buyer to. Retrieve the url from the $payment->getApprovalLink()
|
||||||
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();
|
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>->getApprovalLink();</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">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
||||||
|
|
||||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
|
||||||
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"<a href='$approvalUrl' >$approvalUrl</a>"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
|
|
||||||
|
|
||||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
||||||
Reference in New Issue
Block a user