I am using C# - SDK code for Credit Card transaction. It is always giving "The transaction was unsuccessfull". But it working fine with SANDBOX (with sandbox credentials)
The only change I made was replace
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
with
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.PRODUCTION;
Note: I am using the production API Login ID and Transaction Key for production mode.
Please help, my customer is very annoyed with it.
01-24-2018 10:44 PM
Could you please provide the error code returned when you run it against production ?
Also are you able to call other using the production API and transactionkey ?
Please share the request body that you are sending for the credit card transaction.
Are you calling createTransaction or any other API for this ?
01-25-2018 09:39 AM
Same problem here
error
E00018
04-25-2018 01:44 PM
04-25-2018 01:52 PM
How can we solve the error?
CS told us they was a problem with authentication
04-25-2018 02:18 PM
The credit card is valid an the expiration date is not pass ... which format I have to use for the date format?
mmyy or yyyy-mm?
04-25-2018 02:20 PM
mmyy, yyyy-mm, mm-yyyy are supported in CreateTransactionRequest. please check the sample code here. I have tried mmyy and it worked in sandbox.
-Bhavana
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>78BZ5Xprry</name>
<transactionKey>8s2F95Q7brhHd7Tn</transactionKey>
</merchantAuthentication>
<refId>123456</refId>
<transactionRequest>
<transactionType>authOnlyTransaction</transactionType>
<amount>5.12</amount>
<payment>
<creditCard>
<cardNumber>5424000000000015</cardNumber>
<expirationDate>1220</expirationDate>
<cardCode>999</cardCode>
</creditCard>
</payment>
<order>
<invoiceNumber>INV-12345</invoiceNumber>
<description>Product Description</description>
</order>
<lineItems>
<lineItem>
<itemId>1</itemId>
<name>vase</name>
<description>Cannes logo </description>
<quantity>18</quantity>
<unitPrice>45.00</unitPrice>
</lineItem>
</lineItems>
<tax>
<amount>4.26</amount>
<name>level2 tax name</name>
<description>level2 tax</description>
</tax>
<duty>
<amount>8.55</amount>
<name>duty name</name>
<description>duty description</description>
</duty>
<shipping>
<amount>4.26</amount>
<name>level2 tax name</name>
<description>level2 tax</description>
</shipping>
<poNumber>456654</poNumber>
<customer>
<id>99999456654</id>
</customer>
<billTo>
<firstName>Ellen</firstName>
<lastName>Johnson</lastName>
<company>Souveniropolis</company>
<address>14 Main Street</address>
<city>Pecan Springs</city>
<state>TX</state>
<zip>44628</zip>
<country>USA</country>
</billTo>
<shipTo>
<firstName>China</firstName>
<lastName>Bayles</lastName>
<company>Thyme for Tea</company>
<address>12 Main Street</address>
<city>Pecan Springs</city>
<state>TX</state>
<zip>44628</zip>
<country>USA</country>
</shipTo>
<customerIP>192.168.1.1</customerIP>
<userFields>
<userField>
<name>MerchantDefinedFieldName1</name>
<value>MerchantDefinedFieldValue1</value>
</userField>
<userField>
<name>favorite_color</name>
<value>blue</value>
</userField>
</userFields>
</transactionRequest>
</createTransactionRequest><?xml version="1.0" encoding="utf-8"?>
<createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<refId>
123456
</refId>
<messages>
<resultCode>
Ok
</resultCode>
<message>
<code>
I00001
</code>
<text>
Successful.
</text>
</message>
</messages>
<transactionResponse>
<responseCode>
1
</responseCode>
<authCode>
NYSQHD
</authCode>
<avsResultCode>
Y
</avsResultCode>
<cvvResultCode>
P
</cvvResultCode>
<cavvResultCode>
2
</cavvResultCode>
<transId>
60102338937
</transId>
<refTransID />
<transHash>
61783A2F70D547089FD7D30647DBBC48
</transHash>
<testRequest>
0
</testRequest>
<accountNumber>
XXXX0015
</accountNumber>
<accountType>
MasterCard
</accountType>
<messages>
<message>
<code>
1
</code>
<description>
This transaction has been approved.
</description>
</message>
</messages>
<userFields>
<userField>
<name>
MerchantDefinedFieldName1
</name>
<value>
MerchantDefinedFieldValue1
</value>
</userField>
<userField>
<name>
favorite_color
</name>
<value>
blue
</value>
</userField>
</userFields>
<transHashSha2 />
</transactionResponse>
</createTransactionResponse>
-Bhavana
04-25-2018 05:05 PM
I using mmyy.
All work ok in the sand box but not in Production. I was using new keys every time I review the code.
Some times the error code is 0007, or 00018
04-25-2018 06:41 PM