#rubens-nobre_code

1 messages · Page 1 of 1 (latest)

gloomy arrowBOT
#

đź‘‹ 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!

tawdry wolfBOT
delicate lance
#

Hello

civic fractal
#

Hi

delicate lance
#

So really this is all possible, yes, and you just have to write your own logic for it.

civic fractal
#

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.

delicate lance
#

No you would have to handle the currency conversion yourself. We don't have an API that provides that information.

civic fractal
#

But some other countries are facing errors, most of them related to debit cards.

delicate lance
#

Would need more details to be able to help with that.

#

What errors exactly?

civic fractal
#

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

delicate lance
#

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.

civic fractal
#

All my debit cards, is failing payments.. So I did a code do avoid and deny debit cards on my side.

delicate lance
#

What does "failing" mean though?

#

Do you see a specific decline?

civic fractal
#

pi_3OlHLEChHlHBFg3w0SultdpR

delicate lance
#

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.

civic fractal
#

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.

delicate lance
#

If you collect cards ahead of time are you using a SetupIntent to properly set them up for future use?

civic fractal
#

Yes...

#

even if.

#

Cus most of banks till now... is not accepting a debit card for a susbcription

delicate lance
#

Okay then you are already doing everything you should. If you want to block debit cards that is your prerogative.

civic fractal
#

Do you know if other users can use debit cards for a Subscription model?

#

selling globally I mean.

delicate lance
#

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.

civic fractal
#

Did you check my integration, and SetupIntent is correctly being created??

delicate lance
#

Yes

#

Ah actually you are attaching the PaymentMethod ahead of the SetupIntent from the Subscription

#

So same thing really. The flow still validates the card.

civic fractal
#

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";
}`

delicate lance
#

Yeah that's fine.

#

That works in terms of blocking debit cards

civic fractal
#

I only approve payments if funding is CREDIT.
But I'm not sure, if ALL kinds of credit cards returns 'credit'

delicate lance
#

No, debit cards would have funding: debit

civic fractal
#

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.

delicate lance
#

Oh you are asking if there are multiple. Yeah there are things like prepaid

#

Yep

#

So depends on what you want really

civic fractal
#

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?

delicate lance
#

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.

civic fractal
#

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?

delicate lance
#

Can't say.

#

Completely up to the bank.

civic fractal
#

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

delicate lance
#

👍

civic fractal
#

So, thanks... have a nice night!