I have been trying to get a sample Web Services request to go through and I keep receiving an error. See my Setup.
Account Number: 89994061 Store ID: test Store Password: test
Sample Request (Code)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<title>Credit Card Test</title>
<body>
<form NAME="Credit Card" METHOD="post"
ACTION="https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1">
<input type=hidden name="txnmode" value="ccAuthorize" >
<b>XML Message body:</b>
<TEXTAREA class="xmlbox" name="txnRequest" COLS=100 ROWS=10 >
<ccAuthRequestV1 xmlns="http://www.optimalpayments.com/creditcard/xmlschema/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.optimalpayments.com/creditcard/xmlschema/v1">
<merchantAccount>
<accountNum>89994061</accountNum>
<storeID>test</storeID>
<storePwd>test</storePwd>
</merchantAccount>
<merchantRefNum>Ref-12345</merchantRefNum>
<amount>10.00</amount>
<card>
<cardNum>4XXXXXXXXXXXXXX1</cardNum>
<cardExpiry>
<month>11</month>
<year>2015</year>
</cardExpiry>
<cardType>VI</cardType>
<cvdIndicator>1</cvdIndicator>
<cvd>111</cvd>
</card>
<authentication>
<indicator>05</indicator>
<cavv>AAABB4WZlQAAAAAAcJmVENiWiV+=</cavv>
<xid>Q2prWUI2RFNBc3FOTXNlem50eWY=</xid>
</authentication>
<billingDetails>
<cardPayMethod>WEB</cardPayMethod>
<firstName>Jane</firstName>
<lastName>Jones</lastName>
<street>123 Main Street</street>
<city>LA</city>
<state>CA</state>
<country>US</country>
<zip>90210</zip>
<phone>555-555-5555</phone>
<email>janejones@emailserver.com</email>
</billingDetails>
<shippingDetails>
<carrier>FEX</carrier>
<shipMethod>T</shipMethod>
<firstName>Jane</firstName>
<lastName>Jones</lastName>
<street>44 Main Street</street>
<city>LA</city>
<state>CA</state>
<country>US</country>
<zip>90210</zip>
<phone>555-555-5555</phone>
<email>janejones@emailserver.com</email>
</shippingDetails>
<recurring>
<recurringIndicator>I</recurringIndicator>
<originalConfirmationNumber>115147689</originalConfirmationNumber>
</recurring>
<customerIP>127.0.0.1</customerIP>
<productType>M</productType>
<addendumData>
<tag>CUST_ACCT_OPEN_DATE</tag>
<value>20041012</value>
</addendumData>
<addendumData>
<tag>MERCHANT_COUNTRY_CODE</tag>
<value>US</value>
</addendumData>
<addendumData>
<tag>SERVICE_REQUEST_CURRENCY</tag>
<value>on</value>
</addendumData>
</ccAuthRequestV1>
</TEXTAREA>
<br>
<input TYPE=submit class=input VALUE="Send Request">
</form>
</body>
</html>
Error Received
Required String parameter 'txnMode' is not present
This is the exact request from the documentation and it is not working for me. What am I doing that is incorrect? Any input would be appreciated.
At first glance it would look like everything is good. However there is one slight mistake in the code. You have the following line in the HTML POST
<input type=hidden name="txnmode" value="ccAuthorize" >
The correct way of doing it is the following
<input type=hidden name="txnMode" value="ccAuthorize" >
The issue is that the actual txnMode name is spelled incorrectly. This is case sensitive. Once you make this change you should receive a proper response from the Web Services API.