#BC
1 messages ยท Page 1 of 1 (latest)
Hi ๐
How are you getting these tokenized Apple Pay payment methods into Stripe?
We do it via the paymentRequest js API
We check for paymentRequest.canMakePayment() before showing the button. Then we listen for the paymentRequest.on('token') event to get the token and add it to the customer's stripe sources.
And that works when you charge the Customer?
Yes. We can charge the customer fine from our own account. But when we use that same card_*** id when making a charge for a connected account, we get a generic declined with do_not_honor error. If the customer deletes the card and re-adds it by typing in the number instead of adding it with Apple Pay, then payments work fine for both our account and through connected accounts.
๐ stepping in as Snufkin needs to step away
๐
Can you provide an example PaymentIntent for both scenarios?
The one that was successful and the one that was declined
Using the same PaymentMethod
We use the useStripe hook in react-stripe-js
This snippet creates the payment request (some vars simplified to exclude our details):
React.useEffect(() => {
if (stripe) {
const pr = stripe.paymentRequest({
country: presenter.data_country,
currency: presenter.data_currency,
total: {
label: "Our Label",
amount: first_charge_amount,
},
requestPayerName: true,
requestPayerEmail: true,
requestPayerPhone: true,
});
pr.canMakePayment().then((result) => {
if (result) {
setPaymentRequest(pr);
}
});
}
}, [stripe]);
Then we tie into the on("token") event:
paymentRequest?.on("token", function (event) {
// Code here passes event.token.id to our server where we then use it to add the stripe source to the stripe customer.
}
For manual entry we use Stripe's CardElement from react-stripe-js like so:
stripe.createToken(cardElement).then(function (result) {
// Code here passes result.token.id to our server where we then use it to add the stripe source to the stripe customer.
});
The backend code that takes the token and add it to the customer is the same both ways.
I'm looking for example PaymentIntents where you used the same card but got different results.
It could very well just be the bank being weird
But I'll take a look if you can provide me with specific examples
Ah. As in the specific ids for you to look up in stripe?
Got it. Yeah, let me dig those up.
Perfect
Hmm. Looks like we're using v1/charges (ch_XXX).
That's fine
This is successful (card added via card element):
ch_3LwcbLJ8iyHFlUfn1im8vQ6C
This one is the same card, but added via Apple Pay and got declined:
ch_3LwcUKJ8iyHFlUfn0OSQSWB3
Yes
Further examples would be helpful if you have them to help determine this isn't just a bank being weird.
Like 3 or 4 examples if you have them would be great
I'm looking at this one currrently
I have several examples of the declines. Fewer of the same card being added directly and solving. This one we were able to troubleshoot in real time and prove it works fine when removing + re-adding the same card by typing in the numbers.
Hmm have any of the customers talked to the issuer at all about this?
Yeah. Their banks said all is fine and to call apple.... which... not helpful. But I have noticed this pattern clearly very often where the stripe source added w/ apple pay works fine for charges on our main account, but fails with a connected account... so it must be something with stripe connect
And do you know of any trends here? Are all or most of the declines you are seeing for Amex?
Good question. Let me have someone gather a bunch of these examples and look for more bank specific patterns.
Okay yeah I'm not seeing anything jump out here that I can tell. This will likely need a deeper investigation. My recommendation would be to compile a variety of examples and then contact our Support team (https://support.stripe.com/contact/login) with full details on what you are seeing and all of the examples you have. Then we can dig a lot deeper from our side to see if anything is going on and loop in the necessary experts internally to take a look.