#idle_customer-savecard
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ 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.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ 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/1227296074071408700
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey @lusty wolf You want to read https://docs.stripe.com/payments/save-during-payment which explains how to do this
idle_customer-savecard
Hi @marble nebula , thanks for this. I have read through this and I guess I am not sure where I need to udpate my current code. I have access to the code, though I did not write it (it is a motopress plugin). I tried calling customer support as I know this chat is used for developers, but they recommeneded I reach out
I understand I need to add the setup_future_usage function to the payment intent, but I'm having trouble identifying where
Unfortunately if you are using someone else's code that you don't control there isn't much I can do here
The docs I shared have exact code for all languages so you should be able to find the relevant piece of code and change it to properly create and save a Customer object
ok
If you share some code I can show you what needs to change for example
ok. I do apologize if I don't have the background for you, as well. I understand that there might not be much you can help me with based on the information I know
so I have in my library a paymentintent.php file
/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return PaymentIntent the captured payment intent
*/
public function capture($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/capture';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
is one of the blocks of code, though I'm not sure this is where it would be
That code looks like it's mapping to the Capture PaymentIntent API https://docs.stripe.com/api/payment_intents/capture
it's for https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
But totally unrelated to what you are trying to do right now
yes it is mapping to that, and that's what I was discussing on the phone (that it isn't necessarily what I'm looking to do)
or, I should say, the article they sent wasn't helpful in that regard
yeah sorry you seem totally lost ๐ฆ
You are asking how to save card details. This is related to having Customer objects at the time of PaymentIntent creation. Completely unrelated to the capture step
ok, so I have been looking for the payment intent creation, but haven't been able to find it. If you are unable to help me in finding that then I will just keep looking myself
I have been looking through the stripe library based off of the information I was given on the phone and read about on those pages so I thought i'd reach out
your plugin doesn't use any of our official SDKs methods. It constructs the parameters and the URL by hand instead (which is pretty bad if you ask me ๐ )
ah no wait you just shared our own internal code and are likely even more confused
You need to find where in your plugin's code (not in the stripe-php SDK) they are calling the PaymentIntent creation