#greggles-customer-pms
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- greggles, 1 day ago, 28 messages
- greggles, 2 days ago, 21 messages
- greggles-subscription-bca, 2 days ago, 10 messages
HI ๐
Can you share an API request ID that returns this error message? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
And you don't retrieve it through the customer like we show here? https://stripe.com/docs/api/cards/retrieve
No, we're looking for the default cardin the customer object.
$customer->invoice_settings->default_payment_method
After creating the source and attaching to the customer object can I set it as the default payment method?
Yes you can
No, that isn't what is going on here.
You would want to update the Customer object directly after you attach the source, to set the newly attached source as the default_payment_method
However, why are you working with Sources at all? These won't be optimally configured for recurring charges
I'm attempting to run though various scenarios by programmatically creating a sample customer on a test clock. It just takes a long time to create one through the dashboard.
Oh, okay.
We don't work with sources on the production site but I want to emulate a customer in a test environment.
If you use the same tok_ test PM, you can pass both the payment_method and invoice_settings.default_payment_method parameters when creating Customers
I just ran a test script I have for creating a Customer with a test clock (it comes up a lot in scripting Subscription tests).
Here is the payload I'm passing to the API
{
payment_method: "pm_card_visa",
test_clock: "clock_1XXXXXXXXX",
email: "testy-test@example.com",
description: "Test clock customer",
invoice_settings: {
default_payment_method: "pm_card_visa",
},
name: "Clocky McClockerton",
}
The weird thing is that it looks like it's already set as the default card.
Thanks for that code block.
When you retrieve the customer, do you see the card in the invoice_settings.default_payment_method?
That method of attaching a test card to the customer object works well. Thank you very much for your help today.
Great! I'm glad I was able to help ๐