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
Reporting API is not returning SubscriptionID field for transaction via this gem #39
Comments
I have a workaround to query get_transaction_details(tran.id) for each transaction (99% of which do NOT have subscriptions) but that's pretty stupid. Here is the response from http://developer.authorize.net/api/reference/#transaction-reporting-get-transaction-list, you can see that subscription is returned. Why doesn't the gem return it?
|
Hi @dmitrypol, You are quite correct and the transaction list should have the properties set. The fix is quite simple, I have tested it locally but not had a chance to commit anything to github yet. The following should be added after line 54 in https://github.com/AuthorizeNet/sdk-ruby/blob/master/lib/authorize_net/reporting/response.rb subscription = child.at_css('subscription')
unless subscription.nil?
subscription_id = node_content_unless_nil(child.at_css('subscription').at_css('id'))
transaction.subscription_id = subscription_id unless subscription_id.nil?
pay_num = node_content_unless_nil(child.at_css('subscription').at_css('payNum'))
transaction.subscription_paynum = pay_num unless pay_num.nil?
end |
See rspec & change on future branch here : 4e2a00f |
I'm closing this one as we're close to releasing the fix. Thanks again for the issue. |
Reporting API is not returning SubscriptionID field for transaction per http://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/ARB-Subscription-IDs-Available-Through-Transaction-Details-API/ba-p/40602.
I have a sandbox subscription ID 2343517. On March 18th, it charged $10 https://sandbox.authorize.net/UI/themes/sandbox/ARB/TransactionList.aspx?SubscrID=2343517
Here is what API returns:
{"id":"2230382467","submitted_at":"2015-03-18T09:45:10.000+00:00","status":"settledSuccessfully","account_type":"Visa","account_number":"XXXX4242","settle_amount":"10.0","customer":{"first_name":"Tanya","last_name":"Rowe"}}
Here is my code snippet:
t1 = AuthorizeNet::Reporting::Transaction.new ...
response1 = t1.get_settled_batch_list(dates here)
if response1.success?
response1.batch_list.each do |batch|
t2 = AuthorizeNet::Reporting::Transaction.new ...
response2 = t2.get_transaction_list(batch.id)
if response2.success?
transactions = response2.transactions
transactions.each do |t|
The text was updated successfully, but these errors were encountered: