I can populate Business::Stripe
's description field for one off charges with the below code :
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 customer a customer and assign them to a subscription plan I can't see how to populate the description of the charge made 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 charge that happens each billing period.
The API doesn't seem to show a way but the field is editable via the strie dashboard.
The Customer resource is a core entity within Stripe. Use it to store all of the profile, billing, and tax information required to bill a customer for subscriptions and one-off invoices.
Add a one-time fee or discount with a new subscription plan : Stripe: Help & Support. To include a one-time charge or discount to the first subscription invoice, you can do so by adding an invoice item to the customer before creating the subscription. This can be done using the API or directly in the Stripe Dashboard.
Stripe is thinking about auto-populating the charge description on invoices, but that's not a feature that exists yet. In the meantime, once the invoice.payment_succeeded
event occurs, you can get the charge ID from that event data. Then you can update the charge's description via the API:
https://stripe.com/docs/api#update_charge
Hope that helps, Larry
PS I work on Support at Stripe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With