1. Initiate Payment (By ID)
It is a method used to initiate payments with connected APM providers. This method requires an external connection Id. You can obtain the relevant Id information using the "List" method.
Initiate Payment (ID)
POST
{{Base Adres}}/api/paywall/apm/pay/byid
The headers parameters that need to be sent to the service are as follows:
apikeypublic
string
Yes
The Public Key obtained from the merchant panel.
apiclientpublic
string
Yes
The Public Client obtained from the merchant panel.
The parameters that need to be sent to the service in the BODY are as follows:
ApmId
int
Yes
The connection identifier (connection ID) of the APM provider. This is returned during the listing process.
MerchantUniqueCode
string
Yes
The unique identifier you've created for the payment
MerchantSuccessBackUrl
string
Yes
The address where the successful result of your payment will be communicated. The response will be received in the POST body.
MerchantFailBackUrl
string
Yes
The address where the successful result of your payment will be sent. You will receive the response in the POST body.
Amount
decimal
Yes
The payment amount
Description
string
Yes
Description of the payment. Depending on the provider, this description may be displayed on the payment screen.
An example JSON file to be sent to the service is as follows:
{
"ApmId": 1,
"CurrencyId": 1,
"MerchantUniqueCode": "TESTMERCHANTUNIQUECODE",
"MerchantSuccessBackUrl": "https://webhook.site/38a6fa6f-3414-40db-b2a7-a6c38894b6a3",
"MerchantFailBackUrl": "https://webhook.site/38a6fa6f-3414-40db-b2a7-a6c38894b6a3",
"Amount": 1,
"Description": "test",
"Payer": {
"Fullname": "",
"CardNumber": "",
"CardId": "",
"Phone": "",
"Email": "",
"UserIdentity": "",
"ConsumerIdentity": "",
"Birthday": null
},
"Products": [
{
"ProductId": "123",
"ProductName": "Name",
"ProductCategory": "Food",
"ProductDescription": "Description of Product",
"ProductAmount": 1
}
]
}
The parameters returned from the service are as follows:
ErrorCode
int
Error code. If the transaction is successful, it returns a value of '0'.
Result
bool
It returns a boolean value where 'true' indicates a successful transaction.
Message
string
If the transaction fails, this message specifies the error and provides language support based on the 'locale' parameter.
Body
object
If the transaction fails, this object provides details about the error.
{
"ErrorCode": 0,
"Result": true,
"Message": "",
"Body": {
"RedirectUrl": "https://dev-payment-agent.itspaywall.com/paywall/callbackapm?UniqueNumber=dd224827-8433-45f7-9454-97025e57fa9e",
"Transaction": {
"ApmTransactionId": 29,
"UniqueCode": "dd224827-8433-45f7-9454-97025e57fa9e",
"MerchantUniqueCode": "TESTMERCHANTUNIQUECODE",
"Amount": 1.0
}
}
}
Last updated