I've released a new version of Business::Stripe::Webhook with a modified constructor following the discussion about STDIN typeglob
At the same time I have added some extra, more thorough tests. All the tests pass as expected here locally but now it has reached CPAN Testers, I have a failure. I can usually work out why something is failing from the diagnostic information...but I cannot see the problem in this case. Can you help please?
This is the CPAN Tester Report and this is the test file:
Any help (or general help with improving tests) would be very welcome...#!perl use 5.010; use strict; use warnings; use Test::More; use Business::Stripe::Webhook; #plan tests => 3; my $count = 0; print "\n"; my $payload; read(DATA, $payload, 10000); my $webhook_fail = Business::Stripe::Webhook->new( signing_secret => 'whsec_...', 'payload' => $payload, 'invoice-paid' => \&pay_invoice, ); $webhook_fail->process(); ok( !$webhook_fail->success, "Signature error" ); my $signing_secret = 'whsec_12345ABCDEFGHIJKLM'; $ENV{'HTTP_STRIPE_SIGNATURE'} = 't=ABCDEFGHIJ,v1=917fd62f6828ceb0509ae +bd9ee94e4c455887b6c174ef94037e089265c8c575c'; my $webhook_pass = Business::Stripe::Webhook->new( signing_secret => $signing_secret, 'payload' => $payload, 'invoice-paid' => \&pay_invoice, ); $webhook_pass->process(); ok( $webhook_pass->success, "Signature pass" ); sub pay_invoice { is( $_[0]->{'object'}, 'event', "pay.invoice handled - " . ++$coun +t ); } done_testing($count + 2); __DATA__ { "id": "evt_1NFK32EfkkexSbWLZb6LoEap", "object": "event", "api_version": "2020-08-27", "data": { ... bigger JSON object ... } }
edited - to correct typo in module link
In reply to Test failing during CPAN Testing by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |