-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Description
i discovered incidentally that methods that will accept a token id can be passed the test token id directly. so in cases where we are not later comparing other properties of the token:
Lines 247 to 264 in 5ad870c
Charge_with_metadata: { | |
my $token = $stripe->get_token( token_id => $token_id_visa ); | |
my $charge; | |
lives_ok { | |
$charge = $stripe->post_charge( | |
amount => 2500, | |
currency => 'usd', | |
card => $token->id, | |
description => 'Testing Metadata', | |
metadata => {'hasmetadata' => 'hello world'}, | |
); | |
} 'Created a charge object with metadata'; | |
isa_ok $charge, 'Net::Stripe::Charge'; | |
ok defined($charge->metadata), "charge has metadata"; | |
is $charge->metadata->{'hasmetadata'}, 'hello world', 'charge metadata'; | |
my $charge2 = $stripe->get_charge(charge_id => $charge->id); | |
is $charge2->metadata->{'hasmetadata'}, 'hello world', 'charge metadata in retrieved object'; | |
} |
the token object creation can be bypassed, and $token_id_visa
can be passed to post_charge()
, et al.
Metadata
Metadata
Assignees
Labels
No labels