Hi, I'm new here and have never integrated DPM before.
I'm using the Java SDK. My account is in live mode.
I have been receiving this error continuously since my first test. I have spoken with their chat support and also read several posts on this topic, but have not been able to find my issue.
I'm starting to suspect that it's with my fingerprint generation, but honestly, all I know is that I'm not getting past relay_response.jsp.
Here's my shopping cart:
<% String apiLoginId = "REDACTED"; String transactionKey = "REDACTED"; Environment environment = Environment.valueOf("PRODUCTION"); Merchant merchant = Merchant.createMerchant(environment, apiLoginId, transactionKey); String relayResponseUrl = "https://REDACTED.com/relay_response.jsp"; BigDecimal amount = new BigDecimal(1.00); // Get a random long for the fingerprint Random rand = new Random(); long bits, randLong, max = 999999999L; do { bits = (rand.nextLong() << 1) >>> 1; randLong = bits % max; } while (bits-randLong+(max-1) < 0L); Fingerprint fingerprint = Fingerprint.createFingerprint(merchant, randLong, amount); long x_fp_sequence = fingerprint.getSequence(); long x_fp_timestamp = fingerprint.getTimeStamp(); String x_fp_hash = fingerprint.getFingerprintHash(); %>
<table style="width: 100%;">
<caption style="margin-bottom: 10px;">Payment Information</caption>
<tr>
<td><label for="x_card_num">Credit Card Number</label></td>
<td><input type="text" class="text" id="x_card_num" name="x_card_num" size="20" maxlength="16" /></td>
</tr>
<tr>
<td><label for='x_exp_date'>Expiration Date</label></td>
<td><input type="text" class="text" id="x_exp_date" name="x_exp_date" size="7" maxlength="7" placeholder="MM-YYYY" /></td>
</tr>
<tr>
<td><label for='x_amount'>Amount</label></td>
<td><input type="text" class="text" id="x_amount" name="x_amount" size="10" maxlength="10" readonly="readonly" value="<%=amount%>" /></td>
</tr>
</table>
<input type='hidden' name='x_invoice_num' value='<%=System.currentTimeMillis()%>' />
<input type='hidden' name='x_relay_url' value='<%=relayResponseUrl%>' />
<input type='hidden' name='x_login' value='<%=apiLoginId%>' />
<input type='hidden' name='x_fp_sequence' value='<%=x_fp_sequence%>' />
<input type='hidden' name='x_fp_timestamp' value='<%=x_fp_timestamp%>' />
<input type='hidden' name='x_fp_hash' value='<%=x_fp_hash%>' />
<input type='hidden' name='x_version' value='3.1' />
<input type='hidden' name='x_method' value='CC' />
<input type='hidden' name='x_type' value='AUTH_CAPTURE' />
<input type='hidden' name='x_amount' value='<%=amount%>' />
<input type='hidden' name='x_test_request' value='FALSE' />
And here's my relay_response.jsp:
<script type="text/javascript"> var referrer = document.referrer; if (referrer.substr(0,7)=="http://") referrer = referrer.substr(7); if (referrer.substr(0,8)=="https://") referrer = referrer.substr(8); if (referrer && referrer.indexOf(document.location.hostname) != 0) { <% String apiLoginId = "6vyDBvS3EP3p"; String receiptPageUrl = "https://REDACTED.com/do/receiveResponse"; String MD5HashKey = ""; net.authorize.sim.Result result = net.authorize.sim.Result.createResult(apiLoginId, MD5HashKey, request.getParameterMap()); StringBuffer receiptUrlBuffer = new StringBuffer(receiptPageUrl); if (result != null) { receiptUrlBuffer.append("?"); receiptUrlBuffer.append(ResponseField.RESPONSE_CODE.getFieldName()).append("="); receiptUrlBuffer.append(result.getResponseCode().getCode()); receiptUrlBuffer.append("&"); receiptUrlBuffer.append(ResponseField.RESPONSE_REASON_CODE.getFieldName()).append("="); receiptUrlBuffer.append(result.getReasonResponseCode().getResponseReasonCode()); receiptUrlBuffer.append("&"); receiptUrlBuffer.append(ResponseField.RESPONSE_REASON_TEXT.getFieldName()).append("="); receiptUrlBuffer.append(result.getResponseMap().get(ResponseField.RESPONSE_REASON_TEXT.getFieldName())); if(result.isApproved()) { receiptUrlBuffer.append("&").append(ResponseField.TRANSACTION_ID.getFieldName()).append("="); receiptUrlBuffer.append(result.getResponseMap().get(ResponseField.TRANSACTION_ID.getFieldName())); } } String receiptUrlBufferString = receiptUrlBuffer.toString(); System.out.println("receipt url buffer: " + receiptUrlBufferString); %> document.location = "<% out.print(receiptUrlBufferString); %>"; } else { console.log('Not relaying'); } </script>
My JVMs are printing this:
receipt url buffer: https://REDACTED.com/do/receiveResponse?x_response_code=3&x_response_reason_code=99&x_response_reaso... transaction cannot be accepted.
Where am I going wrong? Any help would be most appreciated!
Thanks,
ab
Solved! Go to Solution.
12-14-2013 09:51 AM - edited 12-14-2013 09:52 AM
My BigDecimal was printing out an integer value (1). I returned another BigDecimal from the first one using setScale(2) in order to print out the format that Auth Net expects (1.00).
12-14-2013 10:40 AM
My BigDecimal was printing out an integer value (1). I returned another BigDecimal from the first one using setScale(2) in order to print out the format that Auth Net expects (1.00).
12-14-2013 10:40 AM