Skip to content

Commit

Permalink
Merge pull request #255 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 9.0.0
  • Loading branch information
peterojo authored Jan 26, 2021
2 parents e733a08 + efdde04 commit 8698184
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @msilvagarcia @cyattilakiss @AlexandrosMor @acampos1916 @peterojo @Aleffio @rikterbeek
* @msilvagarcia @cyattilakiss @AlexandrosMor @acampos1916 @peterojo @Aleffio @rikterbeek @morerice
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Checkout
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require-dev": {
"dms/phpunit-arraysubset-asserts": "0.2.1",
"friendsofphp/php-cs-fixer": "*",
"phpunit/phpunit": "9.5.0",
"phpunit/phpunit": "9.5.1",
"php-coveralls/php-coveralls": "2.4.2",
"squizlabs/php_codesniffer": "3.5.8"
},
Expand Down
66 changes: 33 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Adyen/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Client
{
const LIB_VERSION = "8.1.0";
const LIB_VERSION = "9.0.0";
const LIB_NAME = "adyen-php-api-library";
const USER_AGENT_SUFFIX = "adyen-php-api-library/";
const ENDPOINT_TEST = "https://pal-test.adyen.com";
Expand All @@ -22,7 +22,7 @@ class Client
const API_BIN_LOOKUP_VERSION = "v50";
const API_PAYOUT_VERSION = "v51";
const API_RECURRING_VERSION = "v49";
const API_CHECKOUT_VERSION = "v64";
const API_CHECKOUT_VERSION = "v66";
const API_CHECKOUT_UTILITY_VERSION = "v1";
const API_NOTIFICATION_VERSION = "v5";
const API_ACCOUNT_VERSION = "v5";
Expand Down
8 changes: 4 additions & 4 deletions src/Adyen/Service/NotificationReceiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ public function isAuthenticated($response, $merchantAccount, $notificationUserna
/**
* Checks if notification mode and the store mode configuration matches
*
* @param $notificationMode
* @param $testMode bool
* @param mixed $notificationMode
* @param bool $testMode
* @return bool
*/
public function validateNotificationMode($notificationMode, $testMode)
{
// Notification mode can be a string or a boolean
if (($testMode && ($notificationMode == 'false' || !$notificationMode)) ||
(!$testMode && ($notificationMode == 'true' || $notificationMode))
if (($testMode && ($notificationMode === 'false' || $notificationMode === false)) ||
(!$testMode && ($notificationMode === 'true' || $notificationMode === true))
) {
return true;
}
Expand Down
72 changes: 67 additions & 5 deletions src/Adyen/Util/OpenInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,42 @@ class OpenInvoice
const AFTERPAY_B2B_PAYMENT_METHOD = 'afterpay_b2b';
const AFTERPAY_DEFAULT_PAYMENT_METHOD = 'afterpay_default';
const AFTERPAY_DIRECTDEBIT_PAYMENT_METHOD = 'afterpay_directdebit';
const AFTERPAYTOUCH_PAYMENT_METHOD = 'afterpaytouch';

const RATEPAY_PAYMENT_METHOD = 'ratepay';
const AFTERPAYTOUCH = "afterpaytouch";
const AFTERPAYTOUCH_AU = "afterpaytouch_AU";
const AFTERPAYTOUCH_CA = "afterpaytouch_CA";
const AFTERPAYTOUCH_NZ = "afterpaytouch_NZ";
const AFTERPAYTOUCH_US = "afterpaytouch_US";

const RATEPAY = 'ratepay';
const RATEPAY_DIRECTDEBIT_PAYMENT_METHOD = 'ratepay_directdebit';

const KLARNA_PAYMENT_METHOD = 'klarna';
const KLARNA_B2B_PAYMENT_METHOD = 'klarna_b2b';
const KLARNA_PAYNOW_PAYMENT_METHOD = 'klarna_paynow';
const KLARNA_ACCOUNT_PAYMENT_METHOD = 'klarna_account';

const FACILYPAY = 'facilypay';
const FACILYPAY_10X = 'facilypay_10x';
const FACILYPAY_10X_MERCHANT_PAYS = 'facilypay_10x_merchant_pays';
const FACILYPAY_10X_WITHFEES = 'facilypay_10x_withfees';
const FACILYPAY_12X = 'facilypay_12x';
const FACILYPAY_12X_MERCHANT_PAYS = 'facilypay_12x_merchant_pays';
const FACILYPAY_12X_WITHFEES = 'facilypay_12x_withfees';
const FACILYPAY_3X = 'facilypay_3x';
const FACILYPAY_3X_MERCHANT_PAYS = 'facilypay_3x_merchant_pays';
const FACILYPAY_3X_WITHFEES = 'facilypay_3x_withfees';
const FACILYPAY_4X = 'facilypay_4x';
const FACILYPAY_4X_MERCHANT_PAYS = 'facilypay_4x_merchant_pays';
const FACILYPAY_4X_WITHFEES = 'facilypay_4x_withfees';
const FACILYPAY_6X = 'facilypay_6x';
const FACILYPAY_6X_MERCHANT_PAYS = 'facilypay_6x_merchant_pays';
const FACILYPAY_6X_WITHFEES = 'facilypay_6x_withfees';
const FACILYPAY_FR = 'facilypay_fr';

const AFFIRM = 'affirm';
const CLEARPAY = 'clearpay';

/**
* List of open invoice payment methods
*
Expand All @@ -49,13 +75,49 @@ class OpenInvoice
self::AFTERPAY_B2B_PAYMENT_METHOD,
self::AFTERPAY_DEFAULT_PAYMENT_METHOD,
self::AFTERPAY_DIRECTDEBIT_PAYMENT_METHOD,
self::AFTERPAYTOUCH_PAYMENT_METHOD,
self::RATEPAY_PAYMENT_METHOD,
self::AFTERPAYTOUCH,
self::AFTERPAYTOUCH_AU,
self::AFTERPAYTOUCH_CA,
self::AFTERPAYTOUCH_NZ,
self::AFTERPAYTOUCH_US,
self::RATEPAY,
self::RATEPAY_DIRECTDEBIT_PAYMENT_METHOD,
self::KLARNA_PAYMENT_METHOD,
self::KLARNA_B2B_PAYMENT_METHOD,
self::KLARNA_PAYNOW_PAYMENT_METHOD,
self::KLARNA_ACCOUNT_PAYMENT_METHOD,
self::AFFIRM,
self::CLEARPAY,
self::FACILYPAY,
self::FACILYPAY_10X,
self::FACILYPAY_10X_MERCHANT_PAYS,
self::FACILYPAY_10X_WITHFEES,
self::FACILYPAY_12X,
self::FACILYPAY_12X_MERCHANT_PAYS,
self::FACILYPAY_12X_WITHFEES,
self::FACILYPAY_3X,
self::FACILYPAY_3X_MERCHANT_PAYS,
self::FACILYPAY_3X_WITHFEES,
self::FACILYPAY_4X,
self::FACILYPAY_4X_MERCHANT_PAYS,
self::FACILYPAY_4X_WITHFEES,
self::FACILYPAY_6X,
self::FACILYPAY_6X_MERCHANT_PAYS,
self::FACILYPAY_6X_WITHFEES,
self::FACILYPAY_FR,
);

/**
* List of after pay touch payment methods
*
* @var array
*/
private static $afterPayTouchPaymentMethods = array(
self::AFTERPAYTOUCH,
self::AFTERPAYTOUCH_AU,
self::AFTERPAYTOUCH_CA,
self::AFTERPAYTOUCH_NZ,
self::AFTERPAYTOUCH_US,
);

/**
Expand Down Expand Up @@ -95,7 +157,7 @@ public function isOpenInvoicePaymentMethod($paymentMethod)
*/
public function isAfterPayTouchPaymentMethod($paymentMethod)
{
if (self::AFTERPAYTOUCH_PAYMENT_METHOD === $paymentMethod) {
if (in_array($paymentMethod, self::$afterPayTouchPaymentMethods)) {
return true;
}
return false;
Expand Down
Loading

0 comments on commit 8698184

Please sign in to comment.