#KEITH LARD

1 messages · Page 1 of 1 (latest)

mystic pebbleBOT
worn jasper
tender radish
#

Hi toby, I cannot do this unfortunately as there is some metadata I need to set and data on my side which I cannot set with the test clocks, is that the only solution?

#

Is it possible to use test clocks with an existing sub, say I advanced the one I just made by 1 day

worn jasper
#

No, you cannot use an existing Subscription with a new Test Clock, you will need to create a new Subscription. Test Clocks don't prevent features like metadata from being usable, you could still leverage that in your testing.

tender radish
#

Cool I'll give it a go thank you

#

How can I set metadata when I create it in the dashboard? I dont see the option

worn jasper
#

Oh, I'm not sure if that is possible through the dashboard (we primarily focus on leveraging APIs in this channel).

#

I'm not seeing a way to add metadata during creation, but I see an Edit metadata button that is available on the Subscription's page once it has been created.

tender radish
#

Cool found it thanks for the help

worn jasper
#

Any time!

tender radish
#

Sorry one more question, when I create a sub in my normal flow I pass the $subscription->latest_invoice->payment_intent->client_secret to my checkout to generate it (payment element)

#

Do I do the same thing for past_due subscriptions?

#

I am getting

Trying to get property 'payment_intent' of non-object
when I do that with past_due subs

worn jasper
#

I believe that is still right, can you share the ID of the Subscription you're using for testing so I can take a closer look?

tender radish
#

sub_1NAv7sAjtNFaRAYonNQhJvnH

#

Do I need to expand latest_invoice or something after I retrieve?

mystic pebbleBOT
worn jasper
#

Yes, if you're trying to retrieve the Payment Intent's client secret with a single request by retrieving the Subscription, then you will need to expand latest_invoice on the Subscription, and the payment_intent field on the Invoice. I believe you can do that by expanding latest_invoice.payment_intent

tender radish
#

I've realised I've done exactly that on my original flow when I make it 🤣 sorry im a dum dum

#

thank you

#

And when a payment is successful for a past_due sub, I'm assuming I need to make that the default payment method for the subscription? And everything else status logic wise should be handled automatically

worn jasper
#

Yeah, if the customer is providing new payment method details to be used for Subscriptions moving forward, then setting that Payment Method as the default would be good. The Subscription will then try to use that saved Payment Method for its next billing period's payment.

tender radish
#

perfect thanks again for the help