NAME

Business::GoCardless::Subscription

DESCRIPTION

A class for a gocardless subscription, extends Business::GoCardless::Resource

ATTRIBUTES

amount
app_fee
created_at
count
currency
description
day_of_month
earliest_charge_date_after_resume
expires_at
end_date
id
interval_length
interval_unit
interval
links
merchant_id
metadata
month
name
next_interval_start
parent_plan_paused
payment_reference
retry_if_possible
setup_fee
start_at
start_date
status
sub_resource_uris
uri
user_id
upcoming_payments

Operations on a subscription

cancel

$Subscription->cancel

Cancels a subscription. With the Pro (v2) API you can optionally pass metadata:

$Subscription->cancel( metadata => { ... } );

The following operations are only available with the Pro (v2) API:

update

Update the subscription, returns the updated Subscription object:

$Subscription->update( amount => 1500,metadata => { ... } );

pause

Pause the subscription, optionally for a number of cycles:

$Subscription->pause;
$Subscription->pause( pause_cycles => 2,metadata => { ... } );

resume

Resume a paused subscription:

$Subscription->resume;

Status checks on a subscription

pending_customer_approval
customer_approval_denied
inactive
active
finished
cancelled
paused
expired

if ( $Subscription->active ) {
    ...
}

AUTHOR

Lee Johnson - lee@payprop.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you would like to contribute documentation, features, bug fixes, or anything else then please raise an issue / pull request:

https://github.com/payprop/business-gocardless