Create Session

Please log in to get a personalized configuration!

This method will create a new session for a Payment Form. It allows you to customize appearance of the form (such as price, heading, etc). You should only create new sessions from a server side (i.e. never directly from your application). Note, session will only work once and it will eventually expire depending on Expires parameter.

This method is accessed by https://app.cryptolens.io/api/paymentform/CreateSession

Parameters

Parameter Description Remarks
PaymentFormId The id of the payment form required
Price The amount you want to charge your customer as a double (eg. 12.5) optional, 0 by default
Currency The ISO currency code (eg. USD) required
Heading This will appear on top of the payment form (at most 100 chars). optional
ProductName This is the text that is going to be displayed as the item that is being purchased (at most 200 chars). optional
CustomField A custom field that can be used as variables for the requests that are sent upon a successful transaction (at most 1000 chars). optional
Metadata Any additional metadata that you want to be saved upon a successful transaction (at most 1000 chars) optional
Expires The number of seconds this session should be valid. required
v Method version. optional. by default, it's 1.

Results

Parameter Description Remarks
SessionId A unique integer identifier associated with this customer. always returned
Result This is either 0(=success) or 1(=error). always returned
Message The message that provides additional information about the result. always returned.

Example results

{"sessionId":"WyIxMiIsInF1MjdXTXk5MnprSEpuZytHQUdFMVd6VDVSSzQ2K2ZhRkJReCswVzYiXQ==","result":0,"message":null}

Errors

Error
Access denied.
The input parameters were incorrect.
The currency string is incorrect.
The payment form does not exist.
;