Create Payment Method – EPAY

1. Initiate Card Saving #

Endpoint

URL: https://crm-api-test.10npay.com/api/v1/epay/save-card-initiate/{individualId}
Method: GET

URL Parameters

individualId (integer): The ID of the individual from the CRM database mapped with the user_id from the app.

Request
Curl Example #

curl -X 'GET' \ 'https://crm-api-test.10npay.com/api/v1/epay/save-card-initiate/590' \ -H 'accept: application/json' \ -H 'Authorization: Bearer your_token_here'

Responses #

200 Success

A URL string that redirects the user to the ePay site.

Example Response
“https://demo.epay.bg/xdev/mobile/api/start?APPID=7263798363938345851800386580252006607935300301942040476986705127&DEVICEID=590&KEY=12&UTYPE=2&lang=en”

400 Bad Request

Error details if the individual ID is invalid.

Example Error Response

{
	"errors": {
		"Error": [
			"Individual Id must be valid."
		]
	},
	"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
	"title": "Bad Request",
	"status": 400,
	"traceId": "00-f3220977b746de7ffdb69ccf10832ce9-a79a1e023f1eb319-01"
}

Notes #
  • The URL provided by the endpoint should be followed.
  • The only card that can be used for testing purposes is VISA 4341792000000044 with authorization code 111111.
Snippet #
API Properties
Header parameters
Result of the call

2. Confirm Card Saving #

Endpoint

URL: https://crm-api-test.10npay.com/api/v1/epay/save-card-confirm

Method: POST

Requests #

Request Body

{
	"userId": 590,
	"requestId": 1
}

curl -X 'POST' \ 'https://crm-api-test.10npay.com/api/v1/epay/save-card-confirm' \ -H 'accept: */*' \ -H 'Authorization: Bearer your_token_here' \ -H 'Content-Type: application/json-patch+json' \ -d '{ "userId": 590, "requestId": 1 }'

Responses #

200 Success

Empty response indicating success.

400 Bad Request

Error details if the request is invalid.

Example Error Response

{
	"errors": {
		"Error": [
			"Invalid request."
		]
	},
	"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
	"title": "Bad Request",
	"status": 400,
	"traceId": "00-4b03d5f0f5fe80f1c1eac304d84cd582-d75aa7dcec7b672d-01"
}

3. Usage of Saved Card #

Once the card details are saved successfully, the user can use the saved card payment method for future transactions within the wallet application. The following steps outline the manual execution process:

Redirect to ePay Site:
Call the save-card-initiate endpoint to get the ePay URL.
Redirect the user to the provided ePay URL.
The user enters the required card payment method data on the ePay site.

Save Card Payment Method:
After the user saves the card payment method successfully, they will be redirected back to the wallet app.
Call the save-card-confirm endpoint to save the token (card info) to Flexcube using the provided userId and requestId.

Make Payments with Saved Card:
Use the saved card payment method for transactions by calling the pay-with-token endpoint in the wallet app.

Important Notes
The only available card that can be used is 4341792000000044.
The card expiration date should be in the future.
The cardholder name and CVV can be any valid values.

By following these steps, users can securely save their card details and use them for seamless transactions within the 10NPay wallet application.

Save card snippet #

Powered by BetterDocs