3. Add Card

You can use this service to allow your user to add a card to Masterpass.

Add Card

POST {{Base Address}}/api/paywall/masterpass/card/add

It will be sufficient to send a request to the address provided above. You can use the 'Base Address' for both the Test environment and the Production environment as you wish.

Important: To use the Masterpass - Add Card service, you must include the parameters 'apikeyprivate' and 'apiclientprivate' in the 'Header' field.

PaymentAPI Address

Parameter
Type
Mandatory
Description

apikeyprivate

string

Yes

The Private Key obtained from the merchant panel.

apiclientprivate

string

Yes

The Private Client obtained from the merchant panel.

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

Parameter
Type
Mondatory
Description

CardAlias

string

Yes

The nickname given to the card by the user.

CardHolderName

string

Yes

The name of the cardholder.

CardNumber

string

Yes

Card number

ExpiryMonth

string

Yes

Card Expiry - Month

ExpiryYear

string

Yes

Card Expiry - Year

Cvv

string

Yes

Card CVV information

SessionId

Guid

Yes

Session ID information

{
    "CardAlias": "{{$guid}}",
    "CardHolderName": "Kart Sahibi Adı",
    "CardNumber": "5528790000000008",
    "ExpiryMonth": "12",
    "ExpiryYear": "2030",
    "Cvv": "123",
    "SessionId": "2193433e-f36b-1410-825e-001264113a90"
}

Response returned from the service:

Parameter
Type
Description

Body

object

JSON containing payment details (optional)

ErrorCode

int

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

Result

bool

Returns either true or false. If the transaction is successful, it returns true.

Message

string

If the transaction fails, this is the error message provided, with language support according to the locale parameter.

Body > Masterpass > Result > StatusCode ve Body > Masterpass > Result > ResponseCode The flow must be established by checking the parameter under the directory.

  • Masterpass ResponseCode List

{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Session": {
            "SessionRenewed": false,
            "SessionId": "a327433e-f36b-1410-80e5-004205aa382d"
        },
        "Masterpass": {
            "Result": {
                "RetrievalReferenceNumber": "100005844108",
                "ResponseCode": "5001",
                "Description": "Telefonunuza gelen tek kullanımlık şifreyi girerek kart doğrulama işlemini tamamlayınız",
                "Token": "7e6db5a88fe248ada3d20adc493035e4",
                "Url3d": null,
                "Url3dSuccess": null,
                "Url3dFail": null
            },
            "BuildId": "83",
            "CorrelationId": "7c18d334-2dc3-4ed6-931f-1ae16c4a2886",
            "Exception": null,
            "Message": "Accepted",
            "RequestId": null,
            "StatusCode": 202,
            "Version": null
        }
    }
}

Last updated