#benk6763
1 messages · Page 1 of 1 (latest)
Hi there, is it about save a payment method for future payments?
pretty much yes, so to not charge the cardholder's account but able to use the "token" for future payments
ok thanks
unfortunately we don't use the Checkout model and neither we use Elements
we have our own hosted pay page and are currently integrating with ApplePay
a colleague of yours did let us know about the undocumented API /v1/tokens which we use to convert the ApplePay token into a Stripe token
that works well with "payments" when we use the Stripe token to create a Charge
but wondering if for authorisations (not charging the cardholder's account) we need to do anything else other than just storing the Stripe token
Use this guide then https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements
that guide also refers to Payment Element which we don't use. With payments using the Stripe token I was advised to use this API:
ChargeCreateParams params = ChargeCreateParams.builder()
.setAmount(getAmountZD(cardtx))
.setCurrency(cardtx.getCurrency()) .setDescription(cardtx.getTransactionRef())
.setSource(stripeTokenId)
.build();
Charge charge = Charge.create(params, requestOptions);
the main thing here is the "stripeTokenId" which is derived from the ApplePay token
so we don't have the card details, no PaymentMethod or Customer to be created
Why do you mean by an 'authorisation'?
sometimes it's called pre-authorisation or simply authorisation, when the card is being checked (3DS, security, funds available) but not charged, eg: money is NOT moved
it's still being used as the setup for future payments, when the funds are "collected" or "charged" without the need to re-enter the card details at a later date
In that case yes you'd use a Setup Intent with the Stripe token from Apple Pay
I'm using the Stripe Java library and the SetupIntentCreateParams doesn't seem to have a .setSource() method similar to the ChargeCreateParams where you can pass in the Stripe token
You can use payment_method: https://stripe.com/docs/api/setup_intents/create#create_setup_intent-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ah ok, so the Stripe token Id can be passed into the SetupIntent.payment_method based on this description:
"ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent."
Source object is what I think will be the Stripe token Id similarly with the Charge API:
ChargeCreateParams.builder()
.setSource(stripeTokenId)
.build();
Yes, maybe. I'm not entirely sure if that will work but try and we can go from there
cool thanks!
to come back to this, the way you use the token is you convert it to a PaymentMethod and then pass that PaymentMethod ID to the SetupIntent