Mobile Payment with 3D Secure
Service Address
/PaymentDealer/DoDirectPaymentThreeDMobile
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 |
PaymentType (string) |
Bank Code (64 for İşbank) |
Amount (decimal) |
Payment amount (Kurus part is written with a dot, Ex: 27.50) |
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 9 must be sent for Installment. |
ClientIP (string) |
It is the IP information of the computer running the application (desktop/web) from which the card
number is obtained. |
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=123456 |
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. |
OtherTrxCode (string) |
You can submit your own Unique Transaction Code in this field for reconciliation. Required field.
Note: You can learn the payment status by using this code while obtaining the dealer payment detail
list. |
IsPoolPayment (tinyint) |
Pool Payment? 0: No – The amount withdrawn from the card is credited to the account of the merchant
the next day or later, according to the agreement between Moka and the merchant. 1: Yes – The money
is withdrawn from the credit card but kept in the pool. The merchant will approve the payment after
the customer receives the service or product, and the payment for this transaction will be reflected
on the member's statement after approval. Until the merchant approves the pool payment, this payment
is not included in the statement. This field must be 1 to send a payment in the pool system. |
IntegratorId (tinyint) |
ID of the System Integrator Company that integrates Moka into ready-made E-Commerce packages
(optional) – (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) |
SubMerchantName (string) |
Name you want to appear on statement (optional) – Moka must be notified in advance |
Description (string) |
Description field (optional). If you want to write a description about the payment, it can be
written in this field. (Up to 200 characters can be written.) |
BuyerInformation (Array)(optional) |
These are the fields related to the customer who buys products and/or services from the member
business. Although it is not mandatory to send these fields, sharing them with Moka is in the
interest of both the member workplace and Moka in case of future payment related problems.
BuyerFullName (string) |
Optional field. Name and surname of the recipient. |
BuyerEmail (string) |
Optional field. Recipient's e-mail address. |
BuyerGsmNumber (string) |
Optional field. It is the mobile phone number of the recipient. It must be entered as 10
digits, without spaces. |
BuyerAddress (string) |
Optional field. It is the address of the recipient. |
|
Sample Request (JSON)
{
"PaymentDealerAuthentication":{
"DealerCode":"XXX",
"Username":"XXX",
"Password":"XXX",
"CheckKey":"28ba1f316e661ee7a0477a13aa30613da548c94a8098829af9255b04d7e916e3"
},
"PaymentDealerRequest":{
"PaymentType":"64",
"Amount":0.01,
"Currency":"TL",
"InstallmentNumber":1,
"ClientIP":"192.168.1.116",
"OtherTrxCode":"MOB-20201217152028",
"SubMerchantName":"",
"IsPoolPayment":0,
"IntegratorId":0,
"Software":"Possimulation",
"Description":"",
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD?MyTrxCode=20201217152028",
"RedirectType":0,
"BuyerInformation":{
"BuyerFullName":"",
"BuyerGsmNumber":"",
"BuyerEmail":"",
"BuyerAddress":"Tasdelen / Çekmeköy"
}
}
}
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 verify the credit card using the bank's mobile
application.
- 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 is "OK" from the URL we posted, it is understood that the payment result can be sent to
the merchant, otherwise the Post transaction 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/PaymentDealerThreeDMobileProcess?threeDTrxCode=ee453c30-488f-4cdc-b674-387df6a0eda7&RedirectType=0",
"CodeForHash":"9FDFBDFC-42C5-417E-AA93-E4D9D5312AAC"
},
"ResultCode":"Success",
"ResultMessage":"",
"Exception":null
}
Failed Request Result
ResultCode |
Explanation |
PaymentDealer.DoDirectPayment3dMobileRequest.IpAddressNotAllowed |
The merchant does not have permission to make transactions with the IP address sent. |
PaymentDealer.DoDirectPayment3dMobileRequest.VirtualPosCommissionRateNotFound |
The commission rate of the virtual pos is not defined. |
PaymentDealer.DoDirectPayment3dMobileRequest.VirtualPosNotAvailable |
Virtual POS could not be selected for this operation. |
PaymentDealer.DoDirectPayment3dMobileRequest.InstallmentNotAvailableForForeignCurrencyTransaction
|
No installment transactions can be made with foreign currencies. |
PaymentDealer.DoDirectPayment3dMobileRequest.ForeignCurrencyNotAvailableForThisDealer |
This member business is not authorized to take transactions in foreign currency. |
PaymentDealer.DoDirectPayment3dMobileRequest.PoolPaymentNotAvailableForDealer |
This merchant is not authorized to receive pooled payment transactions. |
PaymentDealer.DoDirectPayment3dMobileRequest.PoolPaymentRequiredForDealer |
It is obligatory for this member business to make transactions with pooled payment. |
PaymentDealer.DoDirectPayment3dMobileRequest.ChannelPermissionNotAvailable |
The merchant has no authority for the payment channel through which the transaction takes place.
|
PaymentDealer.DoDirectPayment3dMobileRequest.InvalidInstallmentNumber |
Invalid number of installments |
PaymentDealer.DoDirectPayment3dMobileRequest.NoAllowedToUseThisWebService |
The member business is not authorized to use this service. |
PaymentDealer.DoDirectPayment3dMobileRequest.AmountRequired |
The Amount field must be submitted. |
PaymentDealer.DoDirectPayment3dMobileRequest.OtherTrxCodeRequired |
The OtherTrxCode field must be sent. |
PaymentDealer.DoDirectPayment3dMobileRequest.RedirectUrlRequired |
The RedirecUrl field is required to be sent. |
PaymentDealer.DoDirectPayment3dMobileRequest.PaymentTypeRequired |
The PaymentType field is required to be submitted. |
PaymentDealer.DoDirectPayment3dMobileRequest.InvalidPaymentType |
Invalid bank code |
PaymentDealer.DoDirectPayment3dMobileRequest.InvalidCurrencyCode |
Invalid currency |
PaymentDealer.DoDirectPayment3dMobileRequest.AgreementDateNotFound |
There is no contract record of the member workplace. |
PaymentDealer.DoDirectPayment3dMobileRequest.RedirectUrlCannotContainOtherTrxCode |
The RedirectUrl field must contain OtherTrxCode. |
EX |
An unexpected error has occurred |
Example of Failed Result
{
"Data":null,
"ResultCode":"PaymentDealer.DoDirectPayment3dMobileRequest.VirtualPosCommissionRateNotFound",
"ResultMessage":"",
"Exception":null
}
3D Secure Mobile Transaction Flow
Payment Transaction Error Codes (Errors Received from Bank)
ResultCode |
ResultMessage |
000 |
General Error |
001 |
Cardholder Confirmation Failed |
002 |
Insufficient Limit |
003 |
Credit Card Number Not in Valid Format |
004 |
General Disclaimer |
005 |
Transaction Not Open to Card Holder |
006 |
Card Expiry Date Incorrect |
007 |
Invalid Transaction |
008 |
Unable to Connect to Bank |
009 |
Undefined Error Code |
010 |
Bank SSL Error |
011 |
Call the Bank for Manual Approval |
012 |
Card Information Incorrect - Card Number or CVV2 |
013 |
Cards Except Visa MC Do Not Support 3D Secure |
014 |
Invalid Account Number |
015 |
Invalid CVV |
016 |
No Approval Mechanism Available |
017 |
System failure |
018 |
Stolen Card |
019 |
Lost Card |
020 |
Restricted Card |
021 |
Time out |
022 |
Invalid Workplace |
023 |
Fake Confirmation |
024 |
3D Approval Received But Money Couldn't Be Withdrawn From Card |
025 |
3D Confirmation Error |
026 |
Card Holder is Not a Bank or Card 3D-Secure Member |