#Petr

1 messages · Page 1 of 1 (latest)

heavy frigateBOT
shrewd perch
oak edge
#

I'm already using $stripe->checkout->sessions->create([]);
and get payment_intent after successful payment
how do I need to use payment_intent for auto payment: which method to use,

#

send data [
'line_items' => $this->order_send['items'],
"metadata" => ["order_id" => $this->order_id, "user_id" => $this->user['id'], 'email' => $this->user['email'],],
'client_reference_id' => $this->order_id,
'customer_email' => $this->user['email'],
'mode' => 'payment',
'success_url' => $this->payment['returnUrl'],
'cancel_url' => $this->payment['url'] . '?isError=true',
]

shrewd perch
#

by "auto payment", do you mean, charging the card that the customer used, yourself later directly from your server?

oak edge
#

I mean the algorithm

  1. the client paid for the membership and we received the payment_intent
  2. after a certain time, we send a request with payment_intent in the band and charge the amount of membership renewal or additional services
shrewd perch
#

so again, you could use Checkout to create a Subscription if you want to do recurring payments, that's the easiest option

oak edge
#

i get payment_intent but don't get CUSTOMER_ID after payment
to get CUSTOMER_ID should i create it or is it not necessary? I can send mail or phone

shrewd perch
oak edge
#

this

'customer_email'      => $this->user['email'],
'customer_creation'      => 'if_required',
'mode'                => 'payment',
shrewd perch
#

if_required won't do anything since you're using the payment mode that doesn't require one

#

check the docs :

#

that's why I said to use always 🙂

oak edge
#

ok i will try