1. Initiate Payment

This is a method you can use to initiate payments based on DirectPay with connected APM providers.

Initiate Payment (Id)

POST {{Base Adres}}/api/paywall/apm/pay

Important: To use the APM Payment Initiation (DirectPay) service, you need to include 'apikeypublic' and 'apiclientpublic' parameters in the 'Header' field.

PaymentAPI Address

The parameters that need to be sent to the service in the headers are as follows:

Parameter
Type
Compulsory
Description

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:

Parameter
Type
Compulsory
Description

ApmKey

int

Yes (Conditional)

The Key information of the APM provider.

Bkz: APM

ApmConnectionId

int

Yes (Conditional)

The Id (identifier) information of the connections obtained through the APM listing service. You can initiate payments through the relevant connection using this parameter when dynamically generating your payment screen scenarios.

CurrencyId

int

Yes

The currency in which the payment is intended to be processed. Bkz: Currency Units

SectorId

short?

No

The sector information where the payment will be processed. Shared with providers.

Sectors

MerchantUniqueCode

string

Yes

The unique identifier you've generated for the payment.

Amount

decimal

Yes

The payment amount.

Description

string

Yes

The description of the payment. Depending on the provider, this description can be displayed on the payment screen.

Payer

Payer

Yes

This object contains the payer information for the payment. The parameters under this object may vary depending on the requirements of the provider. Example: For a provider that expects CardNumber, the Paywall API makes CardNumber parameter mandatory.

Products

List<Products>

No

It will be useful for sending, reporting, and tracking purposes. If these details are sent, the total amount of the sent products is compared with the actual transaction amount. However, if they are not sent, no comparison is made.

Provider:Parameters

Dynamic

Yes/No

If there are dynamic details expected by the provider at the time of payment, such information is obtained externally and shared with the providers. For example, if a provider expects information like store code or store identity, Paywall API verifies and enforces these details as mandatory.

Here is an example JSON file to be sent to the service:

{
    "ApmKey": "FoodCardProvider",
    "ApmConnectionId": 19,
    "CurrencyId": 1,
    "MerchantUniqueCode": "A1s2d3F4G5H6J7K8L9",
    "Amount": 1,
    "Description": "PW",
    "Payer": {
        "Fullname": "",
        "CardNumber": "",
        "CardId": "",
        "Phone": "",
        "Email": "",
        "UserIdentity": "",
        "ConsumerIdentity": "",
        "Birthday": null
    },
    "Products": [
        {
            "ProductId": "123",
            "ProductName": "Name",
            "ProductCategory": "Food",
            "ProductDescription": "Description of Product",
            "ProductAmount": 1
        }
    ],
    // MarketPlace tipindeki sağlayıcılar içindir,
    // kullanılmaması durumunda null gönderilebilir
    "Provider": {
        // Dynamic
        "Parameters": {
            "MerchantCode": "**********",
            "TerminalCode": "**********"
        }
    }
}

The parameters returned from the service are as follows:

Parameter
Type
Description

ErrorCode

int

Error code. Returns a value of '0' if the operation is successful.

Result

bool

Returns a value of true or false. Returns true if the operation is successful.

Message

string

If the operation fails, this message specifies the error and provides language support according to the locale parameter.

Body

object

If the operation fails, this is the detailed object regarding the error.

Important: If the PendingOtpConfirm parameter is TRUE, you must confirm the payment along with the request on the Payment Confirmation page.

{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "ApmKey": "FoodCardProvider",
        "ApmConnectionId": 21,
        "ApmTransactionId": 4330,
        "UniqueCode": "85a07d7e-adc4-4698-a4cb-e643bdd705b1",
        "MerchantUniqueCode": "G5H6A4FKAJDLF3457394759834",
        "Amount": 1.0,
        "PendingOtpConfirm": true, // If its FALSE, No need OTP confirmation
        "ProviderDummyResponse": {
            "ErrorCode": 0,
            "Body": {
                "Success": true,
                "Code": null,
                "Message": null,
                "Status": 0,
                "OtpVerifyCounterInSeconds": 0,
                "Id": 58612,
                "ServiceId": 1000,
                "BatchNo": 102,
                "TransactionSequenceNumber": 35298,
                "TransactionAmount": 100,
                "TransactionApprovalCode": "000000004330",
                "LoyaltyMessage": "",
                "Hash": "fe556fe622f3a3aa2b484666b2d7887c54932a9f469f016c3d00b740ed36de95"
            },
            "HttpCode": 200
        }
    }
}

Last updated