How to get charge id after creating a subscription using Stripe?

后端 未结 6 2313
忘掉有多难
忘掉有多难 2021-02-13 21:36

I am using Stripe as a payment gateway. Now there\'s a big problem bothers me.

I used code below to create a subscription:



        
6条回答
  •  鱼传尺愫
    2021-02-13 21:52

    I was stuck over the same problem after spending some time it turns out to be pretty simple.

    Step 1: Call retrieve all invoice API with subscription id as a parameter.

    Example in PHP:

    $invoice = \Stripe\Invoice::all(array("subscription" => your_subscription_id)); 
    

    In $invoice you will get Charge ID and hence, you can get everything after that.

提交回复
热议问题