<script async defer src="https://stgportalone.processonepayments.com/GenericModal/Cdn/PortalOne.js" type="text/javascript"></script>
<div id="portalOneContainer"></div>
using System.Collections.Generic;
using System.Net.Http;
using Newtonsoft.Json;
private static readonly HttpClient client = new HttpClient();
var portalOneUrl = new Uri("https://stgportalone.processonepayments.com/GenericModal/SessionKey/Create");
var portalOneAuthenticationKey = "PortalOne Authentication Key";
var values = new Dictionary<string, string>
{
{ "portalOneAuthenticationKey", portalOneAuthenticationKey }
};
var content = new FormUrlEncodedContent(values);
var response = client.PostAsync(portalOneUrl.ToString(), content).Result;
var responseString = response.Content.ReadAsStringAsync().Result;
var responseObject = JsonConvert.DeserializeObject<dynamic>(responseString);
var isSuccesful = responseObject.IsSuccesful;
var sessionId = responseObject.SessionKey;
Console.WriteLine("Session Id: " + sessionId);
$('#portalOneContainer').portalOne();
$('#portalOneContainer').data('portalOne')
.makePayment({
'paymentCategory': 'CreditCard',
'feeContext': 'PaymentWithFee',
'minAmountDue': '12.00',
'accountBalance': '120.00',
'billingZip': '95630',
'billingAddressStreet': '602 Coolidge Dr., Folsom, CA',
'policyHolderName': 'John Smith',
'referenceNumber': 'POL330701-02',
'sessionId': 'Your Session Id From Previous Step'
});
public void Charge()
{
Console.WriteLine("Executing credit card charge operation");
// Set an actual ProcessOne RestAPI url
var apiUri = Settings.Default.ProcessOneApiUrl;
var chargeRequest = new ChargeCreditCardRequest
{
// Set your ProcessOne Authentication Key
AuthenticationKey = Settings.Default.AuthenticationKey,
Amount = 1,
CreditCard = new CreditCardDetails
{
Number = "4444444444444448",
ExpirationMonth = 12,
ExpirationYear = 2020,
Holder = new Customer
{
Name = "Holder Name",
Address = "Holder Billing Address",
Zip = "12345"
},
ValidationValue = "123"
},
ClientReferenceData = new ClientReferenceData
{
ClientReferenceData1 = "POL12345"
}
};
var result = new ProcessOneApi(apiUri)
.CreditCard
.Charge(chargeRequest);
Console.WriteLine("Execution result code: {0}", result.ResponseCode);
Console.WriteLine("Message: {0}", result.Message);
Console.WriteLine("Transaction Id: {0}", result.TransactionId);
}