Ok i am using asp.net and using an iframe to load the payment box.
I can enter the information but when you press contuine the iframe box will not close and load the page on the webpage that called it.
to see how it works go to
The code is at http://www.marshallville-meats.com/test/Default.aspx
you will need to be login
User Name is rrr9
password is green2Apple$
after loging in go to home page and pick item
add the item to the cart
press the cart button at top of page
press the proced to checkout
press next (usp shipping)
press check out
below is the java scrpt calling the iframe
<div id="myForm" style="display:none">
<div id="inline_content">
<script src="Scripts/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
$(".inline").colorbox({
inline: true,
opacity: 0.5, // overlay a bit less dark
innerWidth: 640,
innerHeight: 390,
onComplete: function () { document.OutputForm.submit() }
});
</script>
<form name="OutputForm" method="post" action="https://test.authorize.net/payment/payment" target="payframe" id="LinkTo" class="ShowForm">
<input type="hidden" id="InToken" name="Token" value="" />
</form>
<iframe id="payframe" name="payframe"></iframe>
</div>
</div>
class file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AuthorizeNet.Api.Controllers;
using AuthorizeNet.Api.Controllers.Bases;
using System.Net;
using AuthorizeNet.Api.Contracts.V1;
using System.Security.Authentication;
/// <summary>
/// Summary description for CreditCardClass
/// </summary>
public class CreditCardClass
{
public CreditCardClass()
{
//
// TODO: Add constructor logic here
//
}
public static string CreditCardMain(decimal amount, string OrderNo, string email, string firstname, string lastname, string address, string city, string state, string Zip, string ShipFirstName, string ShipLastName, string ShipAddressIn, string ShipCity, string ShipState, string ShipZip)
{
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
{
name = "2v7X4P6r3Y3",
ItemElementName = ItemChoiceType.transactionKey,
Item = "3p9vs27xr5VFS39e",
};
settingType[] settings = new settingType[5];
settings[0] = new settingType();
settings[0].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();
settings[0].settingValue = "{\"text\": \"Pay\"}";
settings[1] = new settingType();
settings[1].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();
settings[1].settingValue = "{\"show\": true, \"required\":true}";
settings[2] = new settingType();
settings[2].settingName = settingNameEnum.hostedPaymentShippingAddressOptions.ToString();
settings[2].settingValue = "{\"show\": true, \"required\":false}";
settings[3] = new settingType();
settings[3].settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString();
settings[3].settingValue = "{\"showEmail\": true, \"requiredEmail\":false}";
settings[4] = new settingType();
settings[4].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();
settings[4].settingValue = "{\"showReceipt\" : true, \"url\":\"http://www.marshallville-meats.com/test/checkoutfinal.aspx\", \"urlText\": \"Continue\", \"cancelUrl\": \"http://www.marshallville-meats.com/test\", \"cancelUrlText\": \"Cancel\"}";
var orderIn = new orderType
{
invoiceNumber = OrderNo
};
var billingAddress = new customerAddressType
{
email = email,
firstName = firstname,
lastName = lastname,
address = address,
city = city,
state = state,
zip = Zip
};
var ShipAddress = new customerAddressType
{
firstName = ShipFirstName,
lastName = ShipLastName,
address = ShipAddressIn,
city = ShipCity,
zip = ShipZip
};
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authOnlyTransaction.ToString(), // authorize only
amount = amount,
billTo = billingAddress,
order = orderIn,
shipTo = ShipAddress
};
const SecurityProtocolType Tls12 = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
ServicePointManager.SecurityProtocol = Tls12;
var request = new getHostedPaymentPageRequest();
request.transactionRequest = transactionRequest;
request.hostedPaymentSettings = settings;
var controller = new getHostedPaymentPageController(request);
controller.Execute();
var response = controller.GetApiResponse();
string token = response.token;
return token;
}
}
09-15-2017 10:32 AM