#Village_Admin - Dispute Subscription ID

1 messages ยท Page 1 of 1 (latest)

echo charm
craggy pollen
#

๐Ÿ‘‹ you would go dispute -> PaymentIntent -> customer and then list invoices for that customer and check their PI to match and then the Sub ID is associated with the invoice.

soft minnow
#

You make it sound so easy ๐Ÿ˜‰

craggy pollen
#

It is not a happy path

soft minnow
#

I only expect a customer to have a single active subscription, is there a shortcut on that to get from customer to subscription without taking a detour through invoices?

craggy pollen
#

Oh yeah sure. You can list subs by customer

#

So you just go dispute -> PaymentIntent-> customer and then list subs and the returned Sub will be the only option

soft minnow
#

Oh, i think i see another option, i have to run a test to see if its returning as i think it should, but...
dispute -> charge[expand invoice] -> invoice.subscription

craggy pollen
#

Ah! You are correct. I forgot we contain the invoice with the charge itself.

#

Good call

#

That would be better then you don't have to list subs

soft minnow
#

Charge::retrieve(['id'=>$chargeId, 'expand'=>['charge']]);
I only need "charge" for the expand to work?

#

Is there a way in the dashboard for a "lost" dispute to have it fire off a webhook again? So i don't need to create a new customer & transaction & dispute?

#

I know about going into webhook logs, but i setup a new webhook which wasn't there when the dispute happened, so i can't resend it on the new webhook.

unique plank
#

Hello! Yep, specifying charge should be all you need there to expand the charge property.

#

You may be able to resend a previous event from the Dashboard if you go into Developers > Webhooks > select the endpoint receiving the events > select the specific event you want to resend > click on the Resend button.

#

Oh, didn't read that last sentence until I typed that!

soft minnow
#

Okay thanks, im done with this thread.

unique plank
#

Happy to help! If you need anything else let us know!

soft minnow
#
$charge_obj = \Stripe\Charge::retrieve(['id'=>$chargeId, 'expand'=>['charge']]);

Causes

Uncaught (Status 400) (Request req_MJOQSwgYuRZmgI) This property cannot be expanded (charge)
#

Oops, nevermind, i figured it out

#

sorry.

unique plank
#

Yeah, expanding charge on a Charge won't work. ๐Ÿ™‚

#

Sorry I didn't catch that earlier.