Add getToken() function to Payment class by getting the EC token from the Approval URL

This commit is contained in:
Xiaolei Wheelock
2017-05-02 15:19:41 -05:00
parent ea0897544c
commit 1d1f1d46ad
2 changed files with 15 additions and 1 deletions

View File

@@ -553,7 +553,7 @@ class Payment extends PayPalResourceModel
public function getToken()
{
$parameter_name = "token";
parse_str(parse_url($this->getApprovalLink())['query'], $query);
parse_str(parse_url($this->getApprovalLink(), PHP_URL_QUERY), $query);
return (!isset($query[$parameter_name]) || is_null($query[$parameter_name])) ? null : $query[$parameter_name];
}

14
mskrpqzz.osv.txt Normal file
View File

@@ -0,0 +1,14 @@
Add getToken() to Payment class to get the EC token from the Approval URL
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Tue May 2 14:10:00 2017 -0500
#
# On branch master
# Your branch is up-to-date with 'origin/master'.
#
# Changes to be committed:
# modified: lib/PayPal/Api/Payment.php
#