#lushiv

1 messages · Page 1 of 1 (latest)

waxen iglooBOT
gaunt cedar
#

Sure, looks like you're tok_xxx (via card.cardToken) has already been used

#

They're only redeemable once

waxen iglooBOT
gaunt cedar
#

Generally you shouldn't be using Tokens directly, and instead be collecting and confirming payments using the Payment Element

clear python
#

so what is the exact soultion for me

sly nova
clear python
#

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

sly nova
#

there shouldn't be any difference between different cards that way

clear python
#

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

sly nova
#

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

sly nova
clear python
#

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

sly nova
#

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

clear python
#

yah token is using when card was adding

#

because in our app user first add card from another API

sly nova
clear python
#

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.

sly nova
clear python
#

okay let me check with this

#

please hold on conversation

#

i will implement this and test

clear python
#

@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

sly nova
#

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.

clear python
#

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

sly nova
#

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

clear python
#

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.

sly nova
#

then pass the off_session argument

clear python
#

okay let me check

waxen iglooBOT
clear python
#

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

agile bison
#

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?

clear python
#

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

agile bison
#

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.

clear python
#

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.

wind vessel
#

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