Get Payment Detail List
Transactions of a Single Master Payment Record
Service Address
/PaymentDealer/GetDealerPaymentTrxDetailListMarketPlace
What Is It Used For?
This service allows listing Transactions belonging to a single master payment record. Both the main payment record and the Transaction record information are returned. For example, if a successful payment was made on 15.01.2021 and a successful partial refund was made on 21.01.2021, If you provide the code of the relevant payment to this service, you can list the main payment record information and 2 transaction records (payment record and return record) of that main payment.
Request Parameters
PaymentDealerAuthentication
Parameter | Explanation |
---|---|
DealerCode(string) | Dealer code issued by the Moka system |
Username (string) | Api username given by Moka system |
Password (string) | Api password given by Moka system |
CheckKey (string) | The control key (DealerCode + "MK" + Username + "PD" + Password) is created by passing this information, combined as a String, through the SHA-256 hash algorithm. Click here to go to the trial screen. |
PaymentDealerRequest
Parameter | Explanation |
---|---|
PaymentId (string) | The Id of the payment record in the Moka system. It is a Unique ID that appears in the list returned to you with the reseller payment list service. In order to query the details of the payment, you must either provide this ID or your own Unique ID (OtherTrxCode). |
OtherTrxCode (string) | When sending payment, if you have sent your own system's Unique Transaction Number of this transaction to Moka, you can make a payment detail query using this field. In order to query the details of the payment, you must provide either this field or the DealerPaymentId field |
SubDealerId (integer) (optional) | It is the sub-dealer's number. If this field is not sent, all transactions belonging to the parent dealer are listed. |
Sample Request (JSON)
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"PaymentId":"41745",
"OtherTrxCode":"",
"SubDealerId":"1803"
}
}
Successful Request Result
If the sent request data has been processed successfully in Moka, "Success"information is written in the "ResultCode" field of the return object . In the "Data" field, the result of the operation returned from Moka is found. The status of the operation is checked by checking the "IsSuccessful" (true/false) field in "Data" . If this field returns false, it can be seen why the operation failed by checking the ResultCode and ResultMessage fields in the same object. "IsSuccessful" : If true, the detail information of the payment is returned in the "PaymentDetail" object.
The Payment master record statuses returned with the PaymentDetail Object are as follows;
PaymentStatus | TrxStatus | Explanation |
---|---|---|
0 - Standby | 0 - Standby | Awaiting payment confirmation |
1 - Pre-Provision | 1 - Successful | Pre-Provision successful |
1 - Pre-Provision | 2 - Failed | Pre-Provision failed |
2 - Payment | 1 - Successful | Payment successful |
2 - Payment | 2 - Failed | Payment failed |
3 - Cancel | 1 - Successful | Cancellation successful |
4 - Full Refund | 1 - Successful | Return successful |
Payment detail record statuses returned in PaymentTrxDetailList Array are as follows;
TrxType | TrxStatus | Explanation |
---|---|---|
1 | 1 | Pre-Provision successful |
1 | 2 | Pre-Provision failed |
2 | 1 | Payment successful |
2 | 2 | Payment failed |
3 | 1 | Cancellation successful |
3 | 2 | Cancel failed |
4 | 1 | Return successful |
4 | 2 | Return failed |
PaymentReason | 0 : Not a payment transaction (cancellation or refund) 1 : Payment transaction |
VoidRefundReason | Cancellation is the field that shows why the refund was made. 0 : Cancellation is not a refund process (This code is meaningless because it is a payment process) 2 : External Manual cancellation / refund process (Cancellation via Pos.moka.com or api) 3 : Internal Manual cancellation / refund process (operation made from Moka administration panel) |
If the full payment is refunded, it changes to PaymentStatus = 4 in the master payment record. If a partial refund is made, the status of the payment remains PaymentStatus = 2.
In the main payment record, the amount of the payment is written in the Amount field, and the total amount of the refunds related to this payment is written in the RefAmount field.
The Amount field in the Trx records for this main payment is defined according to the type of the Trx record. If TrxType = 2, the Amount field displays the payment amount, as it is a payment detail. If TxType = 4, the Amount field displays the refund amount because it is a refund detail.
An example showing the relationship between the main payment record and the detail records:
There may be one or more detail records (Transaction records) referring to a single master payment record. When a transaction record is added, the status of the master payment record may change or remain the same.
As can be seen in this example, on January 15, a payment of 100 liras was sent in 3D and a successful result was obtained. Then, on January 18, a refund of 30 liras was attempted, but was unsuccessful. Then the same return was tried again and was successful. Since there was a partial refund, the status of the main payment record remained as "Successful Payment". Then, on January 22, another successful portion of 20 liras was returned. And finally, on January 25, all the remaining money was returned. And the status of the main payment record has changed to “Successful Full Refund”.
Successful Result Example
{
"Data":{
"IsSuccessful":true,
"ResultCode":"00",
"ResultMessage":"",
"ListItemCount":1,
"PaymentDetail":{
"DealerPaymentId":41745,
"OtherTrxCode":"20181205102510",
"CardHolderFullName":"elif yetimoğlu",
"CardNumberFirstSix":"526955",
"CardNumberLastFour":"4444",
"PaymentDate":"2018-12-05T10:25:09.737",
"Amount":10.00,
"RefAmount":0.00,
"CurrencyCode":"TL",
"InstallmentNumber":0,
"DealerCommissionAmount":4.28,
"DealerGroupCommissionAmount":0.0,
"IsThreeD":true,
"Description":"",
"PaymentStatus":0,
"TrxStatus":0,
"SubPaymentList":[
{
"DealerPaymentDealerId":14753,
"DealerId":1803,
"Amount":7.00,
"RefAmount":0.00,
"DealerCommissionAmount":2.11,
"DealerGroupCommissionAmount":0.19
},
{
"DealerPaymentDealerId":14754,
"DealerId":1804,
"Amount":3.00,
"RefAmount":0.00,
"DealerCommissionAmount":2.17,
"DealerGroupCommissionAmount":0.08
}
]
},
"PaymentTrxDetailList":[
{
"DealerPaymentTrxId":21409,
"TrxCode":"c681e036-a39e-40a4-88c7-dcd7fe25bedf",
"TrxDate":"2018-12-05T10:25:09.75",
"Amount":10.00,
"TrxType":0,
"TrxStatus":0,
"PaymentReason":1,
"VoidRefundReason":0,
"VirtualPosOrderId":"",
"ResultMessage":"",
"SubPaymentTrxList":[
{
"DealerPaymentTrxDealerId":19905,
"DealerPaymentDealerId":14753,
"DealerId":1803,
"Amount":7.00,
"DealerCommissionAmount":2.11,
"DealerGroupCommissionAmount":0.19
},
{
"DealerPaymentTrxDealerId":19906,
"DealerPaymentDealerId":14754,
"DealerId":1804,
"Amount":3.00,
"DealerCommissionAmount":2.17,
"DealerGroupCommissionAmount":0.08
}
]
}
]
},
"ResultCode":"Success",
"ResultMessage":"",
"Exception":null
}
Failed Request Result
If the sent request data could not be processed in Moka streams, the "ResultCode" field of the return object contains one of the error codes in the table below.
When an unexpected software error occurs, EX is written in the "ResultCode" field and the error message (Exception) is displayed in the "ResultMessage" field
In both cases, the "Data" object arrives as null.
ResultCode | Explanation |
---|---|
PaymentDealer.CheckPaymentDealerAuthentication.InvalidRequest | The CheckKey may be bad, or the object may be bad, or the JSON may be corrupt. |
PaymentDealer.CheckPaymentDealerAuthentication.InvalidAccount | No such dealer was found. |
PaymentDealer.GetDealerPaymentTrxDetailListMarketPlace.PaymentNotFound | If Payment Id is blank, 0 or sent in wrong format.td> |
PaymentDealer.GetDealerPaymentTrxDetailListMarketPlace.InvalidRequest | If Payment Id and Other Trx Code parameters are sent blank. |
PaymentDealer.GetDealerPaymentTrxDetailListMarketPlace.DealerNotAuthorized | The dealer is not allowed. |
EX | An unexpected error has occurred |
Example of Failed Result
{
"Data":null,
"ResultCode":"PaymentDealer.CheckPaymentDealerAuthentication.InvalidAccount ",
"ResultMessage":"",
"Exception":null
}