NAME

Net::API::Stripe::Billing::Plan::TransformUsage - A Stripe Plan Transform Usage Object

SYNOPSIS

my $usage = $plan->transform_usage({
    divide_by => 2,
    round => 0,
});

VERSION

v0.100.0

DESCRIPTION

Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with tiers.

Called from method transform_usage in Net::API::Stripe::Billing::Plan

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Billing::Plan::TransformUsage object. It may also take an hash like arguments, that also are method of the same name.

METHODS

divide_by integer

Divide usage by this number.

round string

After division, either round the result up or down.

API SAMPLE

{
  "id": "expert-monthly-jpy",
  "object": "plan",
  "active": true,
  "aggregate_usage": null,
  "amount": 8000,
  "amount_decimal": "8000",
  "billing_scheme": "per_unit",
  "created": 1507273129,
  "currency": "jpy",
  "interval": "month",
  "interval_count": 1,
  "livemode": false,
  "metadata": {},
  "nickname": null,
  "product": "prod_fake123456789",
  "tiers": null,
  "tiers_mode": null,
  "transform_usage": null,
  "trial_period_days": null,
  "usage_type": "licensed"
}

HISTORY

v0.1

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/plans/object

COPYRIGHT & LICENSE

Copyright (c) 2019-2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.