getPaymentToken

IMPORTANT!  
Starting with v24.3, this is deprecated.

Initiates a payment flow using a configured payment processor.

Syntax

Copy
function getPaymentToken(configAlias: string, referenceId: string, info: any, billing: any): any
 
Parameter Description
configAlias The alias for a configured payment processor service. For information on how to configure a link to a payment processor service, see the Innovation Core User Guide.
referenceId Payment reference ID.
info JSON object containing invoicing information. The object has the following structure:
Copy
{
    amount : number,
    currency : string,
    details : string,
}
billing JSON object containing billing information. The object has the following structure:
Copy
{
    address : string,
    email : string,
    firstName : string,
    lastName : string,
    phone : string,
}

Return Value

Returns a JSON object containing parameters needed to redirect the user to the payment processor's payment page:

Copy
{
    encodedToken : string;
    envelope : string;
    callUrl : string;
}

This allows you to create client-side forms that will redirect the user to the payment processor's payment page:

Copy
<form id="NetopiaPostForm" name="RedirectAndPOST" action="<callUrl>" method="POST">
    <input type="hidden" name="data" value="<encodedToken>" />
    <input type="hidden" name="env_key" value="<envelope>" />
    <button type="submit">Go to Pay!</button>
</form>

Once the payment is finalized, a callback from the payment processor will be directed to the PaymentProcessorCallbackController endpoint, which will populate the ReferenceId and LogData attributes of the PaymentProcessorLog entity with the transaction's details.

Examples