I have Authnet PHP code that worked perfectly last time I ran it about 2 years ago on Win7 IIS7.5 PHP. Now I am trying to run it on Windows 8.1 and all I get back is an empty response, every time. Here's the test URL I'm sending to:
https://apitest.authorize.net/xml/v1/request.api
And here is my full XML that I'm sending:
<ARBCreateSubscriptionRequest xmlns= "AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>foo</name>
<transactionKey>bar</transactionKey>
</merchantAuthentication>
<subscription>
<name>TransitPark Monthly Indoor</name>
<paymentSchedule>
<interval>
<length>1</length>
<unit>months</unit>
</interval>
<startDate>2015-06-22</startDate>
<totalOccurrences>9999</totalOccurrences>
<trialOccurrences>1</trialOccurrences>
</paymentSchedule>
<amount>95</amount>
<trialAmount>105</trialAmount>
<payment>
<creditCard>
<cardNumber>4111111111111111</cardNumber>
<expirationDate>2015-5</expirationDate>
<cardCode>123</cardCode>
</creditCard>
</payment>
<order>
<invoiceNumber>5K3TE4UFCY</invoiceNumber>
</order>
<customer>
<email>nate@zerogravpro.com</email>
</customer>
<billTo>
<firstName>Frank</firstName>
<lastName>O'Malley</lastName>
<address>1029 Sunset Ave.</address>
<city>Hollywood</city>
<state>MO</state>
<zip>90210</zip>
</billTo>
</subscription>
</ARBCreateSubscriptionRequest>The name and transkey values have been changed for the post, but I verified they are valid sandbox api keys. Is there something wrong with my XML?
The source code is nothing special, it's straight out of Authnet sample code that I downloaded. Any idea what could be going wrong?
Solved! Go to Solution.
โ06-22-2015 08:46 PM
โ06-27-2015 02:45 PM
One note, the response may not be literally empty, it's hard to tell. Looks like I might be getting this actually:
| error: Error: | |
| Message: | |
โ06-22-2015 08:52 PM
Also don't worry about the expired cc expiration date. I just tried it with non-expired date and got exact same problem. Also tried different cc# from Authnet website.
โ06-22-2015 08:55 PM
Did you check for connection error since they change SSL not too long ago?
โ06-23-2015 04:17 AM
How do I check for connection problems? Authnet is not returning any info to me.
โ06-23-2015 05:29 AM
Hello @ZeroGravPro
We recently upgraded our security certificates to support SHA-2. For PHP, you may need to obtain the .PEM file from the PHP SDK on GitHub.
Richard
โ06-23-2015 12:21 PM
Richard, is it just a matter of copying those files to my PC? Or do I need to do something in particular with the .pem file?
โ06-23-2015 08:11 PM
Richard: No PEM files exist in the github location you pointed me to:
https://github.com/AuthorizeNet/sample-code-php
Where can I get that file, and where in my SDK folder path to I place it?
โ06-27-2015 02:19 PM
โ06-27-2015 02:45 PM
Thanks Richard. Replacing the .pem file indeed fixed everything in my authnet sandbox environment.
โ06-27-2015 02:54 PM