#ASittingDuck
1 messages ยท Page 1 of 1 (latest)
and here is the method that is creating the payment method
const method = await stripe.createPaymentMethod({
type: 'card', card: elements.getElement(CardElement), billing_details: {
name: `${customer.firstName} ${customer.lastName}`, address: {
city: customer.city, line1: customer.address, postal_code: customer.zip, state: customer.state,
}, email: customer.email, phone: customer.phone,
},
});
Hi ๐
Can you share the request IDs associated with these requests?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
payment method create = req_5npH6A4UT5SGaz
customer create = req_Biz3uqrqfOUsWn
@upper laurel not sure if you were getting notified so sorry if I pinged you unneccisarily
No worries, there's just a number of active threads that are all mine so it might take a minute
Thanks
I see the PM is attached to the Customer, it's just not in the API response
But both the customer.created and payment_method.attached events fired in response to the Customer creation request
Ok so then there is another issue then, When I use this method
export async function updatePaymentIntent ({
// Required properties
id,
// Required shipping property
shipping = {},
// Optional properties, listed alphabetically
amount = 0,
currency = 'usd',
customer = {},
description = '',
metadata = {},
receiptEmail = '',
setupFutureUsage = 'off_session',
statementDescriptor = '',
statementDescriptorSuffix = '',
}) {
const options = {};
if (amount) options.amount = amount;
if (currency) options.currency = currency;
if (customer) options.customer = customer.id;
if (description) options.description = description;
if (metadata) options.metadata = metadata;
if (receiptEmail) options.receipt_email = receiptEmail;
if (shipping) options.shipping = shipping;
if (statementDescriptor) options.statement_descriptor = statementDescriptor;
if (statementDescriptorSuffix) options.statement_descriptor_suffix = statementDescriptorSuffix;
if (setupFutureUsage !== null) options.setup_future_usage = setupFutureUsage;
return await StripeAPI.paymentIntents.update(id, options);
}
its not using the payment method from the customer, do I need to ALSO add the payment method on this command if I have set the customer?
req_2Ip2703pLtf94R
You have attached the PM to the Customer but it's not set as the default payment method.
OK that s where I was having an issue, thank you!
Happy to help ๐
Hmmm still not working
even though the customer has a default payment method
Just want to make sure this is working before going to my next step because I am ALSO going to pass this payment method over to wordpress since will be used for subscriptions
omg, I just realized the post to update the PI isn't getting the custoemr
AH, that might make it hard to get the default PM then.
That's true BUUUUUT, now if you look at
req_QxE4PnS3u7SWoB I have made a change where the customer is now updated and STILL its not getting the payment method in req_XuDoPUNm47PIu3
Hmmm just noticed this in the API Ref
We recommend that you explicitly provide the payment_method going forward
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method
OK thank you!
Also I'm a little confused that you were passing the setup_future_usage parameter. Normally that is used when you are creating the PM as part of the Payment Intent confirmation process
Following this doc: https://stripe.com/docs/payments/save-during-payment
I was trying to MAKE SURE the payment method is available to be used on another site, since this is for a SALES site used exclusively by sales associates
Because those cards would be AUTOMATICALLY charged for subscriptions that they sales person signs them up for as well.
Okay but that parameter has no effect unless you are creating the PM as part of the intent confirmation. It needs to be part of how you set up the Payment Method
I think I may have done that, let me check
gosh dang it I don't think I did
thanks for pointing that out, I will work on that later
Is your user on-session when you are creating the Customer and PM?
Yes, the sales agent is running the transaction and getting the card information from the customer via telecommuncations like phone or zoom
Oh....
We have a custom flow for that called MOTO (Mail Order/Telephone Order) but it's something you would need to request access to
Interesting, the hard part about THAT is that this card information is ALSO used another site.
our sales site is sales.markjkohler.com
and the main site is markjkohler.com
customers can purchase the same products and subscriptions on woocommerce, but because woocommerce doesn't have a remote payment rest API option, and instead wants a payment method sent to them for recurring payments of items that are subscriptions, we have to run the payment information on stripe, and THEN send over the payment method id to woocommerce when subscriptions are being set up
luckily ALL transactions are USA based only
Otherwise, it might make sense to use Setup Intents to create the Payment Method and attach it to the Customer that way since it has some of the config options for better off_session payments: https://stripe.com/docs/payments/save-and-reuse