#Paul-Afterpay
1 messages · Page 1 of 1 (latest)
Hi there, you can test payment in test mode as well! can you send me the payment intent ID so that I can take a look?
pi_3L2UK0HlbLnHMjsi0mBEBMRP_secret_4nBtCtkyVg4pLhC9VePtxUyfV
Thanks. Please remove the 3rd screenshot, it contains your private key.
I think that's just my public key
and it's the test public key but no worries removed
payload with key field omitted
The required param is shipping.address,which is different from the billing_details.address
You can use the example code from the integration guide https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment#web-create-payment-intent
hmm given it's stripe collecting the data, is there a way to tell stripe to use the supplied address for both?
don't want to make the user enter the data twice
99% of the time it's the same address
The shipping address and the billing address are two different things. If you are certain they are going to be the same, you can collect the address in your form and hide (https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address i.e., set billingDetails.address to never) the billing_detail.address in paymentElement. Remember to set the billing_details.address programmatically when confirming (https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details) the Paymentintent.
is there a way to tell when they've selected the afterpay tab to modify the inputs we show?
it seems a bit odd that the shipping inputs aren't just part of the stripe inputs, so billing/shipping being the same can be handled easier
You can set the field visibility via the options.fields params (https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address). This configuration applies to all payment methods in the paymentelement, not just afterpay.
ok i appreciate the help, we can figure it out from here!