#rubens-nobre_code
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212489683993362452
📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
Hello
Hi
If you are using Card Element here then you control the UI that displays the amount and you control the currency you set when you create your PaymentIntent: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-currency
So really this is all possible, yes, and you just have to write your own logic for it.
ok. but the API, can retrieve the current Currency conversion?
Or I'll have to setup a price for each currency?
Cus for now, I just have two prices for my product.
If my customer are in Brazil I show price in BRL.
if not I show the price in USD.
No you would have to handle the currency conversion yourself. We don't have an API that provides that information.
But some other countries are facing errors, most of them related to debit cards.
I think that If a price is in USD, but the 'debit' card is from a user from 'Colombia' (for example), USD is not a valid currency in that country.
So It will alwasy fail... am I right?
cus is DEBIT
No, generally the issuing bank would convert the presentment amount to their local currency in that case and the customer would pay a conversion fee.
But really that is up to the bank.
We can't say for sure.
All my debit cards, is failing payments.. So I did a code do avoid and deny debit cards on my side.
pi_3OlHLEChHlHBFg3w0SultdpR
Yeah that is just a generic do_not_honor decline from the issuing bank. So the only way to know 100% why it was declined is for the card holder to reach out to the issuing bank and ask them.
We don't have any more information than that.
So. this is a kind of regular error. So I think that is not good for me, enable debit cards, cus users will start their free trial period and them I'll have the payment blocked.
If you collect cards ahead of time are you using a SetupIntent to properly set them up for future use?
Yes...
even if.
Cus most of banks till now... is not accepting a debit card for a susbcription
Okay then you are already doing everything you should. If you want to block debit cards that is your prerogative.
Do you know if other users can use debit cards for a Subscription model?
selling globally I mean.
Sure, though I do believe debit cards have a higher decline rate overall than credit cards.
Unfortunately I can't help you any further here. If you want to discuss declines you should reach out to our Support team via https://support.stripe.com/contact/login and chat with them. I've already confirmed your integration is set up correctly.
Did you check my integration, and SetupIntent is correctly being created??
Yes
Ah actually you are attaching the PaymentMethod ahead of the SetupIntent from the Subscription
But then it runs on your Subscription creation, see: https://dashboard.stripe.com/events/evt_1Oij38ChHlHBFg3wduw6ihYq
So same thing really. The flow still validates the card.
I do a first call to check the kind of card. if is Credit or Not
`const { paymentMethod, error: paymentMethodError } = await stripe.createPaymentMethod({
type: 'card',
card: cardElement,
billing_details: {
name: name,
email: email,
},
});
if (paymentMethodError) {
console.log('Erro ao criar método de pagamento:', paymentMethodError);
error_log(
JSON.stringify(paymentMethodError),
'_createCardToPay paymentMethodError',
JSON.stringify({
user_email: email,
customerId: customerId,
})
);
return null;
}
// Verifica se o tipo de financiamento Ă© 'credit'
if (paymentMethod.card?.funding !== 'credit') {
console.error('Apenas cartões de crédito são aceitos.');
return "debito";
}`
I only approve payments if funding is CREDIT.
But I'm not sure, if ALL kinds of credit cards returns 'credit'
No, debit cards would have funding: debit
Sure... but I'm declining, all that !== 'credit'
is this correct?
or it's better to do a if === 'debit' ???
You got my point? There are how many responses for card.funding?
I've found.
funding
string
Card funding type. Can be credit, debit, prepaid, or unknown.
Oh you are asking if there are multiple. Yeah there are things like prepaid
Yep
So depends on what you want really
So Pre-paid is a kind of Debit or Credit card? you know?
Can a Card return 'unknow', and be a credit card?
cus my curret code is blocking all payments that do not return 'credit', mays this is not the best approach.
That kind of temporary credit card numbers, created from a lot of new digital banks...
Do you know if it returns 'credit' too?
prepaid is generally cards issued with a specific amount that aren't tied to a specific bank account (like a debit card).
I don't know what the temporary credit card number cards are typically labeled as -- I'd recommend reaching out to our Support team about that and they should be able to track down that information.
ok. but you think that a pre-paid card have the same behaviour of a debit-card?
If a bank deny a debit card, probably will deny a pre-paid too?
mm, ok.
I think I'll do a try with a === 'debit'.
allowing all others to be accepted... and check what happens when I get a pre-paid or unknow funding
👍
So, thanks... have a nice night!