#lushiv
1 messages · Page 1 of 1 (latest)
Sure, looks like you're tok_xxx (via card.cardToken) has already been used
They're only redeemable once
Generally you shouldn't be using Tokens directly, and instead be collecting and confirming payments using the Payment Element
so what is the exact soultion for me
the main solution would be to follow one of our official guides from https://stripe.com/docs/payments/accept-a-payment , what you're building above looks like a legacy integration
Hello @sly nova i have follow your docs and its working properly with another card , its only not work for Thai( thailand) debit card
can you try with your system ?
i have already attached that card details you can check my main message
end with 0008 thai debit card was not working for me
another card was working fine on my system
there shouldn't be any difference between different cards that way
so why i got this isssue?
invalid_request_error
This endpoint cannot be used to make this payment
if i use charge i got this issue
and if i use paymentIntents i got another issue
only for that Thai debit card
the Charges API is deprecated and you'd never use it anymore in 2023, that's why you get an error when trying to use it
the error you mention is a type of integration error that would not be related to the specific card being used, so I don't think that's possible
so i need to replace charge with paymentIntents ?
okay if issue with my code so could you help me to understand what is the exact issue on my code
const charge = await stripe.paymentIntents.create({ amount: campaign.campaignTemplate.chargeByRestaurant ? req.currentVisits * campaign.campaignTemplate.chargeByRestaurant * 100 : 0, currency: "thb", customer: card.customerStripeId, payment_method_types: ["card"], payment_method_data: { type: "card", card: { token: card.cardToken } } }); console.log('paymentIntent ID', charge.id); const paymentIntent = await stripe.paymentIntents.confirm(charge.id);
that code in itself is ok(but you should not be using tokens at all)
you get the error because the token was used somewhere else before that code
yah token is using when card was adding
because in our app user first add card from another API
because you attached the token to a customer here : https://dashboard.stripe.com/test/logs/req_0QIqcW6jPKrUD5 and that consumes the token, you can't use the token again
And we have a cron job that checks the user's card details and pays pending payments at a specific time. Therefore, adding a card and making a payment work differently.
to charge the saved card you list the PaymentMethods on the customer and pass the saved card that has been added(https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method), you would never reference the token itself again
okay let me check with this
please hold on conversation
i will implement this and test
@sly nova now i have got another issue
Invalid token id: pm_1NH1pBFQRAZsiHX7EwCVvo2u
request id -= req_4B70KLJ6QmMDEk
now i have not used token when customer adding there card
i have follow that docs
you haven't, because no part of the docs would involve using payment_method_data[card][token]
in any case, if you have a PaymentMethod pm_xxx now, when creating the PaymentIntent, you would pass payment_method:"pm_xxxxx" instead of the payment_method_data:{} object.
thanks man error was solved but i got one more issue the transaction is on incomplete status
3D Secure attempt incomplete ?
i want skip this part i want to pay direct
you can't skip it, the customer's bank requires 3D Secure to complete the payment
if you follow our guides as written and confirm the PaymentIntent on the client side using stripe.js and Elements, 3D Secure is presented to the customer in their browser to complete it
To @sly nova But our requirement is as follows: Users can add their card details at any time. However, our system has a cron job that checks the users' card details one by one. If a user has a pending balance, our system automatically pays off the balance at 12 PM Thai time. During this time, there is no UI or authentication system as the cron job runs in the background.
then pass the off_session argument
did you read https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method which describes how to process just that kind of off-session backend payment?
you can test this flow using the 3155 test card from https://stripe.com/docs/testing#authentication-and-setup which supports skipping 3D Secure on backend payments once it's been authenticated once
okay let me check
Thank you @sly nova now everything is working fine with test card , now i will testing with real card
@sly nova Yes i got the issue with adding real card
reqeust id = req_4Sw2J7kD1HcFJQ
Hi! I'm taking over this thread.
What's your question exactly? Do you want to know why the card was declined?
Also are you doing tests in live mode?
Yes, because that card is working fine with other online platforms. However, when I try to add that card to our system, it gives me a declined error.
I have tested on test mode and its working fine
issue with live mode with live card
FYI you shouldn't do this, as mentioned here https://stripe.com/docs/testing
Do not use real card details. Testing in live mode using real payment method details is prohibited by the Stripe Services Agreement, which permits business use only. Use your test API keys and the card numbers below.
But give me a few minutes to check your request.
i know @agile bison But our main issue is that the card is not being added to our system, which is why I am here.
The card owner claims that the card is accepted on other platforms, but it is not functioning on our system. This has left me confused because our system works fine with test cards, yet the Thai debit card is not working.
Hey! Taking over for my colleague. Let me catch up.
The card owner claims that the card is accepted on other platforms, but it is not functioning on our system
I'm not sure if what the card owner claims is true or not... but what we can say so far, is that this card is declined
if you want to get more insights about this decline and others, you need to reach out to Stripe Support at
https://support.stripe.com/contact/email?topic=declines