| 1 | ##---------------------------------------------------------------------------- | ||||||||||||||
| 2 | ## Stripe API - ~/lib/Net/API/Stripe/Connect/Account/ExternalAccounts.pm | ||||||||||||||
| 3 | ## Version v0.100.0 | ||||||||||||||
| 4 | ## Copyright(c) 2019 DEGUEST Pte. Ltd. | ||||||||||||||
| 5 | ## Author: Jacques Deguest <jack@deguest.jp> | ||||||||||||||
| 6 | ## Created 2019/11/02 | ||||||||||||||
| 7 | ## Modified 2020/05/15 | ||||||||||||||
| 8 | ## | ||||||||||||||
| 9 | ##---------------------------------------------------------------------------- | ||||||||||||||
| 10 | package Net::API::Stripe::Connect::Account::ExternalAccounts; | ||||||||||||||
| 11 | BEGIN | ||||||||||||||
| 12 | 1 | ▶ | { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 14 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 15 | 1 | ▶ | use parent qw( Net::API::Stripe::List ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 16 | 1 | ▶ | use vars qw( $VERSION ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 17 | 1 | our( $VERSION ) = 'v0.100.0'; | |||||||||||||
| 18 | }; | ||||||||||||||
| 19 | |||||||||||||||
| 20 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 21 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 22 | |||||||||||||||
| 23 | # Inhertied | ||||||||||||||
| 24 | # sub object { return( shift->_set_get_scalar( 'object', @_ ) ); } | ||||||||||||||
| 25 | |||||||||||||||
| 26 | ## The list contains all external accounts that have been attached to the Stripe account. These may be bank accounts or cards. | ||||||||||||||
| 27 | ## sub data { return( shift->_set_get_array( 'data', @_ ) ); } | ||||||||||||||
| 28 | sub data | ||||||||||||||
| 29 | 0 | ▶ | { | ||||||||||||
|
Subroutine
data: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||
| 30 | 0 | my $self = shift( @_ ); | |||||||||||||
| 31 | 0 | ▶ | if( @_ ) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 32 | { | ||||||||||||||
| 33 | my $process = sub | ||||||||||||||
| 34 | 0 | ▶ | { | ||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||
| 35 | 0 | my $ref = shift( @_ ); | |||||||||||||
| 36 | 0 | ▶ | my $type = $ref->{object} || return( $self->error( "No object type could be found in hash: ", sub{ $self->_dumper( $ref ) } ) ); | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Condition0%0/2
$ref->{'object'} || (return $self->error('No object type could be found in hash: ', sub {
$self->_dumper($ref);
}
))
MC/DC0%0/1
$ref->{'object'} || (return $self->error('No object type could be found in hash: ', sub {
$self->_dumper($ref);
}
))
$ref->{'object'}
Truth table0%0/2
A
A= $ref->{'object'}
| |||||||||||||||
| 37 | 0 | my $class = $self->_object_type_to_class( $type ); | |||||||||||||
| 38 | 0 | $self->_message( 3, "Object type $type has class $class" ); | |||||||||||||
| 39 | 0 | my $o = $self->_instantiate_object( 'data', $class, $ref ); | |||||||||||||
| 40 | 0 | $self->{data} = $o; | |||||||||||||
| 41 | ## return( $class->new( %$ref ) ); | ||||||||||||||
| 42 | ## return( $self->_set_get_object( 'object', $class, $ref ) ); | ||||||||||||||
| 43 | 0 | }; | |||||||||||||
| 44 | |||||||||||||||
| 45 | 0 | ▶ | if( ref( $_[0] ) eq 'HASH' ) | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 46 | { | ||||||||||||||
| 47 | 0 | my $o = $process->( @_ ) | |||||||||||||
| 48 | } | ||||||||||||||
| 49 | ## An array of objects hash | ||||||||||||||
| 50 | elsif( ref( $_[0] ) eq 'ARRAY' ) | ||||||||||||||
| 51 | { | ||||||||||||||
| 52 | 0 | my $arr = shift( @_ ); | |||||||||||||
| 53 | 0 | my $res = []; | |||||||||||||
| 54 | 0 | foreach my $data ( @$arr ) | |||||||||||||
| 55 | { | ||||||||||||||
| 56 | 0 | ▶ | my $o = $process->( $data ) || return( $self->error( "Unable to create object: ", $self->error ) ); | ||||||||||||
|
Condition0%0/2
&$process($data) || (return $self->error('Unable to create object: ', $self->error))
MC/DC0%0/1
&$process($data) || (return $self->error('Unable to create object: ', $self->error))
&$process($data)
Truth table0%0/2
A
A= &$process($data)
| |||||||||||||||
| 57 | 0 | push( @$res, $o ); | |||||||||||||
| 58 | } | ||||||||||||||
| 59 | 0 | $self->{data} = $res; | |||||||||||||
| 60 | } | ||||||||||||||
| 61 | } | ||||||||||||||
| 62 | 0 | return( $self->{data} ); | |||||||||||||
| 63 | } | ||||||||||||||
| 64 | |||||||||||||||
| 65 | # Inhertied | ||||||||||||||
| 66 | # sub has_more { return( shift->_set_get_scalar( 'has_more', @_ ) ); } | ||||||||||||||
| 67 | |||||||||||||||
| 68 | # Inhertied | ||||||||||||||
| 69 | # sub total_count { return( shift->_set_get_scalar( 'total_count', @_ ) ); } | ||||||||||||||
| 70 | |||||||||||||||
| 71 | # Inhertied | ||||||||||||||
| 72 | # sub url { return( shift->_set_get_uri( 'url', @_ ) ); } | ||||||||||||||
| 73 | |||||||||||||||
| 74 | 1 | 1; | |||||||||||||
| 75 | |||||||||||||||
| 76 | __END__ | ||||||||||||||