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

Fix class name for Payment in allocation_spec #130

Closed
wants to merge 1 commit into from

Conversation

wsmoak
Copy link
Contributor

@wsmoak wsmoak commented May 27, 2016

This test is failing on master: https://travis-ci.org/chargify/chargify_api_ares/jobs/128883049

Examining the response, this should be Chargify::Payment not Chargify::Allocation::Payment

[#<Chargify::Allocation:0x007f944d267d28 @attributes={"component_id"=>456, "subscription_id"=>123, "quantity"=>1, "previous_quantity"=>0, "memo"=>"test", "timestamp"=>"2016-05-27 11:45:08 -0400", "proration_upgrade_scheme"=>"prorate-attempt-capture", "proration_downgrade_scheme"=>"no-prorate", "payment"=>#<Chargify::Payment:0x007f944d266e50 @attributes={"amount_in_cents"=>2000, "success"=>true, "memo"=>"Payment for: Prorated component allocation", "id"=>123}, @prefix_options={}, @persisted=false>}, @prefix_options={}, @persisted=true>]

@wsmoak
Copy link
Contributor Author

wsmoak commented May 27, 2016

This appears to have passed when the original PR for the bulk allocations feature was submitted:
https://travis-ci.org/chargify/chargify_api_ares/builds/98413226

@wsmoak
Copy link
Contributor Author

wsmoak commented May 27, 2016

Closing. This is not a correct change.

A Chargify::Payment is an external payment, which records something that happened outside Chargify, like receiving a paper check in the mail. See: https://docs.chargify.com/api-payments

This test broke when that resource was introduced in #128 .

The 'Payment' within an 'Allocation' is actually a Chargify::Transaction of type payment. See: https://docs.chargify.com/api-transactions

I am not sure how to get ActiveResource to use the correct class when building up the Allocation object.

@wsmoak wsmoak closed this May 27, 2016
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.

1 participant