Skip to content

Commit 0134f4d

Browse files
committed
+ sample code for credit-bank-account
1 parent 1c4acf5 commit 0134f4d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from authorizenet import apicontractsv1
2+
from authorizenet.apicontrollers import *
3+
from decimal import *
4+
from authorizenet.apicontractsv1 import bankAccountType, accountTypeEnum
5+
6+
merchantAuth = apicontractsv1.merchantAuthenticationType()
7+
merchantAuth.name = '5KP3u95bQpv'
8+
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'
9+
10+
11+
payment = apicontractsv1.paymentType()
12+
13+
bankAccountType = apicontractsv1.bankAccountType()
14+
accountType = apicontractsv1.bankAccountTypeEnum
15+
bankAccountType.accountType = accountType.checking
16+
bankAccountType.routingNumber = "125000024"
17+
bankAccountType.accountNumber = "12345678"
18+
bankAccountType.nameOnAccount = "John Doe"
19+
20+
transactionrequest = apicontractsv1.transactionRequestType()
21+
transactionrequest.transactionType = "refundTransaction"
22+
transactionrequest.amount = Decimal ('2.55')
23+
transactionrequest.payment = payment
24+
transactionrequest.payment.bankAccount = bankAccountType
25+
26+
27+
createtransactionrequest = apicontractsv1.createTransactionRequest()
28+
createtransactionrequest.merchantAuthentication = merchantAuth
29+
createtransactionrequest.refId = "MerchantID-0001"
30+
31+
createtransactionrequest.transactionRequest = transactionrequest
32+
createtransactioncontroller = createTransactionController(createtransactionrequest)
33+
createtransactioncontroller.execute()
34+
35+
response = createtransactioncontroller.getresponse()
36+
37+
if (response.messages.resultCode=="Ok"):
38+
print "Transaction ID : %s" % response.transactionResponse.transId
39+
print response.transactionResponse.messages.message[0].description
40+
else:
41+
print "response code: %s" % response.messages.resultCode
42+
print response.messages.message[0].text

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy