def decrypt_visa_checkout_data():
	merchantAuth = apicontractsv1.merchantAuthenticationType()
	merchantAuth.name = constants.apiLoginId
	merchantAuth.transactionKey = constants.transactionKey
	# Populate the payment data
	opaqueData = apicontractsv1.opaqueDataType()
	opaqueData.dataDescriptor = "COMMON.VCO.ONLINE.PAYMENT"
	opaqueData.dataValue = "q1rx4GVCh0dqjZGgSBI8RB/VlI/1lwzTxDnrW/L1D4f/lfKZeQPo34eTB59akZXdRlRBW/dHVWgc2eVebvWpkAKmDrc+7Zr7lGXvHbLG78e0ZgfEReQNS4es6K7DxsDXp0UZSdnxw6g3stQhW2TqR6fcwLj7gWpZvAL3GAftP6QNCJfv6ohFPN9L/t84A1h8M0jClNq7DtDsUhuy35dEBdP8/MKOb7hSRkMqb/8qh7XUR+84FOoAKHAcG6KoRRdogTrYmPBuyDoaWUmDFgRFSSXN7Wj7evVsliis5H9y+tub/f5mAiZtl+fyFC7uIEZOLUcSWHfeX1lWxyWTEYxRq5TwnzewPNn0VbmqPh+/uaHooDQT891nUeZfm79Bunj+NfWtr06YIxW2LW3P6IWuyAhquAseL1hOv7vHT5QGogPuUJlv/+jY52tSsXrVccWu4rTjHShwvFmvxl82VZx55zcIrYFROiFVw+3sN88BL4hNnh3RCYrotWDiAwdJmJLdYhAzO2xiWLRRBgiGn27hi+G381EwLUy/6K1rx6iAN+x2bWWHgyKddSYLo0U7g+UfHBrvNSHZQcQM5LzjiZP86bx2SqQoLrqgSZQcChSy/T6C4vIvlFyomx9+7Soht6J61KoRvhM1yzlvwwjyF0ouamCRUBzrKR6j366TbdrAhAVLfuVc2XbE57Wc9bF0w4+K5I4kfA47XfRHlkA+6S4dpgp+fV+bC/jzrqIQwrs+wehzEaiR43lBQpyfPElX2SGfGk0WH4c4SbIhUY0KtyLmfgCbcAHyCAXN1ZNQvNb8Axw2j/C2B77cE81Dsi9DyGdGclM2u14UqxkXEINS2FoYQI4mZj04TR4oDG6axkp52d+ndagOS0kIH8SM71fPPiXSGw/zbm+JRdr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VghQfx9PD/T+XZTA3yzBwHHZNiNJK2mhheEubgNYcnw1t9Lf9cx174OEayQrU+AORjPnEPGWYx+bYtK6XuQ9bt9gAo4HzaGRF1WB6Dr0p8gfqrxHe9HhjrbeHILmVtIJnv2jDds20pR/VRYs1IFJNWyDjgCe2uWBM+oC22YdSYyn3f2swouqqXz6yl9UTImzCM8KAzLpPGZVFlafJka8soKSxr9KBvAsBnfb34RPB7OMgSo+uqgvB3YGvOu5LpLoaVNxQ1d6GLeeQ9u9olb12Y2kPzGni99f04lI77qoleqzCcCFZC9Q"
	opaqueData.dataKey = "KCSJeIab7wwH7mFcPM/YL+V9xBCDe4CmSjJ0MPHEodpWz4rmz78U8bR4Qqs1ipLBqH9mrfvLF4pytIcLOjKUtXvAII/xCze84INFMdtsVBgtEp5bZ4leehRQhNM+3/NH"
	# Initialize decrypt request
	request = apicontractsv1.decryptPaymentDataRequest()
	request.merchantAuthentication = merchantAuth
	request.opaqueData = opaqueData
	request.callId = "1238408836021304101"
	# Execute API request
	controller = decryptPaymentDataController(request)
	controller.execute()
	response = controller.getresponse()

	if (response.messages.resultCode=="Ok"):
		print "SUCCESS"
		print "Message Code : %s" % response.messages.message[0].code
		print "Message text : %s" % response.messages.message[0].text
		print "Card number : %s" % response.cardInfo.cardNumber
		print "Amount : %s" % response.paymentDetails.amount
	else:
		print "ERROR"
		print "Message Code : %s" % response.messages.message[0].code
		print "Message text : %s" % response.messages.message[0].text

	return response
Esempio n. 2
0
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import *

merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = '5KP3u95bQpv'
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'
# Populate the payment data
opaqueData = apicontractsv1.opaqueDataType()
opaqueData.dataDescriptor = "COMMON.VCO.ONLINE.PAYMENT"
opaqueData.dataValue = "q1rx4GVCh0dqjZGgSBI8RB/VlI/1lwzTxDnrW/L1D4f/lfKZeQPo34eTB59akZXdRlRBW/dHVWgc2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1d6GLeeQ9u9olb12Y2kPzGni99f04lI77qoleqzCcCFZC9Q"
opaqueData.dataKey = "KCSJeIab7wwH7mFcPM/YL+V9xBCDe4CmSjJ0MPHEodpWz4rmz78U8bR4Qqs1ipLBqH9mrfvLF4pytIcLOjKUtXvAII/xCze84INFMdtsVBgtEp5bZ4leehRQhNM+3/NH"
# Initialize decrypt request
request = apicontractsv1.decryptPaymentDataRequest()
request.merchantAuthentication = merchantAuth
request.opaqueData = opaqueData
request.callId = "1238408836021304101"
# Execute API request
controller = decryptPaymentDataController(request)
controller.execute()
response = controller.getresponse()

if (response.messages.resultCode=="Ok"):
	print "SUCCESS"
	print "Message Code : %s" % response.messages.message[0].code
	print "Message text : %s" % response.messages.message[0].text
	print "Card number : %s" % response.cardInfo.cardNumber
	print "Amount : %s" % response.paymentDetails.amount
else:
	print "ERROR"
	print "Message Code : %s" % response.messages.message[0].code
	print "Message text : %s" % response.messages.message[0].text