I am using Stripe
as a payment gateway. Now there\'s a big problem bothers me.
I used code below to create a subscription:
I just ran into the same issue myself. I'm using the python library but the answer is more about Stripe's API than what language the client is in.
Ultimately, since I'm creating a new customer with each subscription, I was able to look up the invoice against the customer_id and grab its charge id. Here's what the python code for that looks like:
stripe_api.Invoice.all(customer=subscribe_result['customer'])['data'][0]['charge']
Again, note that this method would not work if you re-use customers, only if creating new customers with each subscription create.
It's certainly not ideal. It would be far better if the charge id were included in the return. Even knowing the Invoice ID would at least solve the issue of re-using customers though it would still require an unnecessary API call to fetch the invoice.