How to fill in the description field of a strip in a subscription?

I can fill out the Business::Stripe description field for one fare using the code below:

 use Business::Stripe; # Version 0.4 # Create Customer my $customer = $stripe->api('post', 'customers', card => $stripeToken, description => $username, ); # Charge my $charge = $stripe->api('post', 'charges', customer => $customer, currency => $currency, description => 'my description here no probs', amount => $amount, ); 

But when I create a client by the client and assign him to the subscription plan, I don’t see how to fill in the description of the charge made for each billing period.

 # Create Customer and subscribe to a plan my $customer = $stripe->api('post', 'customers', card => $stripeToken, description => 'description here is for the customer not the monthly charge', plan => $plan ); 

I want to be able to add a description to the board that occurs in each billing period.

The API does not seem to show the way, but the field is editable through the strie toolbar.

+5
source share
1 answer

Stripe is thinking of automatically filling out the charge description in the invoices, but this is not a function that exists. In the meantime, as soon as the invoice.payment_succeeded event invoice.payment_succeeded , you can get the charge identifier from the event data. Then you can update the charge description via the API:

https://stripe.com/docs/api#update_charge

Hope this helps, Larry

PS I am working on support on Stripe.

+6
source

Source: https://habr.com/ru/post/1204052/


All Articles