| 1 | package Business::GoCardless::Bill; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Business::GoCardless::Bill | ||
| 6 | |||
| 7 | =head1 DESCRIPTION | ||
| 8 | |||
| 9 | A class for a gocardless bill, extends L<Business::GoCardless::Resource> | ||
| 10 | |||
| 11 | =cut | ||
| 12 | |||
| 13 | 55 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 55 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 55 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | 55 | extends 'Business::GoCardless::Resource'; | |
| 19 | |||
| 20 | =head1 ATTRIBUTES | ||
| 21 | |||
| 22 | amount | ||
| 23 | amount_minus_fees | ||
| 24 | can_be_cancelled | ||
| 25 | can_be_retried | ||
| 26 | charge_customer_at | ||
| 27 | created_at | ||
| 28 | currency | ||
| 29 | description | ||
| 30 | gocardless_fees | ||
| 31 | id | ||
| 32 | is_setup_fee | ||
| 33 | merchant_id | ||
| 34 | name | ||
| 35 | paid_at | ||
| 36 | partner_fees | ||
| 37 | payout_id | ||
| 38 | source_id | ||
| 39 | source_type | ||
| 40 | status | ||
| 41 | uri | ||
| 42 | user_id | ||
| 43 | |||
| 44 | =cut | ||
| 45 | |||
| 46 | 55 | has [ qw/ | |
| 47 | amount | ||
| 48 | amount_minus_fees | ||
| 49 | can_be_cancelled | ||
| 50 | can_be_retried | ||
| 51 | charge_customer_at | ||
| 52 | created_at | ||
| 53 | currency | ||
| 54 | description | ||
| 55 | gocardless_fees | ||
| 56 | id | ||
| 57 | is_setup_fee | ||
| 58 | merchant_id | ||
| 59 | name | ||
| 60 | paid_at | ||
| 61 | partner_fees | ||
| 62 | payout_id | ||
| 63 | source_id | ||
| 64 | source_type | ||
| 65 | status | ||
| 66 | uri | ||
| 67 | user_id | ||
| 68 | / ] => ( | ||
| 69 | is => 'rw', | ||
| 70 | ); | ||
| 71 | |||
| 72 | =head1 Operations on a bill | ||
| 73 | |||
| 74 | retry | ||
| 75 | cancel | ||
| 76 | refund | ||
| 77 | |||
| 78 | $Bill->retry if $Bill->failed; | ||
| 79 | |||
| 80 | =cut | ||
| 81 | |||
| 82 | 1 | ▶ | sub retry { shift->_operation( 'retry' ); } |
|
Subroutine
retry: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 83 | 1 | ▶ | sub cancel { shift->_operation( 'cancel','api_put' ); } |
|
Subroutine
cancel: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 84 | 1 | ▶ | sub refund { shift->_operation( 'refund' ); } |
|
Subroutine
refund: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 85 | |||
| 86 | =head1 Status checks on a bill | ||
| 87 | |||
| 88 | pending | ||
| 89 | paid | ||
| 90 | failed | ||
| 91 | chargedback | ||
| 92 | cancelled | ||
| 93 | withdrawn | ||
| 94 | refunded | ||
| 95 | |||
| 96 | if ( $Bill->failed ) { | ||
| 97 | ... | ||
| 98 | } | ||
| 99 | |||
| 100 | =cut | ||
| 101 | |||
| 102 | 1 | ▶ | sub pending { return shift->status eq 'pending' } |
|
Subroutine
pending: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 103 | 1 | ▶ | sub paid { return shift->status eq 'paid' } |
|
Subroutine
paid: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 104 | 1 | ▶ | sub failed { return shift->status eq 'failed' } |
|
Subroutine
failed: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 105 | 1 | ▶ | sub chargedback { return shift->status eq 'chargedback' } |
|
Subroutine
chargedback: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 106 | 2 | ▶ | sub cancelled { return shift->status eq 'cancelled' } |
|
Subroutine
cancelled: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 107 | 1 | ▶ | sub withdrawn { return shift->status eq 'withdrawn' } |
|
Subroutine
withdrawn: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 108 | 2 | ▶ | sub refunded { return shift->status eq 'refunded' } |
|
Subroutine
refunded: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 109 | |||
| 110 | =head1 AUTHOR | ||
| 111 | |||
| 112 | Lee Johnson - C<lee@payprop.com> | ||
| 113 | |||
| 114 | This library is free software; you can redistribute it and/or modify it under | ||
| 115 | the same terms as Perl itself. If you would like to contribute documentation, | ||
| 116 | features, bug fixes, or anything else then please raise an issue / pull request: | ||
| 117 | |||
| 118 | https://github.com/payprop/business-gocardless | ||
| 119 | |||
| 120 | =cut | ||
| 121 | |||
| 122 | 55 | 1; | |
| 123 | |||
| 124 | # vim: ts=4:sw=4:et | ||