Getting Started

Start integrating with a few simple steps.

Payment Widgets

load javaScript api

reserve DOM element

Get session id

Create account (optional)

Call JavaScript function

Payment Processing

RESTful API Example

Data Encryption

One Inc PGP Public Key

Load the PortalOne™ JavaScript API

To load the PortalOne™ JavaScript API, you must use a script tag like the one in the following example:
<script async defer src="https://stgportalone.processonepayments.com/Api/Api/Cdn/GenericModalV2/assets/js/PortalOne.js" type="text/javascript"></script>
                 
The URL contained in the script tag is the location of a JavaScript file that loads all of the symbols and definitions you need to use the PortalOne™ JavaScript API. The async attribute instructs the browser to render the rest of your website while the PortalOne JavaScript API loads.

Reserve DOM element and define initialize callback

For the portal to display on a web page, you must reserve a spot for it. Commonly this is done by creating a named div element and obtaining a reference to this element in the browser's document object model (DOM).
<div id="portalOneContainer"></div>
                 

Get Session Id from PortalOne REST API

In order to interact with PortalOne you must first obtain a secure Session Id, this ensures only authenticated applications are allowed to access PortalOne. To obtain a Session Id, you need to send a Http POST request to PortalOne and include your issued authentication key in the body of the request. Feel free to reach out to us to obtain your personal PortalOne™ AuthenticationKey.
using System;
using System.Net.Http;
using System.Web;
using Newtonsoft.Json;

private static readonly HttpClient client = new HttpClient();

var portalOneAuthenticationKey = "PortalOne Authentication Key";
var portalOneUrl = new Uri(string.Format("https://stgportalone.processonepayments.com/Api/Api/Session/Create?PortalOneAuthenticationKey={0}", HttpUtility.HtmlEncode(portalOneAuthenticationKey)));
var response = client.GetAsync(portalOneUrl.ToString()).Result;
var responseString = response.Content.ReadAsStringAsync().Result;
var responseObject = JsonConvert.DeserializeObject<dynamic>(responseString);
var responseCode = responseObject.ResponseCode;
var responseMessage = responseObject.ResponseMessage;
var portalOneSessionKey = responseObject.PortalOneSessionKey;

Console.WriteLine("Session Id: " + portalOneSessionKey);

$portalOneAuthenticationKey = urlencode("PortalOne Authentication Key");
$url = 'https://stgportalone.processonepayments.com/Api/Api/Session/Create';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url.'?PortalOneAuthenticationKey='.$portalOneAuthenticationKey);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);

$portalOneResponse = curl_exec ($ch);

$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($processOneResponse, 0, $headerSize);
$body = substr($processOneResponse, $headerSize);
curl_close ($ch);

echo $body;

var query_string = {
    "PortalOneAuthenticationKey": "PortalOne Authentication Key"
};

var request_options = {
    method: 'GET',
    uri: 'https://stgportalone.processonepayments.com/Api/Api/Session/Create',
    json: true,
    qs: query_string
};

var request = require('request');
var request_promise = require('request-promise');
var response = await request_promise(request_options);
var sessionId = response.PortalOneSessionKey;

Use the following code snippet as an example to quickly create a request object in your application. Refer to Full Documentation for more details.

Create Account via PortalOne REST API

PortalOne provides the ability to use a wallet for making payments. To use the wallet feature, you need to create an account for each customer. To do this, send a Http POST request to PortalOne and include in the body of the request the session key received in previous step. The method returns a unique customer identifier. Save it in your system and pass it as parameter of a PortalOne method whenever you call it. This step can be skipped if are not going to use the wallet feature.
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/Api/Api/Customer/CreateAccount");
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 responseCode = responseObject.ResponseCode;
var responseMessage = responseObject.ResponseMessage;
var customerId = responseObject.CustomerId;

Console.WriteLine("Customer Id: " + customerId);

class CreateAccountRequest {
    public $portalOneAuthenticationKey = "PortalOne Authentication Key";
}

$createAccountRequest = new CreateAccountRequest();

$url = 'https://stgportalone.processonepayments.com/Api/Api/Customer/CreateAccount';
$ch = curl_init($url);
$payload = json_encode($createAccountRequest);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);

$portalOneResponse = curl_exec ($ch);

$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($processOneResponse, 0, $headerSize);
$body = substr($processOneResponse, $headerSize);
curl_close ($ch);

echo $body;

var request_body = {
    "PortalOneAuthenticationKey": "PortalOne Authentication Key"
};

var request_options = {
    method: 'POST',
    uri: 'https://stgportalone.processonepayments.com/Api/Api/Customer/CreateAccount',
    json: true,
    body: request_body
};

var request = require('request');
var request_promise = require('request-promise');
var response = await request_promise(request_options);
var customerId = response.CustomerId;

Use the following code snippet as an example to quickly create a request object in your application. Refer to Full Documentation for more details.

Call JavaScript function to open modal

In order to invoke the Make Payment modal window, you first initialize the library and then simply call the makePayment function with required parameters. See full documentation for reference to the various events exposed by the library.
$('#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',
        'customerId': 'Your Customer Id From Previous Step'
    });

ProcessOne REST API Example

To test the ProcessOne™ RESTful API, please reach out to us to obtain your ProcessOne™ AuthenticationKey.
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);
}
class Customer {
	public $Name = "Holder Name";
	public $Address = "Holder Billing Address";
	public $Zip = "12345";
}

class ClientReferenceData {
	public $ClientReferenceData1 = "POL12345";
}

class CreditCardDetails {
	public $Number = "4444444444444448";
	public $ExpirationMonth = 12;
	public $ExpirationYear = 2020;
	public $Holder = null;
}

class ChargeCreditCardRequest {
	public $AuthenticationKey = "AuthenticationKey";
	public $Amount = 1;
	public $CreditCard = null;
	public $ClientReferenceData = null;
}

$chargeRequest = new ChargeCreditCardRequest();
$chargeRequest -> CreditCard = new CreditCardDetails();
$chargeRequest -> CreditCard -> Holder = new Customer();
$chargeRequest -> ClientReferenceData = new ClientReferenceData();

$url = 'ProcessOne Url';
$ch = curl_init( $url );
$payload = json_encode($chargeRequest);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);

$processOneResponse = curl_exec ($ch);

$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($processOneResponse, 0, $headerSize);
$body = substr($processOneResponse, $headerSize);
curl_close ($ch);

echo $body;
<script src="../Scripts/jquery-1.12.4.min.js"></script>
<script src="../Scripts/processOneApi.js"></script>
<script>
    var application = {
        config: {
            processOneUrl: 'http://processone/api/',
            processOneAuthenticationKey: 'Authentication Key',
        }
    }

    var creditCardChargeResponse;
    $.processOneApi(application.config.processOneUrl)
        .creditCard
        .charge({
            authenticationKey: application.config.processOneAuthenticationKey,
            amount: 1,
            creditCard: {
                number: '4012000033330026',
                validationValue: '123',
                expirationYear: 2020,
                expirationMonth: 12,
                holder: {
                    name: 'Customer',
                    zip: '12345'
                }
            }
        })
        .done(function (result) {
            creditCardChargeResponse = result;
            console.log("creditcard charged");
            // process the result
            console.log(result);
        })
        .fail(function (result) {
            // process the result
            console.error(result);
        });
</script>
Use the following code snippet as an example to quickly create a request object in your application. Refer to Full Documentation for more details.

One Inc PGP Public Key for Encryption

Please use the following One Inc Public Key to encrypt any sensitive data.


Type:	4096-bit RSA
Fingerprint:	C04F7E2BC6EAF4F076309CC003ED168762F5862A

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBF9hEKoBEADPX62MMtfO9niGKN3exTKgtRkJOoFkejVtc6hTdGR7PcndDzE5
g7d+XhPX51LZEN3Q6n6wGJSxfnNNiNFZtfgOh15sXZ4lY4mNyLCPllT7V3Nb8EMZ
jgewDIFsRRpukLmloyJs2sDWpBLhct/7CCQbqvxcKAnHH2faF7yJSlCINnT1HpHr
pS4yBpRNwRNzXjBDbjZGk2N+Nlt8GkdSYhI3Ykct4IaKnv8aUXzCpyRvjX3Kwl3K
zNE+ApJnCYEcA2PFHO3Gd3QK20uainyU4c/9VgZZ1Yc2m+2MNwTMXj4+sCmsHmbs
MZAInXviHIXQKLK42HI8AgefjmuuCeNC9GcuA/hryIn2QrEtcqd51teyCBBvxFkT
gaRs133IXplUBsmMaMhsbjU2nCN0E2w5QX5DDICi7Msp9tWV7G0sfpw6WNfRAreh
Dby8ow/M4a+gChMr1jvnGxViEJR2Ng9lifKv3j2MBm3DJVeo8KDLF7DzSOcrIYTT
Nh8DKfAQvmiAw7hcxGJVKcYnQqka+CMMJrWagJFKlVRrrL70C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