Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refund: removed description, added status attr #81

Merged
merged 4 commits into from
May 2, 2017

Conversation

fheyer
Copy link
Contributor

@fheyer fheyer commented Apr 30, 2017

Field description does not exist in Stripe API doc for and field status was missing.
see https://stripe.com/docs/api#refunds for reference

So i just renamed the field.

field description does not exist in Stripe API doc, status was missing
see https://stripe.com/docs/api#refunds for reference
Copy link
Collaborator

@andrewsolomon andrewsolomon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @fheyer! I just want to tread carefully in case people are already calling the description method. Could you change it to:

has 'status'              => (is => 'ro', isa => 'Maybe[Str]');
has 'description'         => (
    is      => 'ro',
    isa     => 'Maybe[Str]',
    default => sub {
        warn "Use of Net::Stripe::Refund->description is deprecated and will be removed in the next Net::Stripe release";
        return;
});

and also add a unit test like:

diff --git a/t/live.t b/t/live.t
index b6c51a4..308b144 100755
--- a/t/live.t
+++ b/t/live.t
@@ -171,6 +171,8 @@ Charges: {
         lives_ok { $refund = $stripe->refund_charge(charge => $charge->id, amount => 1000) }
             'refunding a charge works';
         is $refund->charge, $charge->id, 'returned charge object matches id';
+        isa_ok $refund, 'Net::Stripe::Refund';
+        is $refund->status, 'succeeded', 'status is "succeeded"';
         is $refund->amount, 1000, 'partial refund $10';
         lives_ok { $charge = $stripe->get_charge(charge_id => $charge->id) }
             'Fetching updated charge works';

Thanks!

@fheyer
Copy link
Contributor Author

fheyer commented May 2, 2017

Hello Andrew,

thanks for your advice.
I added a deprecation warning for attribute description - however i declared this attribute lazy to get the warning only if the attribute is accessed.

My branch contains a merge of your master branch - i don't know if this hinders your final merge. If so i can provide a fresh pull request.

Best regards
Florian

@andrewsolomon andrewsolomon merged commit 523cf60 into lukec:master May 2, 2017
@andrewsolomon
Copy link
Collaborator

Thanks @fheyer - it all merged smoothly. Cheers, Andrew

@fheyer fheyer deleted the fix_refund branch May 3, 2017 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants