Business-Stripe-Webhook
view release on metacpan or search on metacpan
t/08-get-subscription.t view on Meta::CPAN
content => '{"id":"sub_123","status":"active"}',
headers => { 'content-type' => 'application/json' },
};
},
);
my $response = $webhook->get_subscription('sub_123');
ok( $response->{success}, 'Successful response' );
is( $called{method}, 'GET', 'Uses GET method' );
is( $called{url}, 'https://api.stripe.com/v1/subscriptions/sub_123', 'Uses subscription endpoint' );
is( $called{headers}->{Authorization}, 'Bearer sk_test_123', 'Uses API secret header' );
my $data = decode_json($response->{content});
is( $data->{id}, 'sub_123', 'Parsed JSON subscription id' );
is( $data->{status}, 'active', 'Parsed JSON subscription status' );
$mock->redefine(
request => sub {
return {
success => 0,
( run in 0.881 second using v1.01-cache-2.11-cpan-55a6197bec7 )