#benk6763

1 messages · Page 1 of 1 (latest)

west mossBOT
grim dagger
#

Hi there, is it about save a payment method for future payments?

ashen current
#

pretty much yes, so to not charge the cardholder's account but able to use the "token" for future payments

grim dagger
ashen current
#

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

grim dagger
west mossBOT
ashen current
#

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

left pilot
#

Why do you mean by an 'authorisation'?

ashen current
#

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

left pilot
#

In that case yes you'd use a Setup Intent with the Stripe token from Apple Pay

ashen current
#

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

left pilot
ashen current
#

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();

left pilot
#

Yes, maybe. I'm not entirely sure if that will work but try and we can go from there

ashen current
#

cool thanks!

west mossBOT
pallid ether
#

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