Skip to content

Commit 43d41b2

Browse files
author
zhaque
committed
Added following sample codes:
1. ApplePayTransactions/create-an-apple-pay-transaction 2. PaymentTransactions/charge-tokenized-credit-card 3. PaypalExpressCheckout/authorization-and-capture-continue 4. PaypalExpressCheckout/authorization-and-capture 5. PaypalExpressCheckout/authorization-only-continued 6. PaypalExpressCheckout/authorization-only 7. PaypalExpressCheckout/credit 8. PaypalExpressCheckout/get-details 9. PaypalExpressCheckout/prior-authorization-capture 10. PaypalExpressCheckout/void.py 11. RecurringBilling/cancel-subscription 12. RecurringBilling/get-list-of-subscription.py 13. RecurringBilling/update-subscription.py Signed off : Zeeshanul Haque <[email protected]>
1 parent 31cbe3f commit 43d41b2

13 files changed

Lines changed: 495 additions & 0 deletions
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
opaquedata = apicontractsv1.opaqueDataType()
10+
opaquedata.dataDescriptor = "COMMON.APPLE.INAPP.PAYMENT"
11+
opaquedata.dataValue = "eyJkYXRhIjoiQkRQTldTdE1tR2V3UVVXR2c0bzdFXC9qKzFjcTFUNzhxeVU4NGI2N2l0amNZSTh3UFlBT2hzaGpoWlBycWRVcjRYd1BNYmo0emNHTWR5KysxSDJWa1BPWStCT01GMjV1YjE5Y1g0bkN2a1hVVU9UakRsbEIxVGdTcjhKSFp4Z3A5ckNnc1NVZ2JCZ0tmNjBYS3V0WGY2YWpcL284WkliS25yS1E4U2gwb3VMQUtsb1VNbit2UHU0K0E3V0tycXJhdXo5SnZPUXA2dmhJcStIS2pVY1VOQ0lUUHlGaG1PRXRxK0grdzB2UmExQ0U2V2hGQk5uQ0hxenpXS2NrQlwvMG5xTFpSVFliRjBwK3Z5Qml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hNQVlRQXVBR01BYndCdGdoQmNsK1BmMytVNHBrMTNuVkQ5bndRUU1Ba0dCU3NPQXdJZEJRQURnWUVBYlVLWUNrdUlLUzlRUTJtRmNNWVJFSW0ybCtYZzhcL0pYditHQlZRSmtPS29zY1k0aU5ERkFcL2JRbG9nZjlMTFU4NFRId05SbnN2VjNQcnY3UlRZODFncTBkdEM4elljQWFBa0NISUkzeXFNbko0QU91NkVPVzlrSmsyMzJnU0U3V2xDdEhiZkxTS2Z1U2dRWDhLWFFZdVpMazJScjYzTjhBcFhzWHdCTDNjSjB4Z2VBd2dkMENBUUV3T3pBbk1TVXdJd1lEVlFRREhod0FZd0JvQUcwQVlRQnBBRUFBZGdCcEFITUFZUUF1QUdNQWJ3QnRBaEJjbCtQZjMrVTRwazEzblZEOW53UVFNQWtHQlNzT0F3SWFCUUF3RFFZSktvWklodmNOQVFFQkJRQUVnWUJhSzNFbE9zdGJIOFdvb3NlREFCZitKZ1wvMTI5SmNJYXdtN2M2VnhuN1phc05iQXEzdEF0OFB0eSt1UUNnc3NYcVprTEE3a3oyR3pNb2xOdHY5d1ltdTlVandhcjFQSFlTK0JcL29Hbm96NTkxd2phZ1hXUnowbk1vNXkzTzFLelgwZDhDUkhBVmE4OFNyVjFhNUpJaVJldjNvU3RJcXd2NXh1WmxkYWc2VHI4dz09In0="
12+
13+
paymentOne = apicontractsv1.paymentType()
14+
paymentOne.opaqueData = opaquedata
15+
16+
transactionrequest = apicontractsv1.transactionRequestType()
17+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureTransaction
18+
transactionrequest.amount = Decimal('151')
19+
transactionrequest.payment = paymentOne
20+
21+
request = apicontractsv1.createTransactionRequest()
22+
request.merchantAuthentication = merchantAuth
23+
request.refId = "Sample"
24+
request.transactionRequest = transactionrequest
25+
26+
controller = createTransactionController(request)
27+
controller.execute()
28+
29+
response = controller.getresponse()
30+
31+
if (response.messages.resultCode=="Ok"):
32+
print "SUCCESS"
33+
print "Message Code : %s" % response.messages.message[0].code
34+
print "Message text : %s" % response.messages.message[0].text
35+
print "AUTH Code : %s" % response.authCode
36+
print "Transaction ID : %s" % response.transId
37+
else:
38+
print "ERROR"
39+
print "Message Code : %s" % response.messages.message[0].code
40+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
creditCard = apicontractsv1.creditCardType()
10+
creditCard.cardNumber = "4111111111111111"
11+
creditCard.expirationDate = "2020-12"
12+
creditCard.cryptogram = "EjRWeJASNFZ4kBI0VniQEjRWeJA="
13+
14+
payment = apicontractsv1.paymentType()
15+
payment.creditCard = creditCard
16+
17+
transactionrequest = apicontractsv1.transactionRequestType()
18+
transactionrequest.transactionType = "authCaptureTransaction"
19+
transactionrequest.amount = Decimal ('1.5')
20+
transactionrequest.payment = payment
21+
22+
createtransactionrequest = apicontractsv1.createTransactionRequest()
23+
createtransactionrequest.merchantAuthentication = merchantAuth
24+
createtransactionrequest.refId = "MerchantID-0001"
25+
createtransactionrequest.transactionRequest = transactionrequest
26+
27+
createtransactioncontroller = createTransactionController(createtransactionrequest)
28+
createtransactioncontroller.execute()
29+
30+
response = createtransactioncontroller.getresponse()
31+
32+
if (response.messages.resultCode=="Ok"):
33+
print "SUCCESS"
34+
print "Message Code : %s" % response.messages.message[0].code
35+
print "Message text : %s" % response.messages.message[0].text
36+
print "Transaction ID : %s" % response.transactionResponse.transId
37+
else:
38+
print "ERROR"
39+
print "Message Code : %s" % response.messages.message[0].code
40+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
paypal = apicontractsv1.payPalType()
10+
paypal.payerID = "LM6NCLZ5RAKBY"
11+
12+
payment = apicontractsv1.paymentType()
13+
payment.payPal = paypal
14+
15+
transactionrequest = apicontractsv1.transactionRequestType()
16+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureContinueTransaction
17+
transactionrequest.refTransId = "2245589256"
18+
transactionrequest.payment = payment
19+
20+
request = apicontractsv1.createTransactionRequest()
21+
request.merchantAuthentication = merchantAuth
22+
request.refId = "Sample"
23+
request.transactionRequest = transactionrequest
24+
25+
controller = createTransactionController(request)
26+
controller.execute()
27+
28+
response = controller.getresponse()
29+
30+
if (response.messages.resultCode=="Ok"):
31+
print "SUCCESS"
32+
print "Message Code : %s" % response.messages.message[0].code
33+
print "Message text : %s" % response.messages.message[0].text
34+
if (response.transactionResponse.responseCode == "1" ):
35+
print "Description : %s " % response.transactionResponse.messages.message[0].description
36+
print "Payer Id : %s " % response.transactionResponse.secureAcceptance.PayerID
37+
print "Transaction ID : %s " % response.transactionResponse.transId
38+
else:
39+
print "ERROR"
40+
print "Message Code : %s" % response.messages.message[0].code
41+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
paypal = apicontractsv1.payPalType()
10+
paypal.successUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
11+
paypal.cancelUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
12+
13+
payment = apicontractsv1.paymentType()
14+
payment.payPal = paypal
15+
16+
transactionrequest = apicontractsv1.transactionRequestType()
17+
transactionrequest.amount = Decimal('50.00')
18+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureTransaction
19+
transactionrequest.payment = payment
20+
21+
request = apicontractsv1.createTransactionRequest()
22+
request.merchantAuthentication = merchantAuth
23+
request.refId = "Sample"
24+
request.transactionRequest = transactionrequest
25+
26+
controller = createTransactionController(request)
27+
controller.execute()
28+
29+
response = controller.getresponse()
30+
31+
if (response.messages.resultCode=="Ok"):
32+
print "SUCCESS"
33+
print "Message Code : %s" % response.messages.message[0].code
34+
print "Message text : %s" % response.messages.message[0].text
35+
print "Secure acceptance URL : %s " % response.transactionResponse.secureAcceptance.SecureAcceptanceUrl
36+
print "Transaction ID : %s " % response.transactionResponse.transId
37+
else:
38+
print "ERROR"
39+
print "Message Code : %s" % response.messages.message[0].code
40+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
paypal = apicontractsv1.payPalType()
10+
paypal.successUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
11+
paypal.cancelUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
12+
paypal.payerID = "LM6NCLZ5RAKBY"
13+
14+
payment = apicontractsv1.paymentType()
15+
payment.payPal = paypal
16+
17+
transactionrequest = apicontractsv1.transactionRequestType()
18+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyContinueTransaction
19+
transactionrequest.refTransId = "2245592542"
20+
transactionrequest.payment = payment
21+
22+
request = apicontractsv1.createTransactionRequest()
23+
request.merchantAuthentication = merchantAuth
24+
request.refId = "Sample"
25+
request.transactionRequest = transactionrequest
26+
27+
controller = createTransactionController(request)
28+
controller.execute()
29+
30+
response = controller.getresponse()
31+
32+
if (response.messages.resultCode=="Ok"):
33+
print "SUCCESS"
34+
print "Message Code : %s" % response.messages.message[0].code
35+
print "Message text : %s" % response.messages.message[0].text
36+
if (response.transactionResponse.responseCode == "1" ):
37+
print "Description : %s " % response.transactionResponse.messages.message[0].description
38+
print "Payer Id : %s " % response.transactionResponse.secureAcceptance.PayerID
39+
print "Transaction ID : %s " % response.transactionResponse.transId
40+
else:
41+
print "ERROR"
42+
print "Message Code : %s" % response.messages.message[0].code
43+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
paypal = apicontractsv1.payPalType()
10+
paypal.successUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
11+
paypal.cancelUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
12+
13+
payment = apicontractsv1.paymentType()
14+
payment.payPal = paypal
15+
16+
transactionrequest = apicontractsv1.transactionRequestType()
17+
transactionrequest.amount = Decimal('55.00')
18+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyTransaction
19+
transactionrequest.payment = payment
20+
21+
request = apicontractsv1.createTransactionRequest()
22+
request.merchantAuthentication = merchantAuth
23+
request.refId = "Sample"
24+
request.transactionRequest = transactionrequest
25+
26+
controller = createTransactionController(request)
27+
controller.execute()
28+
29+
response = controller.getresponse()
30+
31+
if (response.messages.resultCode=="Ok"):
32+
print "SUCCESS"
33+
print "Message Code : %s" % response.messages.message[0].code
34+
print "Message text : %s" % response.messages.message[0].text
35+
print "Secure acceptance URL : %s " % response.transactionResponse.secureAcceptance.SecureAcceptanceUrl
36+
print "Transaction ID : %s " % response.transactionResponse.transId
37+
else:
38+
print "ERROR"
39+
print "Message Code : %s" % response.messages.message[0].code
40+
print "Message text : %s" % response.messages.message[0].text

PaypalExpressCheckout/credit.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
paypal = apicontractsv1.payPalType()
10+
11+
payment = apicontractsv1.paymentType()
12+
payment.payPal = paypal
13+
14+
transactionrequest = apicontractsv1.transactionRequestType()
15+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.refundTransaction
16+
transactionrequest.refTransId = "2241762126"
17+
transactionrequest.payment = payment
18+
19+
request = apicontractsv1.createTransactionRequest()
20+
request.merchantAuthentication = merchantAuth
21+
request.refId = "Sample"
22+
request.transactionRequest = transactionrequest
23+
24+
controller = createTransactionController(request)
25+
controller.execute()
26+
27+
response = controller.getresponse()
28+
29+
if (response.messages.resultCode=="Ok"):
30+
print "SUCCESS"
31+
print "Message Code : %s" % response.messages.message[0].code
32+
print "Message text : %s" % response.messages.message[0].text
33+
if (response.transactionResponse.responseCode == "1" ):
34+
print "Transaction ID : %s " % response.transactionResponse.transId
35+
print "Description : %s " % response.transactionResponse.messages.message[0].description
36+
else:
37+
print "ERROR"
38+
print "Message Code : %s" % response.messages.message[0].code
39+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
transactionrequest = apicontractsv1.transactionRequestType()
10+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.getDetailsTransaction
11+
transactionrequest.refTransId = "2245592542"
12+
13+
request = apicontractsv1.createTransactionRequest()
14+
request.merchantAuthentication = merchantAuth
15+
request.refId = "Sample"
16+
request.transactionRequest = transactionrequest
17+
18+
controller = createTransactionController(request)
19+
controller.execute()
20+
21+
response = controller.getresponse()
22+
23+
if (response.messages.resultCode=="Ok"):
24+
print "SUCCESS"
25+
print "Message Code : %s" % response.messages.message[0].code
26+
print "Message text : %s" % response.messages.message[0].text
27+
if (response.transactionResponse.responseCode == "1" ):
28+
print "Payer Id : %s " % response.transactionResponse.secureAcceptance.PayerID
29+
print "Transaction ID : %s " % response.transactionResponse.transId
30+
else:
31+
print "ERROR"
32+
print "Message Code : %s" % response.messages.message[0].code
33+
print "Message text : %s" % response.messages.message[0].text
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
paypal = apicontractsv1.payPalType()
10+
paypal.successUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
11+
paypal.cancelUrl = "http://www.merchanteCommerceSite.com/Success/TC25262"
12+
paypal.payerID = "LM6NCLZ5RAKBY"
13+
14+
payment = apicontractsv1.paymentType()
15+
payment.payPal = paypal
16+
17+
transactionrequest = apicontractsv1.transactionRequestType()
18+
transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.priorAuthCaptureTransaction
19+
transactionrequest.refTransId = "2245591700"
20+
transactionrequest.payment = payment
21+
22+
request = apicontractsv1.createTransactionRequest()
23+
request.merchantAuthentication = merchantAuth
24+
request.refId = "Sample"
25+
request.transactionRequest = transactionrequest
26+
27+
controller = createTransactionController(request)
28+
controller.execute()
29+
30+
response = controller.getresponse()
31+
32+
if (response.messages.resultCode=="Ok"):
33+
print "SUCCESS"
34+
print "Message Code : %s" % response.messages.message[0].code
35+
print "Message text : %s" % response.messages.message[0].text
36+
print "Auth code : %s " % response.transactionResponse.authCode
37+
if (response.transactionResponse.responseCode == "1" ):
38+
print "Description : %s " % response.transactionResponse.messages.message[0].description
39+
print "Transaction ID : %s " % response.transactionResponse.transId
40+
else:
41+
print "ERROR"
42+
print "Message Code : %s" % response.messages.message[0].code
43+
print "Message text : %s" % response.messages.message[0].text

0 commit comments

Comments
 (0)