Skip to content

Commit

Permalink
Merge branch 'release' into PPL-167
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Angell authored Feb 2, 2020
2 parents 9150162 + c9113af commit ba624cf
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion samples/rest/invoice/ListInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/angelleye/PayPal/PayPal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.4
* @filesource
*/

Expand Down
10 changes: 6 additions & 4 deletions src/angelleye/PayPal/RestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function __construct($configArray){
$this->_api_context = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential($configArray['ClientID'], $configArray['ClientSecret'])
);


//$this->set_partner_attribution_id('');

$path = '';
if (isset($configArray['LogPath'])){
$path = $configArray['LogPath'].'/PayPal.log';
Expand All @@ -84,7 +86,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'
)
);
}
Expand All @@ -100,7 +102,7 @@ public function get_api_context(){
}

/**
* Set BN code/value with the
* Set PayPal Partner BN code/value with the
* set_partner_attribution_id function
* by passing the source value to it.
*
Expand Down Expand Up @@ -288,4 +290,4 @@ public function isJson($string) {
json_decode($string);
return (json_last_error() == JSON_ERROR_NONE);
}
}
}
2 changes: 1 addition & 1 deletion src/angelleye/PayPal/rest/invoice/InvoiceAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
25 changes: 25 additions & 0 deletions src/angelleye/PayPal/rest/notifications/NotificationsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down
16 changes: 10 additions & 6 deletions templates/classic/DoDirectPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,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);
}
Expand Down

0 comments on commit ba624cf

Please sign in to comment.