Skip to content

Commit f944e30

Browse files
authored
Merge pull request #463 from OXID-eSales/PSPAYPAL-950_AdditionalElegibilityCheck
add additional elegibility-test
2 parents 5f48659 + 400bc30 commit f944e30

12 files changed

Lines changed: 899 additions & 246 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99
### NEW
1010

1111
- All PayPal payment methods have "PayPal" as a prefix in a fresh installation to better identify them in the admin panel. When setting up payment methods, the merchant can decide which name best fits their needs.
12+
- Additional check of eligibility for unbranded payments
1213
- Move PayPal-Config to Config-Section in Admin > Module-List > Module > Options
1314

1415
### FIX

metadata.php

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,42 @@
494494
'value' => false,
495495
'group' => null
496496
],
497+
[
498+
'name' => 'oscPayPalEpsEligibility',
499+
'type' => 'bool',
500+
'value' => false,
501+
'group' => null
502+
],
503+
[
504+
'name' => 'oscPayPalPrzelewy24Eligibility',
505+
'type' => 'bool',
506+
'value' => false,
507+
'group' => null
508+
],
509+
[
510+
'name' => 'oscPayPalSepaEligibility',
511+
'type' => 'bool',
512+
'value' => false,
513+
'group' => null
514+
],
515+
[
516+
'name' => 'oscPayPalBlikEligibility',
517+
'type' => 'bool',
518+
'value' => false,
519+
'group' => null
520+
],
521+
[
522+
'name' => 'oscPayPalBanContactEligibility',
523+
'type' => 'bool',
524+
'value' => false,
525+
'group' => null
526+
],
527+
[
528+
'name' => 'oscPayPalIDealEligibility',
529+
'type' => 'bool',
530+
'value' => false,
531+
'group' => null
532+
],
497533
[
498534
'name' => 'oscPayPalSandboxAcdcEligibility',
499535
'type' => 'bool',
@@ -524,6 +560,42 @@
524560
'value' => false,
525561
'group' => null
526562
],
563+
[
564+
'name' => 'oscPayPalSandboxEpsEligibility',
565+
'type' => 'bool',
566+
'value' => false,
567+
'group' => null
568+
],
569+
[
570+
'name' => 'oscPayPalSandboxPrzelewy24Eligibility',
571+
'type' => 'bool',
572+
'value' => false,
573+
'group' => null
574+
],
575+
[
576+
'name' => 'oscPayPalSandboxSepaEligibility',
577+
'type' => 'bool',
578+
'value' => false,
579+
'group' => null
580+
],
581+
[
582+
'name' => 'oscPayPalSandboxBlikEligibility',
583+
'type' => 'bool',
584+
'value' => false,
585+
'group' => null
586+
],
587+
[
588+
'name' => 'oscPayPalSandboxBanContactEligibility',
589+
'type' => 'bool',
590+
'value' => false,
591+
'group' => null
592+
],
593+
[
594+
'name' => 'oscPayPalSandboxIDealEligibility',
595+
'type' => 'bool',
596+
'value' => false,
597+
'group' => null
598+
],
527599
[
528600
'name' => 'oscPayPalSCAContingency',
529601
'type' => 'select',
@@ -570,7 +642,35 @@
570642
[
571643
'name' => 'oscPayPalUseStructuralCustomIdSchema',
572644
'type' => 'bool',
573-
'value' => false,
645+
'value' => true,
646+
'group' => null
647+
],
648+
[
649+
'name' => 'oscPayPalButtonStyleLayout',
650+
'type' => 'select',
651+
'constraints' => 'vertical|horizontal',
652+
'value' => 'vertical',
653+
'group' => null
654+
],
655+
[
656+
'name' => 'oscPayPalButtonStyleColor',
657+
'type' => 'select',
658+
'constraints' => 'gold|blue|silver|white|black',
659+
'value' => 'gold',
660+
'group' => null
661+
],
662+
[
663+
'name' => 'oscPayPalButtonStyleShape',
664+
'type' => 'select',
665+
'constraints' => 'rect|pill|sharp',
666+
'value' => 'rect',
667+
'group' => null
668+
],
669+
[
670+
'name' => 'oscPayPalButtonStyleLabel',
671+
'type' => 'select',
672+
'constraints' => 'paypal|checkout|buynow|pay|installment',
673+
'value' => 'paypal',
574674
'group' => null
575675
],
576676
],

src/Controller/PaymentController.php

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ public function getPaymentList()
161161
)
162162
)
163163
) {
164-
if ($key !== PayPalDefinitions::EXPRESS_PAYPAL_PAYMENT_ID || PayPalSession::isPayPalExpressOrderActive()) {
164+
if (
165+
$key !== PayPalDefinitions::EXPRESS_PAYPAL_PAYMENT_ID
166+
|| PayPalSession::isPayPalExpressOrderActive()
167+
) {
165168
$paymentList[$key] = $payment;
166169
}
167170
}
@@ -176,6 +179,34 @@ public function getPaymentList()
176179
if (!$this->getServiceFromContainer(ModuleSettings::class)->isPuiEligibility()) {
177180
unset($paymentList[PayPalDefinitions::PUI_PAYPAL_PAYMENT_ID]);
178181
}
182+
// check GooglePay Eligibility
183+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isGooglePayEligibility()) {
184+
unset($paymentList[PayPalDefinitions::GOOGLEPAY_PAYPAL_PAYMENT_ID]);
185+
}
186+
// check ApplePay Eligibility
187+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isApplePayEligibility()) {
188+
unset($paymentList[PayPalDefinitions::APPLEPAY_PAYPAL_PAYMENT_ID]);
189+
}
190+
// check Eps Eligibility
191+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isEpsEligibility()) {
192+
unset($paymentList[PayPalDefinitions::EPS_PAYPAL_PAYMENT_ID]);
193+
}
194+
// check Przelewy24 Eligibility
195+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isPrzelewy24Eligibility()) {
196+
unset($paymentList[PayPalDefinitions::PRZELEWY24_PAYPAL_PAYMENT_ID]);
197+
}
198+
// check Blik Eligibility
199+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isBlikEligibility()) {
200+
unset($paymentList[PayPalDefinitions::BLIK_PAYPAL_PAYMENT_ID]);
201+
}
202+
// check BanContact Eligibility
203+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isBanContactEligibility()) {
204+
unset($paymentList[PayPalDefinitions::BANCONTACT_PAYPAL_PAYMENT_ID]);
205+
}
206+
// check iDeal Eligibility
207+
if (!$this->getServiceFromContainer(ModuleSettings::class)->isIDealEligibility()) {
208+
unset($paymentList[PayPalDefinitions::IDEAL_PAYPAL_PAYMENT_ID]);
209+
}
179210

180211
return $paymentList;
181212
}

0 commit comments

Comments
 (0)