Skip to content

Commit 1fdcb18

Browse files
committed
Pass payment order through to checkout
1 parent feca63c commit 1fdcb18

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ $payment->setDetails([
5656
'email' => $email, // Used for the customer to be able to save payment details
5757
],
5858
'limit_payment_type' => 'card', // Optionally limit to card transactions only, to disable Afterpay / Klarna / Zip etc.
59+
'payment_method_order' => ['apple_pay', 'google_pay', 'card'], // Optionally re-order the wallets to be before card if they apply to the transaction
5960
]);
6061
$storage->setInternalDetails($payment, $request);
6162

src/Action/ObtainNonceAction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function execute($request) {
7676
'publishable_key' => $model['publishable_key'],
7777
'actionUrl' => $uri->withPath('')->withFragment('')->withQuery('')->__toString() . $getHttpRequest->uri,
7878
'imgUrl' => $model['img_url'],
79+
'payment_method_order' => json_encode($model['payment_method_order'] ?? []),
7980
'billing' => $model['billing'] ?? [],
8081
)));
8182

src/Resources/views/Action/obtain_nonce.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
4949
const paymentElementOptions = {
5050
layout: "tabs",
51+
paymentMethodOrder: {{ payment_method_order|raw }},
5152
};
5253
5354
const paymentElement = elements.create("payment", paymentElementOptions);

0 commit comments

Comments
 (0)