04-09-2018 01:31 PM
I'm trying to integrate customer payments via the Authorize.Net .NET SDK. My data flow process is as follows:
When customer converts from free trial to paid subscription mode, I want to:
A. Collect payment information (credit card numbers, addresses, billing names, etc).
B. Via Accept.JS, convert the payment information to a nonce.
C. Use the nonce to charge the customer the first month's subscription rate.
D. Use the success of the charge to determine if I proceed. If successful,
E. Use the transaction ID to create a CIM customer profile, a customer payment profile, and an ARB.
I pass a billTo object of type customerAddressType to the transactionRequestType request object. If I define a first name, last name, or company name on this address, then the call to controller.Executes shows an error that "E00003:The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'firstName' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
Removing the firstName value from my customerAddressType subsequently yields similar errors regarding "lastName" and "company".
If I remove firstName, lastName, and company from my address object, then I'm allowed to successfully create a charge to this card.
However, when I follow it up with a request to CreateCustomerProfileFromTransaction, the created payment profile has no name information associated with it. A quick check in the CIM confirms this.
This presents a problem when I attempt to create the subscription, as the payment profile cannot be used as the billTo address is missing firstName.
Is is possible to create a reusable payment profile from a transaction generated by a nonce/opaqueDataType?
I understand the order of the XML may play a part here, but as I'm using the SDK I have no control over the created XML. Is it even viewable in a log somewhere?
04-09-2018 09:59 PM
One you have the accept nonce and done the payment .
You can still use the accept nonce to create the customer profile by passing it in the
Specifies how the request should be processed.
The value of
String, 128 characters.
04-10-2018 06:23 AM - edited 04-10-2018 06:31 AM
If you change the order of the nodes in the XML, you can generate the same error that I receive in my controller when I call .Execute():
<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>XXXXXXXXXX</name> <transactionKey>XXXXXXXXXXXXXXXX</transactionKey> </merchantAuthentication> <profile> <description>Profile description here</description> <merchantCustomerId>Merchant_Customer_ID</merchantCustomerId> <email>firstname.lastname@example.org</email> </profile> <validationMode>none</validationMode> </createCustomerProfileRequest>
will generate this error:
E00003 : The element 'profile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'merchantCustomerId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'email, paymentProfiles, shipToList' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.
Be aware that I'm using the .NET SDK and therefore have no control over the order of the XML generated by the SDK.