Skip to main content

Payment creation scenario (Redirect scenario)

In this scenario, you choose the payment method on your side, and the payer enters the payment data on the Feennex side. You can accept payments through the Feennex wallet or third-party payment methods.

You need to implement the payment method selection yourself and notify the payer of the payment results.

The API endpoints you use depend on the chosen payment method.

Example of implementation:

  1. The payer on your side proceeds to payment (for example, clicks a button).
  2. You create a payment, receive the URL of the payment page in response, and redirect the payer to the URL.
  3. The payer on the payment page enters bank card and wallet data or sees details for the transfer.
  4. The payer makes the payment.
  5. Feennex redirects the payer back to the completion page on your side.

Payment process for Feennex Wallet payment

Payment process for card payment

Important! Make sure that you have completed all the preparatory steps before starting the integration.

For API integration, you need to create a payment, obtain a link to the payment page, and redirect the payer to this page.

Payment via Feennex Wallet

Note: For payment via Feennex Wallet, use endpoints for receiving payments with Feennex Wallets. Such methods have the prefix bill in the URL.

Step 1. Create a payment. In the request, send the amount, currency, payment direction, your shop ID, and order ID. Send the signature in the sign parameter.

Example request:

curl https://core.feennex.com/bill/create \
-H 'Content-Type: application/json' \
-d '{
"shop_currency": 680,
"sign": "66c8d27b887",
"payway": "feennex_usd",
"payer_currency": 643,
"shop_amount": 1000,
"shop_id": 5,
"shop_order_id": 4127
}'

You can include URLs for your success and failure pages in the request to redirect the payer after payment, along with a URL where Feennex will send notifications.

Before transmitting the URLs, make sure that you have removed old addresses from your account settings that were specified when creating the shop – these addresses have higher priority. More details about shop configuration

Step 2. Redirect the payer to the url returned in the response in the data object. This is a link to the Feennex payment page, where the payer will enter Feennex Wallet details and confirm the payment.

Example response

{
"data":{
"created": "Tue, 20 Feb 2024 13:58:35 GMT",
"id": 123,
"lifetime": 43200,
"payer_account": null,
"payer_currency": 840,
"payer_price": 1000.0,
"shop_amount": 1000.0,
"shop_currency": 840,
"shop_id": 5,
"shop_order_id": "4127",
"shop_refund": 930.0,
"url": "https://example.com"
},
"error_code":0,
"message":"Ok",
"result":true
}

If the payment is successful, Feennex performs the following actions:

  • Changes the payment status to Paid
  • Redirects the payer to the success page you provided in the request or specified in your shop settings in the dashboard
  • Sends a callback about the success to the URL you provided in the request or specified in your shop settings in the dashboard

If something goes wrong, Feennex performs the following actions:

  • Changes the payment status to Expired or Canceled
  • Redirects the payer to the failure page you provided in the request or specified in your shop settings in the dashboard
  • Sends a notification about the failure to the URL you provided in the request or specified in your shop settings in the dashboard

Additionally, you can check the payment status when paying with a wallet.

Payments via other methods

Note: For payments made with any methods besides the Feennex wallet, you need to use the Create payment endpoint. Send the request to a URL with the invoice prefix.

Step 1. Create a payment. In the request, include the amount, currency, payment direction, your shop's identifier, and order identifier. Send the request signature in the sign parameter.

Example request

curl https://core.feennex.com/invoice/create \
-H 'Content-Type: application/json' \
-d '{
"currency": 840,
"sign": "c438896efecd63",
"payway": "card_usd",
"email": "[email protected]",
"amount": 1000,
"shop_id": 5,
"shop_order_id": 4126
}'

In the request, you can additionally send URLs for your success and failure pages to redirect the payer after payment, as well as the URL to which Feennex will send notifications.

Before transmitting the URLs, ensure that you have removed any old addresses from your account settings specified when creating the shop, as these addresses have higher priority. More details about shop setup

Step 2. Redirect the payer to the url returned in the response in the data object. This link leads to a external payment system where the payer will enter their details and confirm the payment.

Example response

{
"data":{
"data":{
"language":"en",
"mdOrder":"0304a352-12c0-45bf-9ee8-694a2a381bcb"
},
"id":497063651,
"method":"GET",
"url":"https://payment-link-example.ru"
},
"error_code":0,
"message":"Ok",
"result":true
}

If the payment is successful, Feennex performs the following actions:

  • Changes the payment status to success
  • Redirects the payer to the success page you provided in the request or specified in the settings of your shop in your dashboard
  • Sends a notification about the success to the URL you provided in the request or specified in your dashboard

If something goes wrong, Feennex performs the following actions:

  • Changes the payment status to Rejected or another status indicating an error
  • Redirects the payer to the failure page you provided in the request or specified in the settings of your shop in your dashboard
  • Sends a notification about the failure to the URL you provided in the request or specified in your dashboard

Additionally, you can check the payment status when paying by bank card.