Can someone explain why the XML generation in the PHP SDK is messing up?
Here's the SDK method call to createCustomerPaymentProfile():
$authNetCusObj = new AuthorizeNetCIM(); $authorizeDotNetResponse = $authNetCusObj->createCustomerPaymentProfile($custProfId, $formattedRequestData);
Here's the PHP array that's being passed into (which the XML is supposed to get generated from):
$formattedRequestData = array( 'billTo' => array( 'firstName' => 'TestKen', 'lastName' => 'TestBraz', 'address' => '123 Testa Trove', 'city' => 'Hahahah', 'state' => 'Utah', 'zip' => '84440' ), 'payment' => array( 'opaqueData' => array( 'dataDescription' => 'COMMON.ACCEPT.INAPP.PAYMENT', 'dataValue' => trim($data['dataNonce']) ) ) );
Here's the (bad) XML that gets generated in the call:
<?xml version="1.0" encoding="utf-8"?> <createCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>Protected</name> <transactionKey>Protected</transactionKey> </merchantAuthentication> <customerProfileId>181</customerProfileId> <paymentProfile> <billTo> <0>TestKen</0> </billTo> <billTo> <0>TestBraz</0> </billTo> <billTo> <0>123 Testa Trove</0> </billTo> <billTo> <0>Test City</0> </billTo> <billTo> <0>Test State</0> </billTo> <billTo> <0>84440</0> </billTo> <payment> <dataDescription>COMMON.ACCEPT.INAPP.PAYMENT</dataDescription> <dataValue>eyJjfMl</dataValue> </payment> </paymentProfile> </createCustomerPaymentProfileRequest>
05-12-2017 02:52 PM
Hello,
The question was asked and answered in another thread. https://community.developer.authorize.net/t5/Integration-and-Testing/Unclear-basic-workflow-document...
Richard
05-15-2017 09:55 AM
No, it wasn't "answered" in the other thread, The question was re-asked, by me, because no one was responding to this one. But it wasn't answered in the other thread either, so ANY help would be wildly appreciated.
05-15-2017 09:57 AM - edited 05-15-2017 09:58 AM
Aaron mentioned that what you are attempting to do with our SDK isn't possible unless you can install composer and it's dependencies. Since that is not possible in your scenario, your other option is to write directly to the API using XML or JSON.
Richard
05-15-2017 10:07 AM
Can you please provide an example of that? That would really be what would help here.
05-15-2017 10:13 AM
Bump. Can you please provide examples?
05-18-2017 07:56 AM
Is there any hope is some follow-up here? Examples of your suggested work-around would be very useful.
05-22-2017 01:11 PM