File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os , sys
2+ import imp
3+ import random
4+
5+ from authorizenet import apicontractsv1
6+ from authorizenet .apicontrollers import *
7+ constants = imp .load_source ('modulename' , 'constants.py' )
8+ from decimal import *
9+
10+ def get_merchant_details ():
11+ merchantAuth = apicontractsv1 .merchantAuthenticationType ()
12+ merchantAuth .name = constants .apiLoginId
13+ merchantAuth .transactionKey = constants .transactionKey
14+
15+ getMerchantDetailsRequest = apicontractsv1 .getMerchantDetailsRequest ()
16+ getMerchantDetailsRequest .merchantAuthentication = merchantAuth
17+
18+ controller = getMerchantDetailsController (getMerchantDetailsRequest )
19+ controller .execute ()
20+
21+ response = controller .getresponse ()
22+
23+ if response is not None :
24+ if response .messages .resultCode == "Ok" :
25+ print "Merchant Name: " , response .merchantName
26+ print "Gateway ID: " , response .gatewayId
27+ print "Processors: " ,
28+ for processor in response .processors .processor :
29+ print processor .name , "; " ,
30+ else :
31+ print "Failed Transaction."
32+ else :
33+ print "Null Response."
34+
35+ return response
36+
37+ if (os .path .basename (__file__ ) == os .path .basename (sys .argv [0 ])):
38+ get_merchant_details ()
Original file line number Diff line number Diff line change @@ -51,3 +51,4 @@ get_unsettled_transaction_list 1 0
5151create_visa_checkout_transaction 1 0
5252decrypt_visa_checkout_data 1 0
5353get_customer_profile_ids 1 1
54+ get_merchant_details 0 1
You can’t perform that action at this time.
0 commit comments