#greggles-customer-pms

1 messages ยท Page 1 of 1 (latest)

subtle heartBOT
#

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.

verbal sand
quasi aurora
#

Hi, sure let me retrieve that.

#

req_3sVMvMFwAgBlxZ

verbal sand
quasi aurora
#

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?

verbal sand
#

Yes you can

quasi aurora
verbal sand
#

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

quasi aurora
#

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.

verbal sand
#

Oh, okay.

quasi aurora
#

We don't work with sources on the production site but I want to emulate a customer in a test environment.

verbal sand
#

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

quasi aurora
#

Oh great, thanks for that.

verbal sand
#

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",
}
quasi aurora
#

The weird thing is that it looks like it's already set as the default card.

#

Thanks for that code block.

verbal sand
#

When you retrieve the customer, do you see the card in the invoice_settings.default_payment_method?

quasi aurora
#

That method of attaching a test card to the customer object works well. Thank you very much for your help today.

verbal sand
#

Great! I'm glad I was able to help ๐Ÿ™‚