-
Hi, does anyone know how to pass the postcode (from the order data) to the Stripe Element that is created? Or do you pass it in the closure in the Stripe gateway config? I used to pass it in (in old non Statamic code) via javascript var card = elements.create('card', {style: style, hidePostalCode: true, value: {postalCode: $postalCode}}); But I am usure as to how to set the $postalCode variable to the current order's shipping or billing post code - do I use some {{sc:order:postal_code}} type antlers syntax? Thanks! Jamie |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Answering my own question in case it helps anyone else! var $postalCode = '{{ billing_postal_code ? billing_postal_code : shipping_postal_code }}';
//const card = elements.create('card');
const card = elements.create('card', {hidePostalCode: true, value: {postalCode: $postalCode}}); |
Beta Was this translation helpful? Give feedback.
Answering my own question in case it helps anyone else!