Skip to content

Commit

Permalink
Pass payment order through to checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbmarshall committed Nov 16, 2023
1 parent feca63c commit 1fdcb18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ $payment->setDetails([
'email' => $email, // Used for the customer to be able to save payment details
],
'limit_payment_type' => 'card', // Optionally limit to card transactions only, to disable Afterpay / Klarna / Zip etc.
'payment_method_order' => ['apple_pay', 'google_pay', 'card'], // Optionally re-order the wallets to be before card if they apply to the transaction
]);
$storage->setInternalDetails($payment, $request);

Expand Down
1 change: 1 addition & 0 deletions src/Action/ObtainNonceAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function execute($request) {
'publishable_key' => $model['publishable_key'],
'actionUrl' => $uri->withPath('')->withFragment('')->withQuery('')->__toString() . $getHttpRequest->uri,
'imgUrl' => $model['img_url'],
'payment_method_order' => json_encode($model['payment_method_order'] ?? []),
'billing' => $model['billing'] ?? [],
)));

Expand Down
1 change: 1 addition & 0 deletions src/Resources/views/Action/obtain_nonce.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
const paymentElementOptions = {
layout: "tabs",
paymentMethodOrder: {{ payment_method_order|raw }},
};
const paymentElement = elements.create("payment", paymentElementOptions);
Expand Down

0 comments on commit 1fdcb18

Please sign in to comment.