def testrefund(self): transactions.refund('12345', 'Balance', 10.50, a='parameter', alternate_token='AN OAUTH TOKEN', dwollaparse='dwolla') transactions.r._post.assert_any_call( '/transactions/refund', { 'fundsSource': 'Balance', 'a': 'parameter', 'pin': 1234, 'amount': 10.5, 'transactionId': '12345' }, { 'alternate_token': 'AN OAUTH TOKEN', 'dwollaparse': 'dwolla' })
def dwolla_refund(order, event, payment_id, amount, pin): """ Returns id of refund transaction. """ dwolla_prep(event.api_type) access_token = dwolla_get_token(event.organization, event.api_type) return transactions.refund( tid=int(payment_id), fundingsource="Balance", amount="%.2f" % amount, alternate_token=access_token, alternate_pin=int(pin), params={"notes": "Order {} for {}".format(order.code, event.name)}, )
def dwolla_refund(order, event, payment_id, amount, pin): """ Returns id of refund transaction. """ org_account = event.organization.get_dwolla_account(event.api_type) dwolla_prep(event.api_type) access_token = org_account.get_token() return transactions.refund( tid=int(payment_id), fundingsource="Balance", amount="%.2f" % amount, alternate_token=access_token, alternate_pin=int(pin), params={ 'notes': "Order {} for {}".format(order.code, event.name), }, )
# "Image": "https://dwolla-avatars.s3.amazonaws.com/812-202-3784/ac045522" # }, # "ClearingDate": "", # "Status": "cancelled", # "Notes": "", # "Fees": null, # "OriginalTransactionId": null, # "Metadata": null # }, # ... # ] # Example 3: Refund $2 from "Balance" from transaction # '123456' print transactions.refund('3452346', 'Balance', 2.00) # Return: # { # "TransactionId": 4532, # "RefundDate": "2014-12-10T12:01:09Z", # "Amount": 2.00 # } # Example 4: Get info for transaction ID '123456'. print transactions.info('113533') # Return: # { # "Id": 113533, # "Amount": 5.50,
def testrefund(self): transactions.refund('12345', 'Balance', 10.50, a='parameter', alternate_token='AN OAUTH TOKEN', dwollaparse='dwolla') transactions.r._post.assert_any_call('/transactions/refund', {'fundsSource': 'Balance', 'a': 'parameter', 'pin': 1234, 'amount': 10.5, 'transactionId': '12345'}, {'alternate_token':'AN OAUTH TOKEN', 'dwollaparse':'dwolla'})
def testrefund(self): transactions.refund('12345', 'Balance', 10.50, {'a': 'parameter'}) transactions.r._post.assert_any_call('/transactions/refund/', {'fundsSource': 'Balance', 'a': 'parameter', 'pin': 1234, 'amount': 10.5, 'oauth_token': 'AN OAUTH TOKEN', 'transactionId': '12345'})
# "Image": "https://dwolla-avatars.s3.amazonaws.com/812-202-3784/ac045522" # }, # "ClearingDate": "", # "Status": "cancelled", # "Notes": "", # "Fees": null, # "OriginalTransactionId": null, # "Metadata": null # }, # ... # ] # Example 3: Refund $2 from "Balance" from transaction # '123456' print(transactions.refund('3452346', 'Balance', 2.00)) # Return: # { # "TransactionId": 4532, # "RefundDate": "2014-12-10T12:01:09Z", # "Amount": 2.00 # } # Example 4: Get info for transaction ID '123456'. print(transactions.info('113533')) # Return: # { # "Id": 113533, # "Amount": 5.50, # "Date": "2014-12-13T05:07:15Z",