Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card type should be called scheme #65

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/PaymentMethod/Filter/AdyenConfigured.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function isMethodAvailable($method, $configuredKeys): bool
private function collectMethodCodeWithoutPrefix($methodCode): string
{
if ($methodCode == CreditCard::METHOD_CC) {
return 'card';
return 'scheme';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As paymentMethodsExtraDetails value has been used on line 46 in the same file, this value should stay as card. Because paymentMethodsExtraDetails returns key card for scheme payments in the Adyen_Payment module here.

}

return substr(
Expand Down
4 changes: 2 additions & 2 deletions Test/Unit/Model/CreditCard/BrandsManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public function inputProviderBrandsManager(): array
'paymentMethodsResponse' => [
'paymentMethodsResponse' => [
'paymentMethods' => [
'card' => [
[
'type' => 'scheme',
'brands' => ['mc', 'visa'],
],
'somethings_irrelevant' => [
[
'type' => 'somethings_irrelevant',
'brands' => [],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function testExecute()
];

$paymentMethods = [
'card' => [],
'scheme' => [],
'googlepay' => [],
'bmcm' => []
];
Expand Down
4 changes: 2 additions & 2 deletions Test/Unit/Model/PaymentMethod/PaymentMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public function inputProviderPaymentMethods(): array
'paymentMethodsResponse' => [
'paymentMethodsResponse' => [
'paymentMethods' => [
'card' => [
[
'type' => 'scheme',
'brands' => ['mc', 'visa'],
],
'somethings_else' => [
[
'type' => 'something_else',
'brands' => [],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use Adyen\Hyva\Magewire\Payment\Method\CreditCard;
creditCardHandler.setCreditCardType(creditCardHandler.getCcCodeByAltCode(state.brand));
},
name: '<?= $escaper->escapeJs($magewire->getConfiguration()->getValue('adyenCc/title')) ?>',
type: "card",
type: "scheme",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is used for rendering Card Component and this type should be card. Please refer to configuration section v5.x.x or earlier on Card Component documentation.

code: methodCode
};

Expand Down