9. Initiate Payment
You can use this service to initiate a payment through Masterpass.
Initiate Payment
POST
{{Base Address}}/api/paywall/masterpass/payment/init
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.
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:
SessionId
Guid
Yes
Session ID information
{
"SessionId": "8496433e-f36b-1410-825e-001264113a90",
"Force3D": false,
"AutoCommit": true,
"PaymentDetail": {
"Amount": 50,
"MerchantUniqueCode": "{{$guid}}",
"TrackingCode": "test1132412341412341234--1243-14-23-41-324-123-4",
"CurrencyId": 1,
"MerchantSuccessBackUrl": "https://webhook.site/2132fe83-9f0d-461d-ae18-85e9d4a8b0ec",
"MerchantFailBackUrl": "https://webhook.site/2132fe83-9f0d-461d-ae18-85e9d4a8b0ec",
"ClientIP": "34.123.2.45",
"Installment": 1,
"ChannelId": 0,
"TagId": 0,
"PayWatch": null,
"PayWatchMultipleSupport": false,
"PayWatchMultiple": null
},
"Card": {
"IsSavedCard": true,
// For SavedCard
"CardAlias": "55daa93d-4a99-45de-9431-bb93d0bbf92e",
"CardBin": "552879",
"CardMasked": "552879********08",
// For not SavedCard
"OwnerName": "test",
"Number": "5528790000000008",
"ExpireMonth": "12",
"ExpireYear": "2030",
"Cvv": "123"
},
"Customer": {
"IdentityNumber": "11111111110"
},
"Products": [
{
"MemberId": 994,
"MemberEarningCalculated": false,
"MemberEarning": 138,
"MemberCustomCommission": false,
"MemberCommission": 5,
"ProductId": "1-1-1-1234342342------1--7-8-9",
"ProductName": "Nakliye Hizmeti",
"ProductCategory": "123",
"ProductDescription": "Nakliye 123",
"ProductAmount": 50,
"DiscountOwnerType": 0,
"DiscountType": 0,
"DiscountValue": 0,
"CargoType": 0,
"CargoCurrencyId": 0,
"CargoCost": 0
}
]
}
Response returned from the service:
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.
{
"ErrorCodeType": 1,
"ErrorMessage": null,
"ErrorCode": 0,
"Result": true,
"Message": "Success",
"Body": {
"Session": {
"SessionRenewed": false,
"SessionId": "dc27433e-f36b-1410-80e5-004205aa382d"
},
"Masterpass": {
"Paywall": {
"MasterpassPaymentId": "e9b18fc1-1915-4876-8ad8-c1aafada747f",
"PaymentId": 6618969,
"ActivityId": 14597573,
"UniqueCode": "9ee137ed-8dba-414e-9115-ee2cc774acf5",
"MerchantUniqueKey": "ecae9baa-ba88-441e-b99e-42dd79aef4b5",
"PaymentGatewayId": 4142,
"PaymentGatewayName": "Masterpass",
"PaymentGatewayProviderName": "Masterpass",
"Products": [
{
"Id": 6962735,
"MemberId": 0,
"MemberEarningCalculated": false,
"MemberEarning": 0.0,
"ProductId": "1-1-1-1234342342------1--7-8-9",
"ProductName": "Nakliye Hizmeti",
"ProductCategory": "123",
"ProductDescription": "Nakliye 123",
"ProductAmount": 50.0
}
]
},
"Provider": {
"IsOtp": false,
"IsThreeD": true,
"ThreeDAddress": "https://dev-payment-agent.itspaywall.com/paywall/callbackmasterpass?UniqueNumber=e9b18fc1-1915-4876-8ad8-c1aafada747f",
"Detail": {
"Result": {
"ResponseCode": "5010",
"Description": "Telefonunuza gelen tek kullanımlık şifreyi girerek işleminizi tamamlayınız",
"Token": "e85525f1077640ba8ba2423f2c1ffc41",
"RetrievalReferenceNumber": "200007817889",
"MaskedNumber": "************0008",
"TerminalGroupId": "78516638760698041272198"
},
"BuildId": "105",
"CorrelationId": "e3aa50c2-d749-4513-8a9b-22e151ad6da6",
"Exception": null,
"Message": "Accepted",
"RequestId": null,
"StatusCode": 202,
"Version": null
}
},
"Error": {
"ProviderErrorCode": null,
"ProviderErrorMessage": null
}
}
}
}
Last updated