3D Secure Payment
Service Address
/PaymentDealer/DoDirectPaymentThreeDMarketPlace
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 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CardHolderFullName (string) | Card holder's name | ||||||||||||||||||||
CardNumber (string) | Card number | ||||||||||||||||||||
ExpMonth (string) | Expiry date month information (MM) | ||||||||||||||||||||
ExpYear (string) | Expiry date year information (YYYY) | ||||||||||||||||||||
CvcNumber (string) | card security number | ||||||||||||||||||||
CardToken (string) | If the Card storage feature is used on the Moka, withdrawals can be made by giving the Token of the
Card. If a token has been issued, it is not necessary to provide the card number and other card
information (expiry date, cvc). Note: If a NonSecure (Non-3D) transaction is desired while making a payment with tokens, this parametric authorization can be requested from Moka, and Non3D marketplace payment service can also be used. |
||||||||||||||||||||
Amount (decimal) | Total payment amount (Kurus part is written with a dot. For example: 27.50). The sum of the amount fields sent in the SubDealer block must be equal to this field.. | ||||||||||||||||||||
Currency (string) | Currency unit. Optional field, if not sent at all or empty, default is TL, Other values: USD, EUR, GBP | ||||||||||||||||||||
InstallmentNumber (integer) | Number of Installments. It is an optional field, if it is not sent at all, if it is sent blank, if 0 or 1 is sent, it means Advance sale. A value between 2 and 12 must be sent for Installment. | ||||||||||||||||||||
ClientIP (string) | IP information of the computer running the application (desktop/web) from which the card number is obtained | ||||||||||||||||||||
OtherTrxCode (string) | You can submit your own Unique Transaction Code in this field for reconciliation. (Can also be sent blank). Note: You can find out the payment status by using this code while getting the dealer payment detail list. | ||||||||||||||||||||
IsPoolPayment (tinyint) | Pool payment ? The money will be withdrawn from the credit card but will be kept in the pool. The dealer will approve the payment after the customer receives the service or product, and the payment for this transaction will be reflected on the dealer's statement after approval (optional). Set this field to 1 to send a payment in the pool system. |
||||||||||||||||||||
IsPreAuth (tinyint) | Pre-authorization process? 0 : No - Direct Capture Process 1 : Yes - Pre-authorization Process (Must be converted to payment with DoCapture service after a while) |
||||||||||||||||||||
IsTokenized (tinyint) | Will the card entered for payment be stored in the Moka system? (The dealer must be receiving card
storage service to be able to store cards) 0 : Card will not be stored 1 : Card will be kept |
||||||||||||||||||||
IntegratorId (tinyint) (optional) | ID of the System Integrator Company that integrates Moka into ready-made eCommerce packages – (If you are not an integrator company, do not send this field!) | ||||||||||||||||||||
Software (string) | The name of the e-commerce package or software that you call this service integrated with the Moka payment system. (Max 30 characters)td> | ||||||||||||||||||||
SubMerchantName (string) (optional) | Name you want to appear on statement – Moka must be notified in advance | ||||||||||||||||||||
Description (string)(optional) | Description field. If you want to write a description about the payment, it can be written in this field. (Up to 200 characters can be written.) | ||||||||||||||||||||
ReturnHash (tinyint) | Its value must be given as 1. When the 3D Payment flow is completed, your RedirectURL will be notified whether the transaction was successful or not by adding the letter T or F to the end of the CodeForHash code returned in the response of this service. | ||||||||||||||||||||
RedirectUrl (string) | As a result of the 3D transaction, the dealer web page where the successful or unsuccessful
transaction result is returned and the user is directed. While giving this URL, if you write your
own transaction ID as a parameter at the end, you will be able to determine the result of your
transaction.
Example: https://www.mysite.com/PayResult?MyTrxId=1A2B3C4DF5R Important Note : For your security, prefer your own transaction code that you write at the end of the URL to be an unpredictable code. |
||||||||||||||||||||
RedirectType (integer) | It is an optional field. Its default value is 0 (zero). The result of the payment process redirects to the home page on the website that calls the service. If this service is called from the IFrame and the result is to be redirected to the IFrame, 1 must be entered in this field. | ||||||||||||||||||||
CommissionScenario (integer)(zorunlu) | It is the commission option that is decided by the top dealer and tells how the commissions to be
deducted from the sub-dealers that have participated in this sale will be calculated. After calculating the Moka commission to be deducted from the lower dealer, the difference between the upper dealer commission amount and the lower dealer commission amount is the upper dealer's own income. These calculations are made separately for each sub-dealer that has participated in this sale, and the total commission to be deducted from the upper dealer (Moka Revenue) arising from the sale, the total commission to be deducted from the lower dealers and the total income of the upper dealer will be found. The amount to be deposited by Moka to the sub-dealer is the amount after deducting the sub-dealer's commission. There are 6 different scenarios to report the sub-dealer commission : 1 : MOKA SUB-RESELLER COMMISSION RATES (%) The top dealer uses this scenario when he wants to trade with the commission rate defined in the Moka system of the lower dealer. Therefore, it is sufficient to distribute the amount to the sub-dealers in the sale. How much commission will be deducted from each sub-dealer is calculated by looking at the commission rate defined for that sub-dealer in the Moka system. The Amount and DealerId parameters in the SubDealer block are mandatory fields. The sum of the Amounts in this block must be equal to the main Amount. The formula is as follows: Sub-dealer commission amount = (Amount * MokaSub-DealerCommission Rate / 100) 2 : INSTANT SUB-RESELLER COMMISSION RATES (%) The upstream dealer uses this scenario when he wants to instantly give the downstream dealer a new commission rate (%) for this payment. In this case, instead of the sub-dealer's commission rate in the Moka system, the calculation is made using the sub-dealer's commission rates (%) and the fixed commission amount sent in this request. Amount, DealerId and DealerCommissionRate parameters in the SubDealer block are required fields. For fixed commission amount, TL amount can be sent to DealerCommissionFixedAmount parameter when requested. (received as zero if not sent). The sum of the Amounts in this block must be equal to the main Amount. The formula is as follows : Sub-dealer commission amount = (Amount * DealerCommissionRate / 100) + DealerCommissionFixedAmount 3 : INSTANT SUB-RESELLER COMMISSION AMOUNTS (TL) The top dealer uses this scenario when he wants to instantly give a new commission amount (TL) to the sub-dealer for this payment. In this case, instead of calculating the commission rate of the sub-dealer in the Moka system, the sub-dealer commission amount (TL) sent in this request is used. When the commission deducted from the lower dealer is subtracted from the commission deducted by Moka from the upper dealer, the income of the upper dealer appears. The DealerId, Amount and DealerCommissionAmount parameters in the SubDealer block are required fields. The sum of the Amounts in this block must be equal to the main Amount. The formula is as follows : Sub-dealer commission amount = DealerCommissionAmount 4 : INSTANT TOP DEALER REVENUE RATIOS (%) If the top dealer does not want to follow the commission rate that Moka will deduct from itself or does not want to calculate according to this rate, it uses this scenario to specify how much rate (%) will be added directly on the commission rate to be deducted from itself and deducted from the lower dealer. The rate given in this scenario is the top dealer revenue rate. The DealerId, Amount, GroupRevenueRate and AmountToBeCommissioned parameters in the SubDealer block are required fields. The sum of the AmountToBeCommissioned fields given for sub-dealers must be equal to the sum of the whole sale. The commission to be deducted from the parent dealer can be loaded to different sub-dealers by numeric manipulation on the AmountToBeCommissioned field. For example, if no deductions are requested from a sub-reseller, GroupRevenueRate = 0 and AmountToBeCommissioned = 0 for that sub-reseller. The formula is as follows : Sub-dealer commission amount = (Amount * GroupRevenueRate / 100) + ( AmountToBeCommissioned * MokaTop-DealerCommission Rate / 100) + IsIncludedFixedAmount 5 : INSTANT DEALER REVENUE AMOUNT (TL) If the top dealer does not want to follow the commission rate that Moka will deduct from itself or does not want to calculate according to this rate, it uses this scenario to indicate how much amount (TL) will be added directly to the commission rate to be deducted from itself and deducted from the lower dealer. The DealerId, Amount, GroupRevenueAmount and AmountToBeCommissioned parameters in the SubDealer block are required fields. The formula is as follows : Sub-dealer commission amount = (GroupRevenueAmount) + ( AmountToBeCommissioned * MokaUp-DealerCommission Rate / 100) + IsIncludedFixedAmount The top dealer uses this scenario when he wants to tell the bottom dealer how much (TL) will be deposited instantly for this payment. In this case, neither the sub-dealer's commission rate in the Moka system is calculated, nor the sub-dealer's commission amounts or rates are given. The amount required to be deposited to the sub-dealers is given and Moka calculates the commission rates and amounts. Sub-dealer's total commission amount is found when the amount to be deposited to sub-dealers is subtracted from the Main Amount. When the commission amount to be deducted by Moka from the top dealer is subtracted, the income of the top dealer is revealed. DealerId and Amount parameter in SubDealer block are required fields. The sum of the Amounts in this block is not equal to the main Amount !!! The difference is the sum of sub-dealer commissions. The formula is as follows : Subdealer commission amount = Main Amount - SubDealer.Amount |
||||||||||||||||||||
SubDealer (Array-List)(zorunlu) |
|
||||||||||||||||||||
BuyerInformation (Array)(optional) | These are the fields related to the customer who buys a product/service from our dealer. Although it
is not mandatory to send these fields, sharing them with Moka is in the interests of both our dealer
and Moka in case of future payment related problems.
|
||||||||||||||||||||
BasketProduct (Array)(optional) |
|
||||||||||||||||||||
CustomerInformation (Array)(optional) | If card information is also desired to be stored during payment and the dealer's card storage
service is activated by Moka, then this information block can be sent to create a customer and add
the card number used for payment to this customer.
|
Sample Request (JSON)
Scenario 1
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"CardHolderFullName":"elif yetimoğlu",
"CardNumber":"5269552233334444",
"ExpMonth":"11",
"ExpYear":"2020",
"CvcNumber":"708",
"CardToken":"",
"Amount":7.5,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"20181206173427",
"SubMerchantName":"",
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20210114172139",
"RedirectType":0,
"CommissionScenario":1,
"SubDealer":[
{
"DealerId":166,
"Amount":3
},
{
"DealerId":167,
"Amount":4.5
}
]
}
}
Scenario 2
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"CardHolderFullName":"elif yetimoğlu",
"CardNumber":"5269552233334444",
"ExpMonth":"03",
"ExpYear":"2020",
"CvcNumber":"111",
"CardToken":"",
"Amount":7.5,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"20181204145940",
"SubMerchantName":"",
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20210114172139",
"RedirectType":0,
"CommissionScenario":2,
"SubDealer":[
{
"DealerId":1738,
"Amount":3,
"DealerCommissionRate":"2.00",
"DealerCommissionFixedAmount":"0"
},
{
"DealerId":167,
"Amount":4.5,
"DealerCommissionRate":"2.00",
"DealerCommissionFixedAmount":"0"
}
]
}
}
Scenario 3
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"CardHolderFullName":"elif yetimoğlu",
"CardNumber":"5269552233334444",
"ExpMonth":"03",
"ExpYear":"2020",
"CvcNumber":"111",
"CardToken":"",
"Amount":3,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"20181204150708",
"SubMerchantName":"",
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20210114172139",
"RedirectType":0,
"CommissionScenario":3,
"SubDealer":[
{
"DealerId":1744,
"Amount":1,
"DealerCommissionAmount":"3"
},
{
"DealerId":1767,
"Amount":2,
"DealerCommissionAmount":"2"
}
]
}
}
Scenario 4
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"CardHolderFullName":"elif yetimoğlu",
"CardNumber":"5269552233334444",
"ExpMonth":"03",
"ExpYear":"2020",
"CvcNumber":"111",
"CardToken":"",
"Amount":3,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"20181204171533",
"SubMerchantName":"",
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20210114172139",
"RedirectType":0,
"CommissionScenario":4,
"SubDealer":[
{
"DealerId":1768,
"Amount":2,
"GroupRevenueRate":"2",
"AmountToBeCommissioned":"1",
"IsIncludedFixedAmount":""
},
{
"DealerId":1770,
"Amount":1,
"GroupRevenueRate":"2",
"AmountToBeCommissioned":"2",
"IsIncludedFixedAmount":""
}
]
}
}
Scenario 5
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"CardHolderFullName":"elif yetimoğlu",
"CardNumber":"5269552233334444",
"ExpMonth":"03",
"ExpYear":"2020",
"CvcNumber":"111",
"CardToken":"",
"Amount":5,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"20181204172747",
"SubMerchantName":"",
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20210114172139",
"RedirectType":0,
"CommissionScenario":5,
"SubDealer":[
{
"DealerId":1772,
"Amount":2,
"GroupRevenueAmount":"1",
"AmountToBeCommissioned":"1",
"IsIncludedFixedAmount":""
},
{
"DealerId":1774,
"Amount":3,
"GroupRevenueAmount":"1",
"AmountToBeCommissioned":"4",
"IsIncludedFixedAmount":""
}
]
}
}
Scenario 6
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"7c662eb7d85e9ec954ba3265d2fff6204e05d878de828ed2cdb3f0627acf4cc8"
},
"PaymentDealerRequest":{
"CardHolderFullName":"elif yetimoğlu",
"CardNumber":"5269552233334444",
"ExpMonth":"03",
"ExpYear":"2020",
"CvcNumber":"111",
"CardToken":"",
"Amount":15,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"20181204150708",
"SubMerchantName":"",
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20210114172139",
"RedirectType":0,
"CommissionScenario":6,
"SubDealer":[
{
"DealerId":1744,
"Amount":7
},
{
"DealerId":1767,
"Amount":3
}
]
}
}
Successful Request Result
- If the sent request data has been processed successfully in Moka, "Success" information is written in the "ResultCode" field of the object of the return object, and there is a link in the "Data" field..
- The user should be directed to this link in order to request a password from the bank and verify the credit card by entering the password received via SMS.
- Moka will use the CodeForHash data in the data block to report the payment result. Store this value in your database and associate it with this payment request.
- After the user completes the card verification process, they are automatically redirected back to the "RedirectUrl" link sent when calling the service. In other words, the post is sent to the URL you provided.
- During this redirection, "hashValue", "resultCode", "resultMessage", "trxCode" and "OtherTrxCode" form fields can be read and necessary actions can be taken according to the result of the operation.
- In case of a successful transaction from the bank, the returned OrderId should be stored in the trxCode field. Cancellation, refund or pool payment confirmation transactions will be carried out using this code..
- If the payment fails, the reason for the failure can be found out by using the "resultCode" and "resultMessage" fields.
- How to calculate and check hashValue?
-
Returned values by TEXT POSTing to your RedirectURL as a result of 3D Validation:
Key : hashValue         Value : cdb7869505bdaaac2f4c891fc9ed889885fd7a0c880127ab5d508883efa3ee83
Key : resultCode         Value :
Key : resultMessage   Value :
Key : trxCode               Value : ORDER-17131QQFG04026575
Key : OtherTrxCode     Value : Your-Transaction-Code -
If you want us to TEXT POST the payment result to another URL, you can report this to the Moka operation
team.
If the text answer "OK" is received from the URL we posted, it is understood that the payment result can be sent to the merchant, otherwise the Post operation is tried 2 more times.
The following information is POSTed to a URL that you provide at the completion of each payment :
Key : hashValue         Value : cdb7869505bdaaac2f4c891fc9ed889885fd7a0c880127ab5d508883efa3ee83
Key : resultCode         Value :
Key : resultMessage   Value :
Key : trxCode               Value : ORDER-17131QQFG04026575
Key : OtherTrxCode     Value : Your-Transaction-Code
IMPORTANT NOTE
When paying with 3D Secure, you can use our Get services to check the payment status.
Successful Result Example
{
"Data":{
"Url":"https://service.testmoka.com/PaymentDealerThreeDProcess?threeDTrxCode=0cc02f5fac4f-47fb-aa94-167582552caa",
"CodeForHash":"9FDFBDFC-42C5-417E-AA93-E4D9D5312AAC"
},
"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, Dealer code, dealer username and/or password were entered incorrectly. |
PaymentDealer.CheckPaymentDealerAuthentication.VirtualPosNotFound | There is no virtual pos definition for this dealer. |
PaymentDealer.CheckDealerPaymentLimits.DailyDealerLimitExceeded | Any of the daily limits defined for the dealer have been exceeded. |
PaymentDealer.CheckDealerPaymentLimits.DailyCardLimitExceeded | No more transactions can be made using this card during the day. |
PaymentDealer.CheckCardInfo.InvalidCardInfo | There is an error in the card information. |
PaymentDealer.DoDirectPayment3dRequest.InstallmentNotAvailableForForeignCurrencyTransaction | Installments cannot be made in foreign currency. |
PaymentDealer.DoDirectPayment3dRequest.ThisInstallmentNumberNotAvailableForDealer | This number of installments cannot be made for this dealer. |
PaymentDealer.DoDirectPayment3dRequest.InvalidInstallmentNumber | The number of installments is between 2 and 12. |
PaymentDealer.DoDirectPayment3dRequest. ThisInstallmentNumberNotAvailableForVirtualPos | Virtual Pos does not allow this number of installments. |
EX | An unexpected error has occurred. |
Example of Failed Result
{
"Data":null,
"ResultCode":"PaymentDealer.CheckPaymentDealerAuthentication.VirtualPosNotFound ",
"ResultMessage":"",
"Exception":null
}