#dtfk - card tokens

1 messages ยท Page 1 of 1 (latest)

thin cipherBOT
turbid jacinth
hidden cloud
#

If there any multiuse token functionality available?

turbid jacinth
#

Yeah, we have the whole Payment Methods API and its functionality which does exactly that

hidden cloud
#

But do these generate card token?

turbid jacinth
#

No, they create Payment Methods which can be used in place of Card Tokens

hidden cloud
#

we want only token based

turbid jacinth
#

In that case you'll have to work with single-use Card Tokens as far as I can tell.

hidden cloud
#

and if there's any workaround to use multiple times

#

lets say if we have token and it failed becayse the card has insufficient amount then we can tell the customer and he can fix his card

turbid jacinth
hidden cloud
#

so u mean we are charging by sending the customer id which already has token attached to it?

turbid jacinth
#

I'm not sure if you are or not. I'm just mentioning that it's an option for recurring charges. That won't really help you if the charge is failing though

hidden cloud
#

Sorry, let me rephrase it

#

So right now we are charging on the basis of stripe token

#

the method u just shared is doing as below:
// Create a Customer:
$customer = \Stripe\Customer::create([
'source' => 'tok_mastercard',
'email' => 'paying.user@example.com',
]);

// Charge the Customer instead of the card:
$charge = \Stripe\Charge::create([
'amount' => 1000,
'currency' => 'usd',
'customer' => $customer->id,
]);

#

So using the above method we can do recurring charges?

turbid jacinth
#

I believe so, yes. Are you getting an error when testing?

hidden cloud
#

No, I am just confirming from you

#

The above doc link says its legacy api

#

is there any updated version as well?

turbid jacinth
#

What do you mean by "updated version"? The whole API is legacy, so the docs are referencing that fact

hidden cloud
#

i mean using the Payment Intent Api version is available?

turbid jacinth
hidden cloud
#

So using Payment Intent api we can

  1. Create card token
  2. Create customer with that token
  3. Create Charge using customer id
#

Is above flow correct?

#

u there??

turbid jacinth
#

Apologies for the wait. Circling back now

#

That flow is correct, yes

hidden cloud
#

No worries !!๐Ÿ™‚

#

suppose when we charge the customer using the customer id & it failed due to insufficent fund

#

can we re run the charge call later on the same customer id if the customer inform us the card is working now

turbid jacinth
#

Yes, I believe so. I was able to create a test charge that declined using our test token tok_visa_chargeDeclinedInsufficientFunds and it allowed me to try twice

hidden cloud
#

u created the test charge on token or customer id?

turbid jacinth
#

On a Customer

hidden cloud
#

But what if we create a charge on token that was declined earlier due to insufficient funds

turbid jacinth
#

That's exactly what I did

hidden cloud
#

but create charge on customer id

#

not on token

turbid jacinth
#

That's exactly what I did. Is there a question there?

hidden cloud
#

then why does doc says one time use token

#

๐Ÿค”

warped dagger
#

Hi ๐Ÿ‘‹

It's really hard to understand what the current question is here. Can you restate?

hidden cloud
#

Hiii

#

Thanks for joining

turbid jacinth
#

Real quick, it's worth mentioning that if you ONLY create a Card Token and a Charge, then the Card Token can be used only once. If you instead create a Card Token and then attach it to a Customer, then it can be reused.

#

Anyway, snufkin will be able to help you from here, as I have to step away. Best of luck!

hidden cloud
#

@turbid jacinth

#

one think we have already used a card token, can we attach it to customer id object & reuse it?

warped dagger
#

If a Card token has already been used it cannot be attached to a Customer

#

It is considered "consumed" at that point

hidden cloud
#

if a card token is declined due to insufficient funds, will it be consider as used?

warped dagger
#

Has this occurred? Have you tested this?

hidden cloud
#

ohh ok

#

if used property is true then we can't reuse it. Correct?

warped dagger
#

Correct

#

That lets you know the Token has already been consumed

#

But if used is false you can still attach it to a Customer so you can re-use it later

hidden cloud
#

or we can directly charge using token without customer id

warped dagger
#

Correct, which will use the Token

hidden cloud
#

ok

#

one more thing when to use Payment Intent API & when to use setup intent api?

warped dagger
#

The Payment Intent API is used to collect funds. You can use it to save Payment Methods as well but the core purpose is to collect payment.

hidden cloud
#

ok

#

Our business model is like this that we save payment details like ach details: bank acc numbers, routing number

#

Because we are compliant

#

And this thing happens without using stripe save future payments option

#

Now after 10 days when we like to charge that payment method, should we use Payment Intent or Setup Intent?

warped dagger
#

Setup Intents don't make charges. They set up Payment Methods.

hidden cloud
#

ok Thank you so much @warped dagger @turbid jacinth for all the info

warped dagger
#

Happy to help ๐Ÿ™‚