|
| 1 | +from authorizenet import apicontractsv1 |
| 2 | +from authorizenet.apicontrollers import * |
| 3 | +from decimal import * |
| 4 | + |
| 5 | +merchantAuth = apicontractsv1.merchantAuthenticationType() |
| 6 | +merchantAuth.name = '5KP3u95bQpv' |
| 7 | +merchantAuth.transactionKey = '4Ktq966gC55GAX7S' |
| 8 | + |
| 9 | +unsettledTransactionListRequest = apicontractsv1.getUnsettledTransactionListRequest() |
| 10 | +unsettledTransactionListRequest.merchantAuthentication = merchantAuth |
| 11 | + |
| 12 | +unsettledTransactionListController = getUnsettledTransactionListController(unsettledTransactionListRequest) |
| 13 | + |
| 14 | +unsettledTransactionListController.execute() |
| 15 | + |
| 16 | +unsettledTransactionListResponse = unsettledTransactionListController.getresponse() |
| 17 | + |
| 18 | +if unsettledTransactionListResponse is not None: |
| 19 | + if unsettledTransactionListResponse.messages.resultCode == apicontractsv1.messageTypeEnum.Ok: |
| 20 | + print('Successfully got unsettled transaction list!') |
| 21 | + |
| 22 | + for transaction in unsettledTransactionListResponse.transactions.transaction: |
| 23 | + print('Transaction Id : %s' % transaction.transId) |
| 24 | + print('Transaction Status : %s' % transaction.transactionStatus) |
| 25 | + print('Amount Type : %s' % transaction.accountType) |
| 26 | + print('Settle Amount : %s' % transaction.settleAmount) |
| 27 | + |
| 28 | + if unsettledTransactionListResponse.messages: |
| 29 | + print('Message Code : %s' % unsettledTransactionListResponse.messages.message[0].code) |
| 30 | + print('Message Text : %s' % unsettledTransactionListResponse.messages.message[0].text) |
| 31 | + else: |
| 32 | + if unsettledTransactionListResponse.messages: |
| 33 | + print('Failed to get unsettled transaction list.\nCode:%s \nText:%s' % (unsettledTransactionListResponse.messages.message[0].code,unsettledTransactionListResponse.messages.message[0].text)) |
0 commit comments