vcatalano / py-authorize

A full-featured Python API for the Authorize.net payment gateway.
MIT License
42 stars 35 forks source link

credit_card or bank_account required for Recurring.update #50

Closed aaronelliotross closed 8 years ago

aaronelliotross commented 8 years ago

Hello,

I ran into a problem with Recurring.update, trying to send an update with only a subscription_id and a change to a billing address field.

This code in authorize/apis/recurring_api.py _make_xml:

    # Payment information
    if 'credit_card' in params:
        subscription.append(create_payment(params['credit_card']))
    else:
        subscription.append(create_payment(params['bank_account']))

requires sending a credit_card or bank_account for updates.

It's trivial to fix for updates (split into two ifs) - but I'm not sure that works for creates. If Authorize returns an error when both or neither are provided, maybe it's best to just let that error happen?

The same problem may exist in authorize/apis/transaction_api.py in _aim_base_request.

I will try to get you a test and a pull request, but have to find a bit of time!

Thanks,

Aaron

aaronelliotross commented 8 years ago

Hi again,

I sent you a pull request with tests!

I'm sorry that I didn't say this before reporting the issue - but thank you for releasing this library! It's already been useful to us for the access to the Transaction API, and I'm hoping to make it our only library for accessing Authorize.NET.

Talk to you soon,

vcatalano commented 8 years ago

Thank you, @aaronelliotross for taking on this issue. I've finally merged in your branch to master so I'm closing out this issue.