Reputation: 197
I am using asp.net, c#, and web forms (not MVC).
I was following this thread, but I am not sure what the code behind would be to implement this solution.
https://community.developer.authorize.net/t5/Integration-and-Testing/DPM-with-EChecks/m-p/33623#M181...
It states to use this for the form:
<input type='hidden' runat="server" name='x_login' id='x_login' />
<input type='text' readonly="readonly" runat="server" name='x_amount' id='x_amount' size='9' />
<input type='text' runat="server" name='x_fp_sequence' id='x_fp_sequence' />
<input type='text' runat="server" name='x_fp_timestamp' id='x_fp_timestamp' />
<input type='text' runat="server" name='x_fp_hash' id='x_fp_hash' />
<input type='hidden' name='x_method' id='x_method' value='ECHECK' />
<input type='hidden' name='x_bank_aba_code' id='x_bank_aba_code' value='?????????' />
<input type='hidden' name='x_bank_acct_num' id='x_bank_acct_num' value='123456789123' />
<input type='hidden' name='x_bank_acct_type' id='x_bank_acct_type' value='CHECKING' />
<input type='hidden' name='x_bank_name' id='x_bank_name' value='bANKnAME' />
<input type='hidden' name='x_bank_acct_name' id='x_bank_acct_name' value='aCCOUNTnAME' />
<input type='hidden' name='x_echeck_type' id='x_echeck_type' value='WEB' />
<input id="x_relay_url" name="x_relay_url" type="hidden" value="https://developer.authorize.net/tools/paramdump/index.php" />
<input type='hidden' name='x_relay_response' value='true' />
<input type='hidden' name='x_delim_data' value='false' />
<input type='submit' runat="server" id='buttonLabel' />
So my question is what is necessary in my C# code for this to work? I have been searching and haven't found resources on the topic for the DPM method. I only have seen resources for AIM.
Upvotes: 0
Views: 111
Reputation: 26
For DPM there's not really anything you can do with fields such as "x_bank_aba_code", etc, in the code-behind because that would involve posting back to your own server, which would put you into the land of "PCI Compliance", which negates using DPM in the first place.
What I have done is:
1) Ask for all non-CC or ECHECK data on a previous page
2) Store this data and generate a GUID for the record
3) Load up all that data on your payment page from the code-behind (on PageLoad() - pass the guid on the URL so you can pull the appropriate record and display the data already entered)
4) either name your actual input fields "x_bank_aba_code", etc. (I don't recommend this) -or- Attach an OnClientClick() event to your submit button (allows for validation.) Then...
5) Use the validation to load up the hidden variables.
// Routing Number
var routingNumber = $("#<%=txtBankRoutingNumber.ClientID%>").val();
var routingNumber2 = $("#<%=txtBankRoutingNumberConfirm.ClientID%>").val();
routingNumber = routingNumber.trim();
routingNumber2 = routingNumber2.trim();
if (routingNumber == '') {
alert('Please provide your Routing Number.');
return false;
}
if (routingNumber2 == '') {
alert('Please confirm Routing Number.');
return false;
}
if (routingNumber != routingNumber2) {
alert('Routing Numbers don\'t match.');
return false;
}
// THIS LINE WILL SET THE HIDDEN VARIABLE
document.getElementsByName('x_bank_aba_code')[0].value = routingNumber;
I'll try to post more detail later.
Hope this helps - but the main point is that the banking/CC/ECHECK information cannot be posted pack to your server - that's where the javascript/jquery comes in by both validating the input and loading up the hidden variables.
Upvotes: 1