From 1d1f1d46ad02be6596f47ab27f4a7b1e485b883b Mon Sep 17 00:00:00 2001 From: Xiaolei Wheelock Date: Tue, 2 May 2017 15:19:41 -0500 Subject: [PATCH] Add getToken() function to Payment class by getting the EC token from the Approval URL --- lib/PayPal/Api/Payment.php | 2 +- mskrpqzz.osv.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 mskrpqzz.osv.txt diff --git a/lib/PayPal/Api/Payment.php b/lib/PayPal/Api/Payment.php index 0d06b04..4ac9ef4 100644 --- a/lib/PayPal/Api/Payment.php +++ b/lib/PayPal/Api/Payment.php @@ -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]; } diff --git a/mskrpqzz.osv.txt b/mskrpqzz.osv.txt new file mode 100644 index 0000000..d71f6b1 --- /dev/null +++ b/mskrpqzz.osv.txt @@ -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 +# +