vcatalano / py-authorize

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

The method of "refund" needs expirationDate #44

Closed kilanoff closed 8 years ago

kilanoff commented 9 years ago

https://developer.authorize.net/api/reference/index.html#payment-transactions-refund-a-transaction

vcatalano commented 9 years ago

Could you add a unit test for this as well?

vcatalano commented 8 years ago

Looking at the documentation, the rules for issuing a refund are as follows:

When issuing a credit card refund, the request must include either a full card number and expiration, or previous transID and last 4 digits of the card number. If you don't have the last 4 digits, you can use getTransactionDetails to get the payment object needed to issue a refund.

I think the last 4 digits and transID should be sufficient. Also, the transID (rather, refTransId) field is required as part of the refund transaction so I'm not sure passing the full card number and expiration date is ever really needed.