Closed ITDevMohsin closed 6 years ago
Hi @ITDevMohsin,
First off, as far as validation mode goes, you can specify it two ways. When you call the "new" method on CreateCustomerProfileRequest, you can just pass in "liveMode" as a parameter in the right spot, like this:
request = AuthorizeNet::API::CreateCustomerProfileRequest.new(nil,nil,nil, 'liveMode')
Alternatively, you can call the setter method like this:
request = AuthorizeNet::API::CreateCustomerProfileRequest.new
request.validationMode = ValidationModeEnum::liveMode
Note that when you use "liveMode", you must provide an address for the transaction.
With regards to the other issues, I noticed the sample code we provided wasn't that clear. I updated the sample code for create-customer-profile to show more info and construct the request in such a way that it's clearer what it's doing. Please check that out and see if that helps you any. If you have any other questions, please feel free to post them here.
I am try to use create customer code in my ruby on rails project but for some reasons its giving me strange error.
My another requirement is to validate credit card by putting
validation_mode: 'liveMode'
but can't figure out where to put it as I do not want to create customer if he will give false credit card.I am using gem
authorizenet
in my Gem File.Gem File:
Gemfile.lock
Code:
Error:
The element 'paymentProfiles' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' cannot contain text. List of possible elements expected: 'customerType, billTo, payment, driversLicense, taxId, defaultPaymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. Failed to create a new customer profile.
Full Trace: