#Petr
1 messages · Page 1 of 1 (latest)
refund all sum
or make it so that I get the data for linking the card without debiting funds
for paymentIntent
If you want to create a refund: https://stripe.com/docs/api/refunds/create
and f it is possible to pass a parameter so that there is no write-off of funds, but I received paymentIntent
i send
$this->order_send = [
'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,
'mode' => 'payment',
'success_url' => $this->payment['returnUrl'],
'cancel_url' => $this->payment['url'] . '?isError=true',
'payment_intent_data' => ['setup_future_usage' => 'off_session'],
];
What do you mean by "there is no write-off of funds"?
payment of 1 usd for linking a card with a subsequent refund of 1 usd
Yes:
Step 1. make the payment (with Checkout Session for example)
Step 2. create the refund with https://stripe.com/docs/api/refunds/create and passing the PaymentIntent ID of Step 1.
👍
Note that if your goal is to save a card for later, then you should use Checkout Session in setup mode instead
This is explained here: https://stripe.com/docs/payments/save-and-reuse?platform=checkout
i can use charge?
when using $stripe->checkout->sessions->retrieve i get the object
what should be passed from it to $stripe->refunds->create to return
"id": "cs_test_a17C1uROCcFPOexmwCPZ0lFvXASP19kLPPszgnXGu6YHN3jvxBVGDH0dNU",
"object": "checkout.session",
?
Once the Checkout Session is completed you'll have a PaymentIntent id :
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
From the PaymentIntent you have the chargeId:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
Use it for the refund.
Hi! I'm taking over from my colleague. Please, let me know if you have any other questions.