#idle_customer-savecard

1 messages ยท Page 1 of 1 (latest)

sudden raptorBOT
#

๐Ÿ‘‹ 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.

ebon mossBOT
marble nebula
#

idle_customer-savecard

lusty wolf
#

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

marble nebula
#

Unfortunately if you are using someone else's code that you don't control there isn't much I can do here

lusty wolf
#

I have access to the payment intent function

#

I can control/edit it

marble nebula
#

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

lusty wolf
#

ok

marble nebula
#

If you share some code I can show you what needs to change for example

lusty wolf
#

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

marble nebula
lusty wolf
#

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

marble nebula
#

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

lusty wolf
#

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

marble nebula
#

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

sudden raptorBOT