Skip to content

get_cards doesn't work #33

@srchulo

Description

@srchulo

!/usr/bin/perl

use Net::Stripe;

my $stripe = Net::Stripe->new(api_key => 'sk_test_fnQCsdfasdsfafdOn3bYasdfgOkqo');

my $c = $stripe->get_customer(customer_id => 'cus_4Gughbst');
my $cards = $stripe->get_cards(customer => $c);

print @$cards;

The above get_cards method will fail. It gives this error:

Expected named arguments but didn't find an even-sized list at /usr/local/share/perl5/MooseX/Method/Signatures/Meta/Method.pm line 401
MooseX::Method::Signatures::Meta::Method::ANON('ARRAY(0x4b47bf0)') called at /usr/local/lib64/perl5/Moose/Meta/TypeCoercion.pm line 68
Moose::Meta::TypeCoercion::ANON('ARRAY(0x4b47bf0)') called at /usr/local/lib64/perl5/Moose/Meta/TypeCoercion.pm line 102
Moose::Meta::TypeCoercion::coerce('MooseX::Meta::TypeCoercion::Structured=HASH(0x4215318)', 'ARRAY(0x4b47bf0)') called at /usr/local/lib64/perl5/Moose/Meta/TypeConstraint.pm line 165
Moose::Meta::TypeConstraint::coerce('MooseX::Meta::TypeConstraint::Structured=HASH(0x4215120)', 'ARRAY(0x4b47bf0)') called at /usr/local/share/perl5/MooseX/Types/TypeDecorator.pm line 173
MooseX::Types::TypeDecorator::_try_delegate('MooseX::Types::TypeDecorator=HASH(0x42117d0)', 'coerce', 'ARRAY(0x4b47bf0)') called at /usr/local/share/perl5/MooseX/Types/TypeDecorator.pm line 138
MooseX::Types::TypeDecorator::AUTOLOAD('MooseX::Types::TypeDecorator=HASH(0x42117d0)', 'ARRAY(0x4b47bf0)') called at /usr/local/share/perl5/MooseX/Meta/TypeConstraint/ForceCoercion.pm line 29
MooseX::Meta::TypeConstraint::ForceCoercion::validate('MooseX::Meta::TypeConstraint::ForceCoercion=HASH(0x42186f8)', 'ARRAY(0x4b47bf0)', 'SCALAR(0x309a138)') called at /usr/local/share/perl5/MooseX/Method/Signatures/Meta/Method.pm line 436
MooseX::Method::Signatures::Meta::Method::validate('MooseX::Method::Signatures::Meta::Method=HASH(0x4b48250)', 'ARRAY(0x4b47bf0)') called at /usr/local/share/perl5/MooseX/Method/Signatures/Meta/Method.pm line 152
Net::Stripe::get_cards('Net::Stripe=HASH(0x19b3b98)', 'customer', 'Net::Stripe::Customer=HASH(0x52caf68)') called at stripe.pl line 14

Also, in the documentation the example has 'list_cards' instead of 'get_cards'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions