Skip to content

Commit a63f8be

Browse files
PLGMAG2V2-814: Add instructions field to payment methods (#738)
1 parent 19a5f7e commit a63f8be

18 files changed

+36
-6
lines changed

Model/Ui/Gateway/AfterpayConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function getConfig(): array
5353
'image' => $this->getImage(),
5454
'is_preselected' => $this->isPreselected(),
5555
'transaction_type' => $this->getTransactionType(),
56+
'instructions' => $this->getInstructions(),
5657
'payment_type' => $this->getPaymentType(),
5758
'afterpay_terms_url' => $this->getAfterpayTermsAndConditionUrl(),
5859
],

Model/Ui/Gateway/AmexConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function getConfig(): array
3636
'image' => $this->getImage(),
3737
'vaultCode' => self::VAULT_CODE,
3838
'is_preselected' => $this->isPreselected(),
39+
'instructions' => $this->getInstructions(),
3940
]
4041
]
4142
];

Model/Ui/Gateway/BnplinstmConfigProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function getConfig(): array
3434
$this->getCode() => [
3535
'image' => $this->getImage(),
3636
'is_preselected' => $this->isPreselected(),
37-
'payment_type' => $this->getPaymentType()
37+
'payment_type' => $this->getPaymentType(),
38+
'instructions' => $this->getInstructions()
3839
]
3940
]
4041
];

Model/Ui/Gateway/BnplmfConfigProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function getConfig(): array
3434
$this->getCode() => [
3535
'image' => $this->getImage(),
3636
'is_preselected' => $this->isPreselected(),
37-
'payment_type' => $this->getPaymentType()
37+
'payment_type' => $this->getPaymentType(),
38+
'instructions' => $this->getInstructions()
3839
]
3940
]
4041
];

Model/Ui/Gateway/CreditCardConfigProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public function getConfig(): array
3737
'image' => $this->getImage(),
3838
'vaultCode' => self::VAULT_CODE,
3939
'is_preselected' => $this->isPreselected(),
40-
'payment_type' => $this->getPaymentType()
40+
'payment_type' => $this->getPaymentType(),
41+
'instructions' => $this->getInstructions()
4142
]
4243
]
4344
];

Model/Ui/Gateway/DirectDebitConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getConfig(): array
3737
'vaultCode' => self::VAULT_CODE,
3838
'is_preselected' => $this->isPreselected(),
3939
'transaction_type' => $this->getTransactionType(),
40+
'instructions' => $this->getInstructions()
4041
],
4142
],
4243
];

Model/Ui/Gateway/EinvoicingConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function getConfig(): array
3535
'image' => $this->getImage(),
3636
'is_preselected' => $this->isPreselected(),
3737
'transaction_type' => $this->getTransactionType(),
38+
'instructions' => $this->getInstructions(),
3839
'payment_type' => $this->getPaymentType(),
3940
'checkout_fields' => $this->checkoutFieldsUtil->getCheckoutFields(
4041
self::CODE,

Model/Ui/Gateway/GenericGatewayConfigProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public function getConfig(): array
111111
foreach ($this->getGenericList() as $gatewayCode) {
112112
$configData[$gatewayCode] = [
113113
'image' => $this->getGenericFullImagePath($gatewayCode),
114-
'is_preselected' => $this->isPreselectedByCode($gatewayCode)
114+
'is_preselected' => $this->isPreselectedByCode($gatewayCode),
115+
'instructions' => $this->getInstructions()
115116
];
116117
}
117118

Model/Ui/Gateway/IdealConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function getConfig(): array
3838
'image' => $this->getImage(),
3939
'vaultCode' => self::VAULT_CODE,
4040
'is_preselected' => $this->isPreselected(),
41+
'instructions' => $this->getInstructions()
4142
],
4243
],
4344
];

Model/Ui/Gateway/In3B2bConfigProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function getConfig(): array
3434
$this->getCode() => [
3535
'image' => $this->getImage(),
3636
'is_preselected' => $this->isPreselected(),
37-
'payment_type' => $this->getPaymentType()
37+
'payment_type' => $this->getPaymentType(),
38+
'instructions' => $this->getInstructions()
3839
]
3940
]
4041
];

Model/Ui/Gateway/In3ConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function getConfig(): array
3535
'image' => $this->getImage(),
3636
'is_preselected' => $this->isPreselected(),
3737
'transaction_type' => $this->getTransactionType(),
38+
'instructions' => $this->getInstructions(),
3839
'payment_type' => $this->getPaymentType()
3940
]
4041
]

Model/Ui/Gateway/MaestroConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function getConfig(): array
3636
'image' => $this->getImage(),
3737
'vaultCode' => self::VAULT_CODE,
3838
'is_preselected' => $this->isPreselected(),
39+
'instructions' => $this->getInstructions()
3940
]
4041
]
4142
];

Model/Ui/Gateway/MastercardConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function getConfig(): array
3636
'image' => $this->getImage(),
3737
'vaultCode' => self::VAULT_CODE,
3838
'is_preselected' => $this->isPreselected(),
39+
'instructions' => $this->getInstructions()
3940
]
4041
]
4142
];

Model/Ui/Gateway/MyBankConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getConfig(): array
3737
'issuers' => $this->getIssuers(),
3838
'image' => $this->getImage(),
3939
'is_preselected' => $this->isPreselected(),
40+
'instructions' => $this->getInstructions()
4041
],
4142
],
4243
];

Model/Ui/Gateway/VisaConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function getConfig(): array
3636
'image' => $this->getImage(),
3737
'vaultCode' => self::VAULT_CODE,
3838
'is_preselected' => $this->isPreselected(),
39+
'instructions' => $this->getInstructions()
3940
]
4041
]
4142
];

Model/Ui/Gateway/ZiniaConfigProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public function getConfig(): array
3434
$this->getCode() => [
3535
'image' => $this->getImage(),
3636
'is_preselected' => $this->isPreselected(),
37-
'payment_type' => $this->getPaymentType()
37+
'payment_type' => $this->getPaymentType(),
38+
'instructions' => $this->getInstructions()
3839
]
3940
]
4041
];

Model/Ui/GenericConfigProvider.php

+13
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public function getConfig(): array
151151
'image' => $this->getImage(),
152152
'is_preselected' => $this->isPreselected(),
153153
'transaction_type' => $this->getTransactionType(),
154+
'instructions' => $this->getInstructions(),
154155
],
155156
],
156157
];
@@ -427,4 +428,16 @@ protected function getStoreIdFromCheckoutSession(): ?int
427428

428429
return $storeId;
429430
}
431+
432+
/**
433+
* Get the payment instructions
434+
*
435+
* @return string
436+
*/
437+
protected function getInstructions(): string
438+
{
439+
$this->paymentConfig->setMethodCode($this->getCode());
440+
441+
return (string)$this->paymentConfig->getValue('instructions', $this->getStoreIdFromCheckoutSession());
442+
}
430443
}

Model/Ui/Giftcard/EdenredGiftcardConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function getConfig(): array
4545
'image' => $this->getImage(),
4646
'is_preselected' => $this->isPreselected(),
4747
'transaction_type' => $this->getTransactionType(),
48+
'instructions' => $this->getInstructions(),
4849
'coupons' => $this->getAvailableCouponsByQuote($this->checkoutSession->getQuote()),
4950
],
5051
],

0 commit comments

Comments
 (0)