From f8ce0b9c31cafd84b910c984299b70e49f22bc76 Mon Sep 17 00:00:00 2001 From: Igor Goltsov Date: Sun, 25 Sep 2022 12:04:24 +0300 Subject: [PATCH 1/3] MPGS-767: [Merchant] [M2] [Simplify] Error in M2.4.4 | Di:compile error and not able to place order --- lib/simplifycommerce-sdk-php/LICENSE.txt | 2 +- lib/simplifycommerce-sdk-php/README.txt | 4 +- lib/simplifycommerce-sdk-php/lib/Simplify.php | 38 ++++----- .../lib/Simplify/AccessToken.php | 35 ++++---- .../lib/Simplify/Authentication.php | 37 ++++----- .../lib/Simplify/Authorization.php | 44 +++++----- .../lib/Simplify/CardToken.php | 78 ++++++++++++------ .../lib/Simplify/Chargeback.php | 82 ------------------- .../lib/Simplify/Constants.php | 38 ++++----- .../lib/Simplify/Coupon.php | 38 ++++----- .../lib/Simplify/Customer.php | 43 +++++----- .../lib/Simplify/DataToken.php | 77 ----------------- .../lib/Simplify/Deposit.php | 82 ------------------- .../lib/Simplify/Event.php | 40 ++++----- .../lib/Simplify/Exceptions.php | 52 ++++++------ .../lib/Simplify/FraudCheck.php | 46 +++++------ .../lib/Simplify/Http.php | 38 ++++----- .../lib/Simplify/Invoice.php | 41 +++++----- .../lib/Simplify/InvoiceItem.php | 38 ++++----- .../lib/Simplify/Object.php | 38 ++++----- .../lib/Simplify/Payment.php | 44 +++++----- .../lib/Simplify/PaymentsApi.php | 6 +- .../lib/Simplify/Plan.php | 38 ++++----- .../lib/Simplify/Refund.php | 38 ++++----- .../lib/Simplify/ResourceList.php | 38 ++++----- .../lib/Simplify/Subscription.php | 47 ++++++----- .../lib/Simplify/Tax.php | 38 ++++----- .../lib/Simplify/TransactionReview.php | 47 +++++------ .../lib/Simplify/Webhook.php | 38 ++++----- 29 files changed, 508 insertions(+), 717 deletions(-) delete mode 100644 lib/simplifycommerce-sdk-php/lib/Simplify/Chargeback.php delete mode 100644 lib/simplifycommerce-sdk-php/lib/Simplify/DataToken.php delete mode 100644 lib/simplifycommerce-sdk-php/lib/Simplify/Deposit.php diff --git a/lib/simplifycommerce-sdk-php/LICENSE.txt b/lib/simplifycommerce-sdk-php/LICENSE.txt index b59d1c9..8a13101 100644 --- a/lib/simplifycommerce-sdk-php/LICENSE.txt +++ b/lib/simplifycommerce-sdk-php/LICENSE.txt @@ -1,5 +1,5 @@ -Copyright (c) 2013 - 2019 MasterCard International Incorporated +Copyright (c) 2013 - 2022 MasterCard International Incorporated All rights reserved. Redistribution and use in source and binary forms, with or without modification, are diff --git a/lib/simplifycommerce-sdk-php/README.txt b/lib/simplifycommerce-sdk-php/README.txt index 0c5e37b..3f49ffc 100644 --- a/lib/simplifycommerce-sdk-php/README.txt +++ b/lib/simplifycommerce-sdk-php/README.txt @@ -52,7 +52,7 @@ Version ------- - This is version 1.6.0 of the SDK. See CHANGES.txt for a list + This is version 1.7.0 of the SDK. See CHANGES.txt for a list of changes. For an up-to-date version check at https://www.simplify.com/commerce/docs/sdk/php. @@ -76,6 +76,6 @@ Copyright --------- - Copyright (c) 2013 - 2019 MasterCard International Incorporated + Copyright (c) 2013 - 2022 MasterCard International Incorporated All rights reserved. diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify.php b/lib/simplifycommerce-sdk-php/lib/Simplify.php index 3fcf7a0..278db0d 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify.php @@ -1,31 +1,30 @@ privateKey = $privateKey; $this->accessToken = $accessToken; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Authorization.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Authorization.php index 8a76900..beb9bbe 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Authorization.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Authorization.php @@ -1,31 +1,31 @@ card.addressState
State of residence of the cardholder. State abbreviations should be used. [max length: 255]
*
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 characters in length and only contains numbers or letters. [max length: 32]
*
card.cvc
CVC security code of the card. This is the code on the back of the card. Example: 123
- *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] required
- *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] required
+ *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12]
+ *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99]
*
card.name
Name as it appears on the card. [max length: 50, min length: 2]
- *
card.number
Card number as it appears on the card. [max length: 19, min length: 13] required
+ *
card.number
Card number as it appears on the card. [max length: 19, min length: 13]
*
currency
Currency code (ISO-4217) for the transaction. Must match the currency associated with your account. [default: USD] required
*
customer
ID of customer. If specified, card on file of customer will be used.
*
description
Free form text field to be used as a description of the payment. This field is echoed back with the payment on any find or list operations. [max length: 1024]
@@ -168,4 +168,4 @@ static public function findAuthorization($id, $authentication = null) { public function getClazz() { return "Authorization"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/CardToken.php b/lib/simplifycommerce-sdk-php/lib/Simplify/CardToken.php index 2be1d69..e08213a 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/CardToken.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/CardToken.php @@ -1,36 +1,37 @@ + *
authenticatePayer
Set as true to create CardToken for EMV 3DS transaction. [default: false]
*
callback
The URL callback for the cardtoken
*
card.addressCity
City of the cardholder. [max length: 50, min length: 2]
*
card.addressCountry
Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. [max length: 2, min length: 2]
@@ -39,11 +40,17 @@ class Simplify_CardToken extends Simplify_Object { *
card.addressState
State of residence of the cardholder. State abbreviations should be used. [max length: 255]
*
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. [max length: 32]
*
card.cvc
CVC security code of the card. This is the code on the back of the card. Example: 123
- *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] required
- *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] required
+ *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12]
+ *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99]
*
card.name
Name as appears on the card. [max length: 50, min length: 2]
- *
card.number
Card number as it appears on the card. [max length: 19, min length: 13] required
- *
key
Key used to create the card token.
+ *
card.number
Card number as it appears on the card. [max length: 19, min length: 13]
+ *
key
Key used to create the card token.
+ *
secure3DRequestData.amount
Amount of the subsequent transaction in the smallest unit of your currency. Example: 100 = $1.00 required
+ *
secure3DRequestData.authOnly
Specifies if the subsequent transaction is going to be a Payment or an Authorization (to be Captured later). If false or not specified, it refers to a Payment, otherwise it refers to an Authorization.
+ *
secure3DRequestData.currency
Currency code (ISO-4217). Must match the currency associated with your account. required
+ *
secure3DRequestData.description
A description of the transaction. [max length: 256]
+ *
secure3DRequestData.id
3D Secure data ID.
+ *
source
Card Token Source [default: API]
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. * @return CardToken a CardToken object. */ @@ -81,10 +88,35 @@ static public function findCardToken($id, $authentication = null) { return $obj; } + + /** + * Updates an Simplify_CardToken object. + * + * The properties that can be updated: + *
+ *
device.browser
The User-Agent header of the browser the customer used to place the order required
+ *
device.ipAddress
The IP address of the device used by the payer, in nnn.nnn.nnn.nnn format. required
+ *
device.language
The language supported for the payer's browser as defined in IETF BCP47.
+ *
device.screenHeight
The total height of the payer's browser screen in pixels.
+ *
device.screenWidth
The total width of the payer's browser screen in pixels.
+ *
device.timeZone
The timezone of the device used by the payer, in Zone ID format. Example: "Europe/Dublin" required
+ *
key
The public key of the merchant to be used for the token
+ * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. + * @return CardToken a CardToken object. + */ + public function updateCardToken($authentication = null) { + + $args = func_get_args(); + $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 1); + + $object = Simplify_PaymentsApi::updateObject($this, $authentication); + return $object; + } + /** * @ignore */ public function getClazz() { return "CardToken"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Chargeback.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Chargeback.php deleted file mode 100644 index 16cec4d..0000000 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Chargeback.php +++ /dev/null @@ -1,82 +0,0 @@ - - *
filter
filter.textFilter by the description of the chargeback
filter.idFilter by the chargeback Id
filter.amountFilter by the chargeback amount (in the smallest unit of your currency)
filter.dateCreatedMin*Filter by the minimum created date you are searching for - Date in UTC millis
filter.dateCreatedMax*Filter by the maximum created date you are searching for - Date in UTC millis
filter.chargebackDateMin*Filter by the earliest chargeback date you are searching for - Date in UTC millis
filter.chargebackDateMax*Filter by the latest chargeback date you are searching for - Date in UTC millis
filter.depositFilter by the deposit id
filter.qYou can use this to filter by the Id, the payment card's last 4 digits or the chargeback amount

*Use dateCreatedMin with dateCreatedMax (or chargebackDateMin and chargebackDateMax) in the same filter if you want to search between two created dates
- *
max
Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
- *
offset
Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
- *
sorting
Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either asc for ascending or desc for descending). Sortable properties are: id amount description dateCreated.
- * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. - * @return ResourceList a ResourceList object that holds the list of Chargeback objects and the total - * number of Chargeback objects available for the given criteria. - * @see ResourceList - */ - static public function listChargeback($criteria = null, $authentication = null) { - - $args = func_get_args(); - $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); - - $val = new Simplify_Chargeback(); - $list = Simplify_PaymentsApi::listObject($val, $criteria, $authentication); - - return $list; - } - - - /** - * Retrieve a Simplify_Chargeback object from the API - * - * @param string id the id of the Chargeback object to retrieve - * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. - * @return Chargeback a Chargeback object - */ - static public function findChargeback($id, $authentication = null) { - - $args = func_get_args(); - $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); - - $val = new Simplify_Chargeback(); - $val->id = $id; - - $obj = Simplify_PaymentsApi::findObject($val, $authentication); - - return $obj; - } - - /** - * @ignore - */ - public function getClazz() { - return "Chargeback"; - } -} diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Constants.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Constants.php index c73c619..156fde8 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Constants.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Constants.php @@ -1,31 +1,31 @@ subscriptions.billingCycleLimit
The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
*
subscriptions.coupon
Coupon associated with the subscription for the customer.
*
subscriptions.currency
Currency code (ISO-4217). Must match the currency associated with your account.
+ *
subscriptions.currentPeriodEnd
End date of subscription's current period
+ *
subscriptions.currentPeriodStart
Start date of subscription's current period
*
subscriptions.customer
The customer ID to create the subscription for. Do not supply this when creating a customer.
*
subscriptions.frequency
Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
*
subscriptions.frequencyPeriod
Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly.
- *
subscriptions.name
Name describing subscription
+ *
subscriptions.name
Name describing subscription [max length: 50]
*
subscriptions.plan
The plan ID that the subscription should be created from.
*
subscriptions.quantity
Quantity of the plan for the subscription. [min value: 1]
*
subscriptions.renewalReminderLeadDays
If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null, then no emails are sent. Minimum value is 7 if set.
+ *
subscriptions.source
Source of where subscription was created
*
token
If specified, card associated with card token will be used
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. * @return Customer a Customer object. @@ -177,4 +180,4 @@ public function updateCustomer($authentication = null) { public function getClazz() { return "Customer"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/DataToken.php b/lib/simplifycommerce-sdk-php/lib/Simplify/DataToken.php deleted file mode 100644 index e48ac90..0000000 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/DataToken.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. - * @return DataToken a DataToken object. - */ - static public function createDataToken($hash, $authentication = null) { - - $args = func_get_args(); - $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); - - $instance = new Simplify_DataToken(); - $instance->setAll($hash); - - $object = Simplify_PaymentsApi::createObject($instance, $authentication); - return $object; - } - - - - /** - * Retrieve a Simplify_DataToken object from the API - * - * @param string id the id of the DataToken object to retrieve - * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. - * @return DataToken a DataToken object - */ - static public function findDataToken($id, $authentication = null) { - - $args = func_get_args(); - $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); - - $val = new Simplify_DataToken(); - $val->id = $id; - - $obj = Simplify_PaymentsApi::findObject($val, $authentication); - - return $obj; - } - - /** - * @ignore - */ - public function getClazz() { - return "DataToken"; - } -} diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Deposit.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Deposit.php deleted file mode 100644 index 80cadb7..0000000 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Deposit.php +++ /dev/null @@ -1,82 +0,0 @@ - - *
filter
filter.idFilter by the deposit Id
filter.amountFilter by the deposit amount (in the smallest unit of your currency)
filter.dateCreatedMin*Filter by the minimum created date you are searching for - Date in UTC millis
filter.dateCreatedMax*Filter by the maximum created date you are searching for - Date in UTC millis
filter.depositDateMinFilter by the earliest deposit date you are searching for - Date in UTC millis
filter.depositDateMaxFilter by the latest deposit date you are searching for - Date in UTC millis
filter.creditCountFilter by the creditCount figure for the deposit
filter.creditAmountFilter by the creditAmount figure for the deposit
filter.debitCountFilter by the debitCount figure for the deposit
filter.debitAmountFilter by the debitAmount figure for the deposit
filter.netCountFilter by the netCount figure for the deposit
filter.netAmountFilter by the netAmount figure for the deposit
filter.qYou can use this to filter by different figures or strings - can be the Id, creditAmount or the debitAmount for the deposit

*Use dateCreatedMin with dateCreatedMax in the same filter if you want to search between two created dates
- *
max
Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
- *
offset
Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
- *
sorting
Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either asc for ascending or desc for descending). Sortable properties are: amount dateCreated depositDate.
- * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. - * @return ResourceList a ResourceList object that holds the list of Deposit objects and the total - * number of Deposit objects available for the given criteria. - * @see ResourceList - */ - static public function listDeposit($criteria = null, $authentication = null) { - - $args = func_get_args(); - $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); - - $val = new Simplify_Deposit(); - $list = Simplify_PaymentsApi::listObject($val, $criteria, $authentication); - - return $list; - } - - - /** - * Retrieve a Simplify_Deposit object from the API - * - * @param string id the id of the Deposit object to retrieve - * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. - * @return Deposit a Deposit object - */ - static public function findDeposit($id, $authentication = null) { - - $args = func_get_args(); - $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); - - $val = new Simplify_Deposit(); - $val->id = $id; - - $obj = Simplify_PaymentsApi::findObject($val, $authentication); - - return $obj; - } - - /** - * @ignore - */ - public function getClazz() { - return "Deposit"; - } -} diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Event.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Event.php index 1c99aa8..89284c8 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Event.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Event.php @@ -1,31 +1,31 @@ convertFromHashToObject($jsonObject['event'], self::getClazz()); } @@ -61,4 +61,4 @@ static public function createEvent($hash, $authentication = null) { static public function getClazz() { return "Event"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Exceptions.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Exceptions.php index 56aac23..1c39241 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Exceptions.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Exceptions.php @@ -1,31 +1,31 @@ reference = null; if ($errorData != null) { - + $this->reference = $errorData['reference']; $this->errorData = $errorData; - $error = $errorData['error']; + $error = $errorData['error']; if ($error != null) { - + $m = $error['message']; if ($m != null) { $this->message = $m; @@ -67,7 +67,7 @@ function __construct($message, $status = null, $errorData = null) { } } } - + /** * Returns a map of all error data returned by the API. * @return array a map containing API error data. @@ -83,7 +83,7 @@ function getErrorData() { function getStatus() { return $this->status; } - + /** * Returns unique reference for the API error. * @return string a reference (or null if there is no reference). @@ -105,7 +105,7 @@ function getErrorCode() { * @return string Description of the error. */ function describe() { - return get_class($this) . ": \"" + return get_class($this) . ": \"" . $this->getMessage() . "\" (status: " . $this->getStatus() . ", error code: " . $this->getErrorCode() . ", reference: " @@ -161,7 +161,7 @@ function __construct($message, $status = null, $errorData = null) { if ($error != null) { $fieldErrors = $error['fieldErrors']; if ($fieldErrors != null) { - $this->fieldErrors = array(); + $this->fieldErrors = array(); foreach ($fieldErrors as $fieldError) { array_push($this->fieldErrors, new Simplify_FieldError($fieldError)); } @@ -213,7 +213,7 @@ class Simplify_FieldError { * @ignore */ function __construct($errorData) { - + $this->field = $errorData['field']; $this->code = $errorData['code']; $this->message = $errorData['message']; diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/FraudCheck.php b/lib/simplifycommerce-sdk-php/lib/Simplify/FraudCheck.php index 9028c1d..a2fe335 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/FraudCheck.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/FraudCheck.php @@ -1,31 +1,31 @@ card.addressState
State of residence of the cardholder. State abbreviations should be used. [max length: 255]
*
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 characters in length and only contains numbers or letters. [max length: 32]
*
card.cvc
CVC security code of the card. This is the code on the back of the card. Example: 123
- *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] required
- *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] required
+ *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12]
+ *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99]
*
card.name
Name as it appears on the card. [max length: 50, min length: 2]
- *
card.number
Card number as it appears on the card. [max length: 19, min length: 13] required
+ *
card.number
Card number as it appears on the card. [max length: 19, min length: 13]
*
currency
Currency code (ISO-4217) for the transaction to be checked for fraud. This field is required if using “full” or “advanced” mode.
*
description
- Description of the fraud check. [max length: 255]
*
ipAddress
IP Address of the customer for which the fraud check is to be done. [max length: 45]
- *
mode
Fraud check mode. “simple” only does an AVS and CVC check; “advanced” does a complete fraud check, running the input against the set up rules. [valid values: simple, advanced, full] required
+ *
mode
Fraud check mode. “simple” only does an AVS and CVC check; “advanced” does a complete fraud check, running the input against the set up rules. [valid values: simple, advanced, full, SIMPLE, ADVANCED, FULL] required
*
sessionId
Session ID used during data collection. [max length: 255]
*
token
Card token representing card details for the card to be checked. [max length: 255]
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. @@ -141,4 +141,4 @@ public function updateFraudCheck($authentication = null) { public function getClazz() { return "FraudCheck"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Http.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Http.php index 3150032..a288af5 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Http.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Http.php @@ -1,31 +1,31 @@ $authentication->publicKey, self::JWS_HDR_URI => $url, self::JWS_HDR_TIMESTAMP => sprintf("%u000", round(microtime(true))), - self::JWS_HDR_NONCE => sprintf("%u", random_int(PHP_INT_MIN, PHP_INT_MAX)), + self::JWS_HDR_NONCE => sprintf("%u", mt_rand()), ); // add oauth token if provided diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Invoice.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Invoice.php index 04960a9..7cb4159 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Invoice.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Invoice.php @@ -1,31 +1,31 @@ dueDate
The date invoice payment is due. If a late fee is provided this will be added to the invoice total is the due date has past.
*
email
The email of the customer we are invoicing. This is optional if customer or invoiceToCopy is provided. A new customer will be created using the the name and email.
*
invoiceId
User defined invoice id. If not provided the system will generate a numeric id. [max length: 255]
+ *
invoiceLanguage
The language in which invoice will be displayed. [max length: 5, min length: 5]
*
invoiceToCopy
The id of an existing invoice to be copied. This is optional if customer or a name and email are provided
*
items.amount
Amount of the invoice item (the smallest unit of your currency). Example: 100 = $1.00 required
*
items.description
The description of the invoice item. [max length: 1024]
@@ -180,6 +181,7 @@ static public function findInvoice($id, $authentication = null) { *
dueDate
The date invoice payment is due. If a late fee is provided this will be added to the invoice total is the due date has past.
*
email
The email of the customer we are invoicing. This is optional if customer or invoiceToCopy is provided. A new customer will be created using the the name and email.
*
invoiceId
User defined invoice id. If not provided the system will generate a numeric id. [max length: 255]
+ *
invoiceLanguage
The language in which invoice will be displayed. [max length: 5, min length: 5]
*
items.amount
Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00 required
*
items.description
The description of the invoice item. [max length: 1024]
*
items.invoice
The ID of the invoice this item belongs to.
@@ -193,6 +195,7 @@ static public function findInvoice($id, $authentication = null) { *
note
This field can be used to store a note that is not displayed to the customer. [max length: 4000]
*
payment
The ID of the payment. Use this ID to query the /payment API. [max length: 255]
*
reference
User defined reference field. [max length: 255]
+ *
sendMail
Boolean flag. If true the invoice will be sent to the customer if the invoice is in an OPEN state. [default: false] required
*
shippingAddress.city
Address city of the location where the goods or services were supplied. [max length: 255, min length: 2]
*
shippingAddress.country
Address country of the location where the goods or services were supplied. [max length: 2, min length: 2]
*
shippingAddress.line1
Address line 1 of the location where the goods or services were supplied. [max length: 255]
@@ -221,4 +224,4 @@ public function updateInvoice($authentication = null) { public function getClazz() { return "Invoice"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/InvoiceItem.php b/lib/simplifycommerce-sdk-php/lib/Simplify/InvoiceItem.php index 99d9ac9..fce3e83 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/InvoiceItem.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/InvoiceItem.php @@ -1,31 +1,31 @@ properties; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Payment.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Payment.php index 188ff2c..f600b56 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Payment.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Payment.php @@ -1,31 +1,31 @@ card.addressState
State of residence of the cardholder. State abbreviations should be used. [max length: 255]
*
card.addressZip
Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. [max length: 32]
*
card.cvc
CVC security code of the card. This is the code on the back of the card. Example: 123
- *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] required
- *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] required
+ *
card.expMonth
Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12]
+ *
card.expYear
Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99]
*
card.name
Name as it appears on the card. [max length: 50, min length: 2]
- *
card.number
Card number as it appears on the card. [max length: 19, min length: 13] required
+ *
card.number
Card number as it appears on the card. [max length: 19, min length: 13]
*
currency
Currency code (ISO-4217) for the transaction. Must match the currency associated with your account. [default: USD] required
*
customer
ID of customer. If specified, card on file of customer will be used.
*
description
Free form text field to be used as a description of the payment. This field is echoed back with the payment on any find or list operations. [max length: 1024]
@@ -172,4 +172,4 @@ public function updatePayment($authentication = null) { public function getClazz() { return "Payment"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/PaymentsApi.php b/lib/simplifycommerce-sdk-php/lib/Simplify/PaymentsApi.php index 0f93e96..986d2b8 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/PaymentsApi.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/PaymentsApi.php @@ -1,6 +1,6 @@ $expectedArgCount) { $authentication = new Simplify_Authentication($args[$expectedArgCount-1], $args[$expectedArgCount]); diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Plan.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Plan.php index bf8f4fb..0730aa8 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Plan.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Plan.php @@ -1,31 +1,31 @@ () methods. @@ -41,4 +41,4 @@ class Simplify_ResourceList { * @var int $total the total number of object available. */ public $total = 0; -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Subscription.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Subscription.php index d97116b..4bc00ae 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Subscription.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Subscription.php @@ -1,31 +1,31 @@ billingCycleLimit
The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
*
coupon
Coupon ID associated with the subscription
*
currency
Currency code (ISO-4217). Must match the currency associated with your account.
+ *
currentPeriodEnd
End date of subscription's current period
+ *
currentPeriodStart
Start date of subscription's current period
*
customer
Customer that is enrolling in the subscription.
*
frequency
Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
*
frequencyPeriod
Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly.
- *
name
Name describing subscription
+ *
name
Name describing subscription [max length: 50]
*
plan
The ID of the plan that should be used for the subscription.
*
quantity
Quantity of the plan for the subscription. [min value: 1]
- *
renewalReminderLeadDays
If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null, then no emails are sent. Minimum value is 7 if set.
+ *
renewalReminderLeadDays
If set, how many days before the next billing cycle that a renewal reminder is sent to the customer. If null, then no emails are sent. Minimum value is 7 if set.
+ *
source
Source of where subscription was created
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. * @return Subscription a Subscription object. */ @@ -132,6 +135,8 @@ static public function findSubscription($id, $authentication = null) { *
billingCycleLimit
The number of fixed billing cycles for a plan. Only used if the billingCycle parameter is set to FIXED. Example: 4
*
coupon
Coupon being assigned to this subscription
*
currency
Currency code (ISO-4217). Must match the currency associated with your account.
+ *
currentPeriodEnd
End date of subscription's current period
+ *
currentPeriodStart
Start date of subscription's current period
*
frequency
Frequency of payment for the plan. Used in conjunction with frequencyPeriod. Valid values are "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
*
frequencyPeriod
Period of frequency of payment for the plan. Example: if the frequency is weekly, and periodFrequency is 2, then the subscription is billed bi-weekly. [min value: 1]
*
name
Name describing subscription
@@ -157,4 +162,4 @@ public function updateSubscription($authentication = null) { public function getClazz() { return "Subscription"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Tax.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Tax.php index 58a4fe4..b3d1432 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Tax.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Tax.php @@ -1,31 +1,31 @@ - *
filter
filter.idFilter by the Id of the transaction review
filter.labelFilter by the status of the transaction review
- *
max
Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
- *
offset
Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
- *
sorting
Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either asc for ascending or desc for descending). Sortable properties are: dateCreated status.
+ * @param array criteria a map of parameters; valid keys are:
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. * @return ResourceList a ResourceList object that holds the list of TransactionReview objects and the total * number of TransactionReview objects available for the given criteria. @@ -114,8 +110,7 @@ static public function findTransactionReview($id, $authentication = null) { * Updates an Simplify_TransactionReview object. * * The properties that can be updated: - *
- *
status
Status of the transaction review.
+ *
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. For backwards compatibility the public and private keys may be passed instead of the authentication object. * @return TransactionReview a TransactionReview object. */ @@ -134,4 +129,4 @@ public function updateTransactionReview($authentication = null) { public function getClazz() { return "TransactionReview"; } -} +} \ No newline at end of file diff --git a/lib/simplifycommerce-sdk-php/lib/Simplify/Webhook.php b/lib/simplifycommerce-sdk-php/lib/Simplify/Webhook.php index ba90a62..eed0903 100644 --- a/lib/simplifycommerce-sdk-php/lib/Simplify/Webhook.php +++ b/lib/simplifycommerce-sdk-php/lib/Simplify/Webhook.php @@ -1,31 +1,31 @@ Date: Thu, 20 Oct 2022 16:21:31 +0300 Subject: [PATCH 2/3] MPGS-767: Fix the issue then Payment Form opens in the separate browser tab then Simplify Payment method was preselected before --- .../js/view/payment/method-renderer/simplifycommerce-method.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js b/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js index 8975fa7..a824003 100644 --- a/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js @@ -133,8 +133,7 @@ define([ amount: this.totals().base_grand_total * 100, currency: this.totals().quote_currency_code, reference: quote.getQuoteId(), - operation: 'create.token', - selector: '[data-role=' + this.getCode() + '_pay]', + operation: 'create.token' } ).closeOnCompletion(); }.bind(this) From e13c426687b14b8e958b1d519f899f50e2c7b1fb Mon Sep 17 00:00:00 2001 From: Igor Goltsov Date: Wed, 23 Nov 2022 15:12:53 +0300 Subject: [PATCH 3/3] Version 3.3.0 --- CHANGELOG.md | 5 +++++ composer.json | 2 +- lib/SimplifyAdapter.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edfd242..c5fbccf 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## [3.3.0] - 2022-11-23 +### Changed +- Add compatibility with Magento 2.4.4 + + ## [3.2.0] - 2022-03-11 ### Changed - Installation instructions in the README.md file were updated diff --git a/composer.json b/composer.json index cfa5f09..97b83b2 100755 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mastercard/module-simplifycommerce", - "version": "3.2.0", + "version": "3.3.0", "description": "Mastercard Payment Gateway Services - Simplify", "license": "Apache-2.0", "authors": [ diff --git a/lib/SimplifyAdapter.php b/lib/SimplifyAdapter.php index 34098a2..463a6c4 100644 --- a/lib/SimplifyAdapter.php +++ b/lib/SimplifyAdapter.php @@ -41,7 +41,7 @@ public function __construct($publicKey, $privateKey) Simplify::$publicKey = $publicKey; Simplify::$privateKey = $privateKey; - Simplify::$userAgent = 'Magento-3.2.0'; + Simplify::$userAgent = 'Magento-3.3.0'; } /**