From 7f81b9ca3514e9bc19e51f37942ff7f10aa65ed3 Mon Sep 17 00:00:00 2001 From: tejas Date: Tue, 4 Jun 2019 12:20:50 +0530 Subject: [PATCH 1/8] PPL-163 , adding 3d secure for DoDirectPayment --- templates/classic/DoDirectPayment.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/classic/DoDirectPayment.php b/templates/classic/DoDirectPayment.php index a933eeb0..2f700bf4 100644 --- a/templates/classic/DoDirectPayment.php +++ b/templates/classic/DoDirectPayment.php @@ -96,12 +96,15 @@ array_push($OrderItems, $Item); +/** + * Important note : 3-D Secure Request Fields (UK Merchants Only) + */ $Secure3D = array( - 'authstatus3d' => '', - 'mpivendor3ds' => '', - 'cavv' => '', - 'eci3ds' => '', - 'xid' => '' + 'authstatus3ds' => '', // (Optional) A value returned by CardinalCommerce. If the cmpi_lookup request returns Y for Enrolled, set this field to the PAResStatus value returned by cmpi_authenticate. Otherwise, set this field to blank. + 'mpivendor3ds' => '', // (Optional) A value returned by CardinalCommerce. Set this field to the Enrolled value returned by cmpi_lookup. + 'cavv' => '', // (Optional) A value returned by CardinalCommerce. If the cmpi_lookup request returns Y for Enrolled, set this field to the Cavv value returned by cmpi_authenticate. Otherwise, set this field to blank. + 'eci3ds' => '', // (Optional) A value returned by CardinalCommerce. If the cmpi_lookup request returns Y for Enrolled, set this field to the EciFlag value returned by cmpi_authenticate. Otherwise, set this field to the EciFlag value returned by cmpi_lookup. + 'xid' => '' // (Optional) A value returned by CardinalCommerce. If the cmpi_lookup request returns Y for Enrolled, set this field to the Xid value returned by cmpi_authenticate. Otherwise, set this field to blank. ); $PayPalRequestData = array( @@ -111,7 +114,8 @@ 'BillingAddress' => $BillingAddress, 'ShippingAddress' => $ShippingAddress, 'PaymentDetails' => $PaymentDetails, - 'OrderItems' => $OrderItems + 'OrderItems' => $OrderItems, + 'Secure3D' => $Secure3D, ); // Pass data into class for processing with PayPal and load the response array into $PayPalResult From ab6f4693a3de64efd87e8ce4e8cc4554ae5982d2 Mon Sep 17 00:00:00 2001 From: tejas Date: Tue, 4 Jun 2019 13:51:48 +0530 Subject: [PATCH 2/8] PPL-165 , Added another catch statement to do proper error handling. --- .../rest/notifications/NotificationsAPI.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/angelleye/PayPal/rest/notifications/NotificationsAPI.php b/src/angelleye/PayPal/rest/notifications/NotificationsAPI.php index fea6428e..b3811e47 100644 --- a/src/angelleye/PayPal/rest/notifications/NotificationsAPI.php +++ b/src/angelleye/PayPal/rest/notifications/NotificationsAPI.php @@ -100,6 +100,9 @@ public function CreateWebhook($requestData){ $returnArray['RAWRESPONSE']=$output->toJSON(); return $returnArray; } + catch (Exception $ex) { + return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { return $this->createErrorResponse($ex); } @@ -121,6 +124,8 @@ public function ListWebhooks($requestData){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -140,6 +145,8 @@ public function GetWebhook($webhook_id){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -161,6 +168,8 @@ public function DeleteWebhook($webhook_id){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -212,6 +221,8 @@ public function UpdateWebhook($webhook_id,$requestData){ } } catch (\PayPal\Exception\PayPalConnectionException $ex) { return $this->createErrorResponse($ex); + } catch (Exception $ex) { + return $this->createErrorResponse($ex); } } @@ -232,6 +243,8 @@ public function SearchWebhookEvents($params){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -251,6 +264,8 @@ public function EventNotificationDetails($event_id){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -272,6 +287,8 @@ public function ResendEventNotification($event_id){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -291,6 +308,8 @@ public function WebhooksEventTypes(){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -311,6 +330,8 @@ public function WebhooksEventTypesById($webhook_id){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -342,6 +363,8 @@ public function VerifyWebhookSignature($headers,$webhook_id,$request_body){ } catch (Exception $ex){ return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } @@ -363,6 +386,8 @@ public function SimulateEvent($params){ return $returnArray; } catch (Exception $ex) { return $this->createErrorResponse($ex); + } catch (\PayPal\Exception\PayPalConnectionException $ex) { + return $this->createErrorResponse($ex); } } From 56718be4d9d414dd7b86e41f264aba791a4d99b8 Mon Sep 17 00:00:00 2001 From: tejas Date: Tue, 18 Jun 2019 14:32:39 +0530 Subject: [PATCH 3/8] PPL-166 , adjustment to the array for fetching invoice count. --- samples/rest/invoice/ListInvoice.php | 2 +- src/angelleye/PayPal/rest/invoice/InvoiceAPI.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/rest/invoice/ListInvoice.php b/samples/rest/invoice/ListInvoice.php index 05c0d011..8627dab6 100755 --- a/samples/rest/invoice/ListInvoice.php +++ b/samples/rest/invoice/ListInvoice.php @@ -16,7 +16,7 @@ $parameters = array( 'page' => '0', // A zero-relative index of the list of merchant invoices. 'page_size' => '4', // The number of invoices to list beginning with the specified page. - 'total_count_required ' => 'true', // Indicates whether the total count appears in the response. Default is false. + 'total_count_required' => 'true' // Indicates whether the total count appears in the response. Default is false. ); $returnArray = $PayPal->ListInvoice($parameters); diff --git a/src/angelleye/PayPal/rest/invoice/InvoiceAPI.php b/src/angelleye/PayPal/rest/invoice/InvoiceAPI.php index 63bbba9a..0072566f 100755 --- a/src/angelleye/PayPal/rest/invoice/InvoiceAPI.php +++ b/src/angelleye/PayPal/rest/invoice/InvoiceAPI.php @@ -295,7 +295,7 @@ public function ListInvoice($params,$third_party=false,$refesh_token=''){ if($third_party === true && !empty($refesh_token)){ $apiContext->getCredential()->updateAccessToken($apiContext->getConfig(), $refesh_token); } - $invoices = Invoice::getAll(array_filter($params), $this->_api_context); + $invoices = Invoice::getAll($params, $this->_api_context); $returnArray['RESULT'] = 'Success'; $returnArray['INVOICES'] = $invoices->toArray(); return $returnArray; From 549864a02fc46dd0eddbabc06965de8ffcc4e66d Mon Sep 17 00:00:00 2001 From: angelleye Date: Tue, 9 Jul 2019 02:59:00 -0500 Subject: [PATCH 4/8] Adjusts attributions --- src/angelleye/PayPal/PayPal.php | 2 +- src/angelleye/PayPal/RestClass.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/angelleye/PayPal/PayPal.php b/src/angelleye/PayPal/PayPal.php index 5f0209f0..973a87d7 100755 --- a/src/angelleye/PayPal/PayPal.php +++ b/src/angelleye/PayPal/PayPal.php @@ -75,7 +75,7 @@ function __construct($DataArray) $this->APIVersion = isset($DataArray['APIVersion']) ? $DataArray['APIVersion'] : '204.0'; $this->APIMode = isset($DataArray['APIMode']) ? $DataArray['APIMode'] : 'Signature'; - $this->APIButtonSource = 'AngellEYE_PHPClass'; + $this->APIButtonSource = ''; $this->PathToCertKeyPEM = '/path/to/cert/pem.txt'; $this->SSL = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? true : false; $this->APISubject = isset($DataArray['APISubject']) ? $DataArray['APISubject'] : ''; diff --git a/src/angelleye/PayPal/RestClass.php b/src/angelleye/PayPal/RestClass.php index dfba6f13..1536b531 100644 --- a/src/angelleye/PayPal/RestClass.php +++ b/src/angelleye/PayPal/RestClass.php @@ -63,7 +63,7 @@ public function __construct($configArray){ $this->_api_context = new \PayPal\Rest\ApiContext( new \PayPal\Auth\OAuthTokenCredential($configArray['ClientID'], $configArray['ClientSecret']) ); - $this->set_partner_attribution_id('AngellEYE_PHPClass'); + //$this->set_partner_attribution_id(''); $path = ''; if (isset($configArray['LogPath'])){ $path = $configArray['LogPath'].'/PayPal.log'; @@ -100,8 +100,7 @@ public function get_api_context(){ } /** - * By default the BN code/value is AngellEYE_PHPClass but you can change it - * with the set_partner_attribution_id function by passing the source value to it. + * PayPal Partner Code * * @access public * @param string $source From 4b9040ace3d316f5093d305d4eab6d01f1b27db3 Mon Sep 17 00:00:00 2001 From: angelleye Date: Tue, 9 Jul 2019 03:05:37 -0500 Subject: [PATCH 5/8] Updates details for v3.0.3 --- src/angelleye/PayPal/PayPal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angelleye/PayPal/PayPal.php b/src/angelleye/PayPal/PayPal.php index 973a87d7..bc5fcca6 100755 --- a/src/angelleye/PayPal/PayPal.php +++ b/src/angelleye/PayPal/PayPal.php @@ -24,7 +24,7 @@ * @link https://github.com/angelleye/paypal-php-library/ * @website http://www.angelleye.com * @support http://www.angelleye.com/product/premium-support/ - * @version v3.0.2 + * @version v3.0.3 * @filesource */ From a53ecd5c7ef3bc1b53acf253fd3f1c465c8c633a Mon Sep 17 00:00:00 2001 From: angelleye Date: Tue, 16 Jul 2019 03:42:56 -0500 Subject: [PATCH 6/8] Removes attribution --- .../referenced_payouts/create_referenced_batch_payout.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/templates/rest/referenced_payouts/create_referenced_batch_payout.php b/templates/rest/referenced_payouts/create_referenced_batch_payout.php index 395e5f27..ffda56c7 100644 --- a/templates/rest/referenced_payouts/create_referenced_batch_payout.php +++ b/templates/rest/referenced_payouts/create_referenced_batch_payout.php @@ -14,9 +14,6 @@ $PayPal = new \angelleye\PayPal\rest\referenced_payouts\ReferencedPayoutsAPI($configArray); -// Header parameters -$PayPal_Partner_Attribution_Id = 'AngellEYE_PHPClass'; // For more information about PayPal-Partner-Attribution-Id, see https://developer.paypal.com/docs/api/overview/#paypal-partner-attribution-id - /* Indicates how the client expects the server to process this request. * To process the request asynchronously, set this header to respond-async. * If you omit this header, the API processes the request synchronously. @@ -26,9 +23,6 @@ $Prefer = ''; $PayPal_Request_Id = ''; // The server stores keys for three days. For more information about PayPal-Request-Id, see https://developer.paypal.com/docs/api/overview/#paypal-request-id -if(!empty($PayPal_Partner_Attribution_Id)) { - $PayPal->set_partner_attribution_id($PayPal_Partner_Attribution_Id); -} if(!empty($Prefer)) { $PayPal->set_prefer($Prefer); } From 0638b89ee594b2f10be926e3588d0fb15e4b9cd4 Mon Sep 17 00:00:00 2001 From: angelleye Date: Tue, 16 Jul 2019 03:56:01 -0500 Subject: [PATCH 7/8] Updates version tag --- src/angelleye/PayPal/PayPal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angelleye/PayPal/PayPal.php b/src/angelleye/PayPal/PayPal.php index bc5fcca6..f871f263 100755 --- a/src/angelleye/PayPal/PayPal.php +++ b/src/angelleye/PayPal/PayPal.php @@ -24,7 +24,7 @@ * @link https://github.com/angelleye/paypal-php-library/ * @website http://www.angelleye.com * @support http://www.angelleye.com/product/premium-support/ - * @version v3.0.3 + * @version v3.0.4 * @filesource */ From 571aa5f7ac697769b8e85004a7fc862850cbcb2e Mon Sep 17 00:00:00 2001 From: Firegore Date: Fri, 16 Aug 2019 18:19:24 +0200 Subject: [PATCH 8/8] fixed LogLevel fixed LogLevel --- src/angelleye/PayPal/RestClass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/angelleye/PayPal/RestClass.php b/src/angelleye/PayPal/RestClass.php index 1536b531..1b49c44f 100644 --- a/src/angelleye/PayPal/RestClass.php +++ b/src/angelleye/PayPal/RestClass.php @@ -84,7 +84,7 @@ public function __construct($configArray){ 'mode' => $mode, 'log.LogEnabled' => isset($configArray['LogResults']) ? $configArray['LogResults'] : false, 'log.FileName' => $path, - 'log.LogLevel' => isset($configArray['LogLevel']) ? $configArray['LogPath'] : 'INFO' + 'log.LogLevel' => isset($configArray['LogLevel']) ? $configArray['LogLevel'] : 'INFO' ) ); } @@ -286,4 +286,4 @@ public function isJson($string) { json_decode($string); return (json_last_error() == JSON_ERROR_NONE); } -} \ No newline at end of file +}