Skip to main content

Payment Terminal

Payment terminal is a way to display payment instructions on your web page that allows your customers to pay for a service or product following the terminal instructions.

To get a payment terminal, you need to generate a GET URL with a set of the parameters and redirect your customer, via that link, to the payment terminal.

PaymentLink_01_4.png

The parameters are:

ParameterDescriptionValue typeOptionality
projectThe unique code that identifies the project you are associated with and where you want to create the payment terminal. Will be given to you by Coinsflow integration manager.stringRequired
externalIdThe unique code that identifies the operation. Created on the merchant's side.stringRequired
requestedAssetA unique code that identifies the cryptocurrency to be used with the payment terminal. This is the currency in which the payment amount will be displayed. Full list of assets will be given to you by Coinsflow integration manager.stringRequired
amountThe value to associate with the payment terminal. The amount the customer pays when using the payment terminal.stringRequired
isOrderDetermines if an Order should be created alongside the Payment Terminal.booleanOptional
urlURL address of the page the user is automatically redirected to after the operation is completed and the address for the "Back" button on the Payment terminal.stringOptional
successUrlURL address of the page the user is automatically redirected to after the operation is completed successfully.stringOptional
declineUrlURL address of the page the user is automatically redirected to after the operation is failed to complete.stringOptional
iframeA boolean that determines if a link is created that allows you to embed the payment terminal code in another HTML page.booleanOptional (false by default)
paymentAssetThe unique code that identifies the desired Payment Asset you want to present to the end-user. The total amount requested in it, is an on-the-fly conversion from the “requestedAsset”, if they are different. If it is filled, there's no choice for the customer.StringOptional
accountThe id of the account the payment should be transfered to. If it is present, isOrder should be false.String (uuid)Optional

Concerning successUrl and declineUrl:

  • If successUrl and declineUrl are provided together with url in the link, the redirect is made to successUrl or declineUrl. The url in this case is used to link the "Return to merchant" button.
  • If successUrl url is provided without declineUrl, then the successful payment is redirected to successUrl, but if it fails is redirected to url.
  • If declineUrl url is provided without successUrl then successful payment is redirected to url, and if it fails is redirected to url.
  • If you just provide the url without successUrl and declineUrl, in case of success or failure, the redirect to url is performed. Provided urls | Success redirects to | Decline redirects to ---------|----------|--------- successUrl and declineUrl | successUrl | declineUrl Only successUrl | successUrl | url Only declineUrl | url | url No successUrl and declineUrl | url | url

Creating a Request

  1. Create a request to the following url:

    • For production:
      https://my.coinsflow.pl/order?
    • For sandbox:
      https://my.sandbox.coinsflow.pl/order?
  2. Create a JSON file with the required and optional parameters:

    • project: Insert the unique code that identifies your project.
    • requestedAsset: Insert the unique code that identifies the desired asset.
    • amount: Insert the desired amount to associate with the payment terminal.
    • externalId: Insert the unique code that identifies the operation.
    • iframe: Indicate if a link is created to embed the payment terminal code in another HTML page (it assumes the false value if left empty).
    • url: Insert the url address of the page the user is automatically redirected to after the operation is completed.
  3. The request looks like this:

    {
    "project":"75b5b830-4cea-48de-954d-bc3f7e1ca720",
    "requestedAsset":"a1b98c9a-e5d8-4cd2-b1be-37d05276008b",
    "amount":"1",
    "externalId":"9371c80b-d66b-4e5d-a911-b3ea3eb708ff",
    "iframe":true,
    "url":"https://example.com"
    }
  4. Convert the code in JSON to base64 format (click here to convert.).

  5. The base64 format looks like this:

    e+KAnHByb2plY3TigJ064oCcNzViNWI4MzYtNGNlYS00OGRlLTk1NGQtYmMzZjdlMWNhNzIwIizigJxhc3NldOKAnTrigJxhMWI5OGM5YS1lNWQ4LTRjZDItYjFiZS0zN2QwNTI3NjAwOGLigJ0s4oCcYW1vdW504oCdOuKAnDEiLOKAnHJlZklk4oCdOuKAnDkzNzFjODBiLWQ2NmItNGU1ZC1hOTExLWIzZWEzZWI3MDhmZuKAnSzigJxhbGxvd0Nob2ljZeKAnTp0cnVlLOKAnGlmcmFtZeKAnTp0cnVlLCAidXJsIjoiaHR0cHM6Ly9leGFtcGxlLmNvbSJ9
  6. Generate the hmac(sha256) hash (click here to generate):

    1. On "Enter Plain Text to Compute Hash", insert the json file.
    2. On "Enter the Secret Key", insert the provided Secret Key.

      Contact your Integration Specialist/TAM to request the Secret Key for your Terminal.

    3. On "Select Cryptographic Hash Function", select SHA-256, from the drop-down menu.
    4. On "Output Text Format", select Hex (selected by default).
    5. Click on the "Compute Hash" button.
    6. Copy the "Hashed output" that looks something like this:
      557dce27cfa252e1485e4d2ca9134020f2ff38f0e958489492bb3b40df65fca6018d97a703d3ff14c2117e8f068666f2464b1b6e98c5657913a9591bf27e8b35
  7. Insert the “base 64 encoded json” and the "hashed output" into the terminal request, to look like this:

        https://my.sandbox.coinsflow.pl/order?payload={base64 encoded json}&signature={hmac_sha256 signature of RAW JSON}

To display the terminal in dark mode, follow the step below.

The callback/response from the API call for a paid Terminal looks like this:

"terminalData": {
"id": "6aeef1cf-7190-47d0-a719-31b17e6d763f",
"requestedAssetAmount": "5.000000000000000000",
"requestedAssetAmountPaid": "5.011154449145546404",
"requestedAsset": {
"id": "4dfb822a-2dc4-4907-9850-a7df41721fd8",
"name": "Euro",
"symbol": "EUR",
"displayName": "Euro",
"displaySymbol": "EUR",
"exchangeSymbol": "EUR",
"type": "FIAT",
"subType": "FIAT",
"token": false,
"contract": null,
"nativeAsset": "EUR",
"decimals": 2,
"network": "FIAT"
}
}

Need further assistance?

If you didn't find what you were looking for, please contact our support team.