#sukhendu555-card-update

1 messages · Page 1 of 1 (latest)

merry spoke
#

👋 Happy to help

flat dune
#

Thank you

#

Plz let me know how i can implement

#

we are using CAKE PHP in our website

merry spoke
#

Can you explain what "card updater" does?

flat dune
#

it should help us to get latest card informations for those cards are expired

#

lost , stolen

#

so we can charge on latest card

#

we are a subscription based compan

#

company *

wintry mason
#

Hi @flat dune I'm taking over thread, give me a sec to catch up

flat dune
#

okay

wintry mason
flat dune
#

Yes, we read this documentation,

#

Let us know how can we process through api?

#

Yex, how to call the API for customer create, card create , link customer and card?

#

And how to process payment through api?

wintry mason
#

You will need the new card details (new expiry date, cvc) in order to update the card payment method, and your customer need to provide them.

Instead of doing these all by your self, I'd suggest you to use the Customer billing portal (https://stripe.com/docs/billing/subscriptions/integrating-customer-portal) instead.

Here's the solution that I'd recommend

  • Listen to invoice.payment_failed events, these events will be fired when the invoice payment failed
  • Notify your customer and send them a Customer billing portal URL where they can update the payment details.
flat dune
#

Use manually one

#

And update in db

#

Need to maintain all card history

wintry mason
#

Ok, then you will need to use the PaymentMethod update API that I mentioned earlier.

#

How do you get the new card details from your customers?

flat dune
#

Usually customers not provide new card details.

#

Anyway we will receive new card details from stripe?

wintry mason
#

You will receive payment_method.automatically_updated events when the card details are automatically updated by the network. And you can then check the paymentMethod object and see if anything changed.

flat dune
#

okay

wintry mason
#

However, not all cards can be automatically updated, it varies from country to country.

flat dune
#

Can you check my payment receive process form customer?

#

1st we set : new \Stripe\StripeClient(

wintry mason
#

Can you elaborate more?

flat dune
#

then : $stripe->customers->create(

#

$stripe->paymentMethods->create(

#

Here we receive payment : $stripe->paymentIntents->create(

#

These process we receive payment. Is it correct?

wintry mason
#

For this step $stripe->paymentMethods->create( how did you get the card details from customer?

flat dune
#

customer give there card details in payment form.

wintry mason
#

are you collecting the raw PAN?

#

We discourage collecting PAN directly because you need to get your own PCI compliance.

flat dune
#

Don't understand raw PAN?

wintry mason
#

You should use PaymentElement or CardElement to collect the payment details.

#

PAN = Primary Account Number

flat dune
#

ok

#

Then how we save save card and customer and link them through api?

wintry mason
flat dune
#

\Stripe\PaymentIntent::create([
'amount' => 1099,
'currency' => 'usd',
'customer' => '{{CUSTOMER_ID}}',
'payment_method' => '{{PAYMENT_METHOD_ID}}',
'off_session' => true,
'confirm' => true,
]);

#

Where I'll get {{PAYMENT_METHOD_ID}} ?

wintry mason
#

Hi, have you read through the doc that I sent earlier? It covers how payment method is collected.

flat dune
#

okay