Reply
Member
Posts: 2
Registered: ‎03-31-2016

python, fail to provide payment information for createCustomProfileRequest()

 

I need to validate payment information during createCustomProfileRequest() call, to avoid of doing subseqent requests. In Request specification listed payment and paymentProfiles, but when I try to include one of them to sample code it just silently ignores it. Here is my code below. Please point me what I doing wrong? May be it is simply not realized for python? Thanks.

 

def create_customer_profile():

	merchantAuth = apicontractsv1.merchantAuthenticationType()
	merchantAuth.name = constants.apiLoginId
	merchantAuth.transactionKey = constants.transactionKey


	createCustomerProfile = apicontractsv1.createCustomerProfileRequest()
	createCustomerProfile.merchantAuthentication = merchantAuth
	createCustomerProfile.profile = apicontractsv1.customerProfileType('jdoe' + str(random.randint(0, 10000)), 'John2 Doe', 'jdoe@mail.com')


	creditCard = apicontractsv1.creditCardType()
	creditCard.cardNumber = "4111111111111111"
	creditCard.expirationDate = "2020-12"

	payment = apicontractsv1.paymentType()
	payment.creditCard = creditCard


	createCustomerProfile.payment = payment

	controller = createCustomerProfileController(createCustomerProfile)

	controller.execute()

	response = controller.getresponse()

	if (response.messages.resultCode=="Ok"):
		print "Successfully created a customer profile with id: %s" % response.customerProfileId
	else:
		print "Failed to create customer payment profile %s" % response.messages.message[0].text

	return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
	create_customer_profile()

 

Member
Posts: 2
Registered: ‎03-31-2016

Re: python, fail to provide payment information for createCustomProfileRequest()

I have found mistake, I did place my paymentProfiles to the root createCustomerProfileRequest class

but it needs to be placed to profile element of the root class. Here is working code:

def create_customer_profile():

	merchantAuth = apicontractsv1.merchantAuthenticationType()
	merchantAuth.name = constants.apiLoginId
	merchantAuth.transactionKey = constants.transactionKey


	createCustomerProfile = apicontractsv1.createCustomerProfileRequest()
	createCustomerProfile.merchantAuthentication = merchantAuth
	createCustomerProfile.profile = apicontractsv1.customerProfileType('jdoe' + str(random.randint(0, 10000)), 'John2 Doe', 'jdoe@mail.com')


	creditCard = apicontractsv1.creditCardType()
	creditCard.cardNumber = "4111111111111111"
	creditCard.expirationDate = "2020-12"

	payment = apicontractsv1.paymentType()
	payment.creditCard = creditCard

	billTo = apicontractsv1.customerAddressType()
	billTo.firstName = "John"
	billTo.lastName = "Snow"

	profile = apicontractsv1.customerPaymentProfileType()
	profile.payment = payment
	profile.billTo = billTo

	createCustomerProfile.profile.paymentProfiles = [profile]
	controller = createCustomerProfileController(createCustomerProfile)

	controller.execute()

	response = controller.getresponse()

	if (response.messages.resultCode=="Ok"):
		print "Successfully created a customer profile with id: %s" % response.customerProfileId
	else:
		print "Failed to create customer payment profile %s" % response.messages.message[0].text

	return response

 

 

 

Member
Posts: 4
Registered: ‎03-04-2021

Re: python, fail to provide payment information for createCustomProfileRequest()

If there may be mistakes in fee processing, the mistake message is displayed right above the pay button and the button should be enabled for retry by copy code here.

Member
Posts: 3
Registered: ‎06-23-2021

Re: python, fail to provide payment information for createCustomProfileRequest()

I have the same problem and I don't know where the error is in the code, I'm sure similar codes have been used before and it works fine.

slitherio

Member
Posts: 2
Registered: ‎06-23-2021

Re: python, fail to provide payment information for createCustomProfileRequest()

 This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Keep up the good work - GBWhatsapp and FMWhatsapp

[url=https://gbplusmod.com/download-gbwhatsapp-apk/]GBWhatsApp[/url]
Member
Posts: 2
Registered: ‎07-30-2021

Re: python, fail to provide payment information for createCustomProfileRequest()

here you can download sp flash tool latest version visit here:- sp flash tool

Member
Posts: 3
Registered: ‎06-29-2021

Re: python, fail to provide payment information for createCustomProfileRequest()

Thank you for sharing your thought, Clashmod.

New Member
Posts: 1
Registered: ‎09-12-2021

Re: python, fail to provide payment information for createCustomProfileRequest()

Thank you for sharing this i try my best to solve see the code here Poslaju Tracking for the of more info see the result in rice purity test