Skip to content

Instantly share code, notes, and snippets.

@phillipsj
Created February 27, 2015 02:17
Show Gist options
  • Save phillipsj/168f011bc6d6b5e0632f to your computer and use it in GitHub Desktop.
Save phillipsj/168f011bc6d6b5e0632f to your computer and use it in GitHub Desktop.
DPMFromAuthorize
public ActionResult DPM()
{
String ApiLogin = "Your_login_id";
String TxnKey = "Your_transaction_key";
String checkoutform = DPMFormGenerator.OpenForm(ApiLogin, TxnKey, 2.25M,
"https://YOUR_RELAY_RESPONSE_URL", true);
// Add a credit card number input field
checkoutform = checkoutform + @"<p><div style='float:left;width:250px;'><label>Credit Card
Number</label><div id = 'CreditCardNumber'><input type='text' size='28' name='x_card_num'
value='4111111111111111' id='x_card_num'/></div></div>";
// Add an expiry date input field
checkoutform = checkoutform + @"<div style='float:left;width:70px;'><label>Exp.</label>
<div id='CreditCardExpiration'><input type='text' size='5' maxlength='5' name='x_exp_date'
value='0116' id='x_exp_date'/></div></div>";
// Add a CVV input field
checkoutform = checkoutform + @"<div style='float:left;width:70px;'><label>CCV</label>
<div id='CCV'><input type='text' size='5' maxlength='5' name='x_card_code' id='x_card_code'
value='123' /></div></div></p>";
// Add a Submit button
checkoutform = checkoutform + "<div style='clear:both'></div>";
checkoutform = checkoutform + @"<p><input type='submit' class='submit' value='Order with
DPM!' /></p>";
checkoutform = checkoutform + DPMFormGenerator.EndForm();
return Content("<html>" + checkoutform + "</html>");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment