Helper Function to Retrieve Specific Link from Model Object

- Helper Methods in Payment and Agreement to get ApprovalLink
- Fixes #195
This commit is contained in:
japatel
2014-12-18 15:41:11 -06:00
parent d5450c64aa
commit f090642fae
12 changed files with 89 additions and 387 deletions

View File

@@ -104,14 +104,9 @@ try {
// ### Get redirect url
// 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->getApprovalLink()
// method
foreach ($payment->getLinks() as $link) {
if ($link->getRel() == 'approval_url') {
$approvalUrl = $link->getHref();
break;
}
}
$approvalUrl = $payment->getApprovalLink();
ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment);