🔐2. Authorization / SDK

For client-side operations, you need to obtain a temporary token from the server. You can retrieve this token from your server using the following endpoint and parameters.

TempToken/Sdk

The TempToken/Sdk service, unlike the TempToken service, has customized request and response parameters designed specifically for use in Paywall SDKs. For operations to be performed within the SDKs,

POST {{Base Adres}}/api/paywall/temptoken/sdk

Important: To use the TempToken/Sdk service, you must include the 'apikeypublic' and 'apiclientpublic' parameters in the Header. PaymentAPI Address

Parameter
Type
Compulsory
Description

apikeypublic

string

Yes

The Public Key you obtained from the merchant panel.

apiclientpublic

string

Yes

The Public Client you obtained from the merchant panel.

The parameters to be sent to the service are as follows:

Parameter
Scope
Compulsory
Description

boolean

Yes

Will the token be used on the client side for card storage?

boolean

Yes

Will the token be used on the client side to perform 3D transactions?

boolean

Yes

Will the token be used for Paywall’s client-side library?

boolean

Yes

You should use the Scope parameter to define the token’s permissions.

int

Yes/No

Token Permissions

0 = None 1 = ClientCardSave 2 = ThreeDSession 3 = ClientSdk

int

Yes

How long will the token be valid?

A value can be defined between 0 and 1440 minutes.

Bool

No

If you want the Masterpass session information to be returned in the response object of the temp token creation request, this parameter must be set to true.

MasterpassSession

Yes/No

When the IncludeMasterpassSession parameter is sent as true, it becomes mandatory and must include the required information for the Masterpass session.

The sample JSON and code snippets to be sent to the service are as follows:

{
    "ClientCardSave": true,
    "ThreeDSession": false,
    "ClientSdk": true,
    "ScopeBased": false,
    "Scope": 0,
    "ExpiryMin": 1440,
    "IncludeMasterpassSession": true,
    "MasterpassSession": {
        "ReferenceCode": "{{$guid}}",
        "UserId": "%UserId%", // Kullanıcının sisteminizdeki tekil kimlik bilgisi
        "UserPhone": "%UserPhone%", // Kullanıcının sisteminizdeki doğrulanmış telefon numarası
        "Force3D": false, // Kullanıcı tüm ödeme akışında 3D'ye zorlansın mı?
        "PhoneVerifiedByMerchant": true // Telefon doğrulaması yapıldı mı?
    }
}

The parameters returned from the service are as follows:

Parameter
Type
Description

ErrorCode

int

Error code. Returns '0' if the operation is successful.

Result

bool

Returns either a true or false value. If the operation is successful, it returns true.

Message

string

If the operation fails, this is the error message describing the issue. It provides language support based on the locale parameter.

Body

object

Transaction detail information.

Last updated