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

Get the type of an adjustment #245

Closed
ronlobo opened this issue Jun 29, 2016 · 6 comments · Fixed by #299
Closed

Get the type of an adjustment #245

ronlobo opened this issue Jun 29, 2016 · 6 comments · Fixed by #299
Labels
V2 V2 Client

Comments

@ronlobo
Copy link

ronlobo commented Jun 29, 2016

Hey there,

I wasn't able to figure out how the get the type of a Recurly_Adjustment, if it is either a 'charge' or 'refund'

Is there a way to find that out on a valid Recurly_Adjustment instance?

Thanks!

@bhelx
Copy link
Contributor

bhelx commented Jun 29, 2016

I think you should be able to do:

$adjustment->type;

Is this not the case?

@drewish
Copy link

drewish commented Jun 29, 2016

I think this is the same underlying issue as #210

@ronlobo
Copy link
Author

ronlobo commented Jun 29, 2016

Thanks for the quick reply, it's the same issue as #210

@ronlobo
Copy link
Author

ronlobo commented Jun 29, 2016

I guess for now we could just look at if unit_amount_in_cents is negative or positive to figure out if it is a 'charge' or 'refund', what do you think?

@bobalbert
Copy link

I have the same request. I'm previewing a subscription if it were to be given a partial refund so i can show the prorated amount. In my case, Recurly folks said that the credit "type" will always have "Credit for remaining..." at the start of the description.

That is what i'm keying off. Not great, but it is working. Would be best if I could get the type directly.

Does the XML parse code just need to be updated to add that attribute for adjustment node?

bhelx added a commit that referenced this issue Jan 19, 2017
Resolves #210
Resolves #245

This adds a method `getType` on every resource object which returns the
xml attribute `type`. This can currently be found on Adjustments,
Transactions, and BillingInfos.
bhelx added a commit that referenced this issue Jan 19, 2017
Resolves #210
Resolves #245

This adds a method `getType` on every resource object which returns the
xml attribute `type`. This can currently be found on Adjustments,
Transactions, and BillingInfos.
@bhelx
Copy link
Contributor

bhelx commented Jan 19, 2017

@bobalbert @ronlobo See PR #299

This will go out in the next release

@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants