Calculating the Amount to be Withdrawn from the Card
Service Address
/PaymentDealer/DoCalcPaymentAmount
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 |
BinNumber (string) |
First 6 digits of Credit Card Number |
Currency (decimal) |
Currency (If this parameter is not sent, it will receive 'TL' by default.) |
OrderAmount (decimal) |
Basket Amount |
InstallmentNumber (decimal) |
Number of Installments |
GroupRevenueRate (decimal) |
Group Income Ratio |
GroupRevenueAmount (decimal) |
Group Income Amount |
IsThreeD (bool) |
0: Payment without 3D, 1: Payment in 3D |
Returns
ResultCode | Explanation |
PaymentAmount (decimal) | Amount to be Collected from Card |
DealerDepositAmount (decimal) | Basket Amount |
DealerCommissionRate (decimal) | Commission Rate Given to Sub-Dealer |
DealerCommissionAmount (decimal) | Sub-Dealer Commission Amount |
DealerCommissionFixedAmount (decimal) | Sub-Dealer Commission Fixed Amount |
DealerGroupCommissionRate (decimal) | Commission Rate Given to Top Dealer |
DealerGroupCommissionAmount (decimal) | Top Dealer Commission Amount |
DealerGroupCommissionFixedAmount (decimal) | Top Dealer Commission Fixed Amount |
GroupRevenueRate (decimal) | Group Income Ratio |
GroupRevenueAmount (decimal) | Group Income Amount |
BankCard (Array) |
BankName (string) | The bank that owns the bin number (Issuer Bank) – Listed below |
BankCode (string) | Bank's national code – Available in the list below(*) |
BinNumber (string) | Bin number given to the service |
CardName (string) | If the card has a special name, it is written in this field. |
CardType (string) | Returns MASTER, VISA, MAESTRO, AMEX, TROY |
CreditType (string) | Returns as CreditCard or DebitCard |
CardLogo (string) | The program logo of the card rotates (Bonus logo, Axess logo etc.) |
CardTemplate (string)) | The image of the card rotates |
ProductCatagory (string)) | Commercial or Personal information of the card returns |
GroupName (string) | The program name of the card returns (BONUS, AXESS, WORLD, CARDFINANS etc.) |
|
Sample Request (JSON)
{
"PaymentDealerAuthentication":{
"DealerCode":"XXXX",
"Username":"XXXX",
"Password":"XXXX",
"CheckKey":"28ba1f316e661ee7a0477a13aa30613da548c94a8098829af9255b04d7e916e3"
},
"PaymentDealerRequest":{
"BinNumber":"526911",
"Currency":"TL",
"OrderAmount":100,
"InstallmentNumber":1,
"GroupRevenueRate":5,
"GroupRevenueAmount":"",
"IsThreeD":1
}
}
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 transaction returned from the bank 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 on the virtual pos by checking the ResultCode and ResultMessage fields in the same object.
Successful Result Example
{
"Data":{
"PaymentAmount":101.56,
"DealerDepositAmount":95.0,
"DealerCommissionRate":6.46,
"DealerCommissionAmount":6.56,
"DealerCommissionFixedAmount":0.0,
"DealerGroupCommissionRate":1.54,
"DealerGroupCommissionAmount":1.56,
"DealerGroupCommissionFixedAmount":0.00,
"GroupRevenueRate":5.0,
"GroupRevenueAmount":5.0,
"BankCard":{
"BankName":"FİNANSBANK",
"BankCode":"111",
"BinNumber":"526911",
"CardName":"",
"CardType":"MASTER",
"CreditType":"CreditCard",
"CardLogo":"",
"CardTemplate":"",
"ProductCategory":"Bireysel",
"GroupName":""
}
},
"ResultCode":"Success",
"ResultMessage":"",
"Exception":null
}
Failed Request Result
ResultCode | Explanation |
PaymentDealer.DoCalcPaymentAmount.InvalidRequest | The CheckKey may be bad, or the object may be bad, or the JSON may be corrupt. |
PaymentDealer.DoCalcPaymentAmount.RequiredOrderAmount | Cart amount required |
PaymentDealer.DoCalcPaymentAmount.InvalidCurrencyCode | Currency required |
PaymentDealer.DoCalcPaymentAmount.InvalidInstallmentNumber | The installment number is invalid |
PaymentDealer.DoCalcPaymentAmount.VirtualPosCommissionRateNotFound | Virtual pos commission rate could not be found. |
PaymentDealer.DoCalcPaymentAmount.InstallmentNotAvailableForForeignCurrencyTransaction | Installment transaction is not valid for foreign currency. |
PaymentDealer.DoCalcPaymentAmount.DealerDoNotBinNumberInquiryAllowed | The dealer does not have permission to query Bin number. |
PaymentDealer.DoCalcPaymentAmount.BinNumberMustGiven | The bin number must be given. |
PaymentDealer.DoCalcPaymentAmount.BothGroupRevenueRateAndGroupRevenueAmountMustBeZero | Both the group income ratio and the group income amount must be 0. |
EX | An unexpected error has occurred |
Example of Failed Result
{
"Data":null,
"ResultCode":"PaymentDealer.DoCalcPaymentAmount.BothGroupRevenueRateAndGroupRevenueAmountMustBeZero",
"ResultMessage":"",
"Exception":null
}
Explanation
This service has been developed to calculate the amount to be withdrawn from the card and the sub-dealer's commission rate. The top dealer (Marketplace owner) writes how much profit they want to make on the basket amount (OrderAmount) using this service (as a percentage or TL (GroupRevenueRate or GroupRevenueAmount) ), how much to withdraw from the card (PaymentAmount) and the commission rate of the sub-dealer (DealerCommissionRate). can learn what to do. Accordingly, it can send a marketplace payment using commission scenario 2.
In the example above, the basket amount is 100 TL and the top dealer wants to make a 5% profit on this amount. In other words, he wants to deposit 95 TL to the dealer. For this, information about which card to shoot, the number of installments and whether it is 3D or not should also be sent. Accordingly, the commission rate given to the top dealer is found and the calculations are made accordingly.
In the example, the amount to be withdrawn from the card is 101.56 TL and the sub-dealer commission rate is 6.46%. After that, it is necessary to send the Marketplace payment and give the sub-dealer rate as 6.46% with scenario number 2.
In other words, out of 101.56 liras, 1.56 liras will be bought by the top dealer, 5 liras will be bought by the top dealer, and a total of 6.56 lira will be deducted and 95 lira will be deposited to the lower dealer (For example, the top dealer commission rate for this debit card, that is, the income of the mocha is 1.54%.)
NOTE:
Merchants that do not belong to any group do not need to send the GroupRevenueRate and GroupRevenueAmount parameters.
ISSUER BANK LIST