stripe-perl icon indicating copy to clipboard operation
stripe-perl copied to clipboard

enable debugging options for Carp and Type::Tiny

Open sherrardb opened this issue 4 years ago • 3 comments

i have found these to be very useful during development.

$Carp::Verbose = 1;
$Type::Tiny::DD = 999_999;

and can mean the difference between

Unknown named parameter: card at lib/Net/Stripe.pm line 2289.

and the much more useful

Unknown named parameter: card at lib/Net/Stripe/Resource.pm line 99, <DATA> line 1.
        Net::Stripe::Resource::_form_fields_for_ref("card", HASH(0x6559fc8)) called at lib/Net/Stripe/PaymentMethod.pm line 59
        Net::Stripe::PaymentMethod::card_token(Net::Stripe::PaymentMethod=HASH(0x68f7908)) called at lib/Net/Stripe/PaymentMethod.pm line 64
        Net::Stripe::PaymentMethod::form_fields(Net::Stripe::PaymentMethod=HASH(0x68f7908)) called at lib/Net/Stripe.pm line 2289
        Net::Stripe::_post(Net::Stripe=HASH(0x38b0ea8), "payment_methods", Net::Stripe::PaymentMethod=HASH(0x68f7908)) called at lib/Net/Stripe.pm line 1436
        Net::Stripe::create_payment_method(Net::Stripe=HASH(0x38b0ea8), "type", "card", "card", "tok_1G4uorArgp8DNlGokHCvbSH4") called at t/live.t line 203

i usually just hack them in while i am working, and remove them before commit, but it might be useful to enable them dynamically based on the value of $stripe->debug.

sherrardb avatar Jan 25 '20 20:01 sherrardb