Project prerequisites for implementing Stripe checkout as a hosted payment page
Edit on GitHubIf your shop is live or @CheckoutPage/views/payment/payment.twig
is overwritten on the project level, follow the steps to prepare your project to implement Stripe checkout as a hosted payment page:
- Make sure that a form molecule uses the following code for the payment selection choices:
{% for name, choices in data.form.paymentSelection.vars.choices %}
...
{% embed molecule('form') with {
data: {
form: data.form[data.form.paymentSelection[key].vars.name],
...
}
{% embed molecule('form') with {
data: {
form: data.form[data.form.paymentSelection[key].vars.name],
...
}
{% endembed %}
{% endfor %}
-
If you want to change the default payment provider or method names, do the following:
- Make sure the names are translated in your payment step template:
{% for name, choices in data.form.paymentSelection.vars.choices %} ... <h5>{{ name | trans }}</h5> {% endfor %}
- Add translations to your glossary data import file:
Stripe,Pay Online with Stripe,en_US
- Run the data import command for the glossary:
console data:import glossary
Thank you!
For submitting the form