IFrame Payment Page
Address to Send
https://clientwebpos.moka.com/Api/WebPos/CreateWebPosRequest
Required 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. |
WebPosRequest
Parameter | Explanation | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Amount (decimal) | Payment amount (The Kurus part is written with a dot. For example: 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 12 must be sent for Installment.. | |||||||||||||||||||||
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. | |||||||||||||||||||||
ClientWebPosTypeId (integer) | The value of this field must be sent as "0" to be able to call an IFrame. | |||||||||||||||||||||
IsThreeD (bool) | 0: IFrame is created for direct payment. 1: IFrame is created for 3D checkout. If there is no direct sales authorization, it is accepted as a 3D payment and the payment is created. |
|||||||||||||||||||||
IsPoolPayment (tinyint) | Pool payment ? 0 : No - The amount withdrawn from the card is credited to the dealer's account the next day or later, according to the agreement between Moka and the dealer. 1 : Yes - The money will be withdrawn from the credit card but 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. Until the dealer approves the pool payment, this payment is not included in the statement. 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 in order to keep the card) 0 : The card will not be kept 1 : The card will be kept 2 : The paying customer will decide whether to keep the card or not. |
|||||||||||||||||||||
Language (string) | The language of the interface to be displayed to the user. Type "en" for the English language option, "tr" for the default language option Turkish, or the field is sent blank. | |||||||||||||||||||||
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) | Type of page to redirect result to – Optional field, if not sent at all or 0 sent, the result of the payment transaction will be redirected to the home page containing the IFrame; If 1 is sent, the result is piped into the IFrame. | |||||||||||||||||||||
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)
{
"PaymentDealerAuthentication":{
"DealerCode":"xxx",
"Username":"xxx",
"Password":"xxx",
"CheckKey":"28ba1f316e661ee7a0477a13aa30613da548c94a8098829af9255b04d7e916e3"
},
"WebPosRequest":{
"Amount":0.01,
"Currency":"TL",
"InstallmentNumber":1,
"OtherTrxCode":"",
"ClientWebPosTypeId":0,
"IsThreeD":1,
"IsPoolPayment":0,
"IsPreAuth":0,
"IsTokenized":0,
"Language":"",
"SubMerchantName":"",
"Description":"test açıklama",
"ReturnHash":1,
"RedirectUrl":"https://service.TestMoka.com/PaymentDealerThreeD",
"RedirectType":0,
"BuyerInformation":{
"BuyerFullName":"Ali Yılmaz",
"BuyerGsmNumber":"5551110022",
"BuyerEmail":"",
"BuyerAddress":"Tasdelen / Çekmeköy"
},
"CustomerInformation":{
"DealerCustomerId":"",
"CustomerCode":"1234",
"FirstName":"Ali",
"LastName":"Yılmaz",
"Gender":"1",
"BirthDate":"19901218",
"GsmNumber":"",
"Email":"aliyilmaz@xyz.com",
"Address":"",
"CardName":""
}
}
}
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 so that he can enter his card information, initiate payment and 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 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
Successful Result Example
{
"Data":{
"Url":"https://clientwebpos.moka.com/iframe/e158b5b7-ed93-4b59-9eaf-e1a30536ef85",
"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 |
---|---|
ClientWebPos.CreateWebPosRequest.InvalidRequest | Invalid request |
ClientWebPos.CreateWebPosRequest.InvalidAccount | No such dealer was found. |
ClientWebPos.CreateWebPosRequest.InvalidAmount | Invalid amount |
ClientWebPos.CreateWebPosRequest.RedirectURLNotGiven | No redirect URL given. |
ClientWebPos.CreateWebPosRequest.IpAddressNotAllowed | This IP address is not allowed. |
ClientWebPos.CreateWebPosRequest.ChannelPermissionNotAvailable | Channel permission is not defined. |
ClientWebPos.CreateWebPosRequest.ForeignCurrencyNotAvailableForThisDealer | Payment in foreign currency is not defined for the dealer. |
ClientWebPos.CreateWebPosRequest.InstallmentNumberNotAvailableForDealer | This number of installments cannot be made for this dealer. |
ClientWebPos.CreateWebPosRequest.InvalidInstallmentNumber | The number of installments is between 2 and 12. |
ClientWebPos.CreateWebPosRequest.DailyDealerLimitExceeded | Any of the daily limits defined for the dealer have been exceeded. |
ClientWebPos.CreateWebPosRequest.MonthlyDealerLimitExceeded | Any of the monthly limits defined for the dealer have been exceeded. |
ClientWebPos.CreateWebPosRequest.InvalidSubMerchantName | If there is a submerchant defined for the dealer and it is incorrect |
ClientWebPos.CreateWebPosRequest.InvalidBuyerEmail | Invalid recipient email |
ClientWebPos.CreateWebPosRequest.InvalidBuyerGsmNumber | Invalid recipient phone number |
ClientWebPos.CreateWebPosRequest.InvalidUnitPrice | Invalid unit price |
ClientWebPos.CreateWebPosRequest.InvalidQuantityValue | Invalid amount |
ClientWebPos.CreateWebPosRequest.BasketProductNotFoundInYourProductList | No product found in your cart. |
ClientWebPos.CreateWebPosRequest.MustBeOneOfProductIdOrProductCode | It must be one of the product id or product code. |
ClientWebPos.CreateWebPosRequest.BasketProductNotFound | The product added to the cart could not be found. |
ClientWebPos.CreateWebPosRequest.BasketAmountIsNotEqualPaymentAmount | The amount in the cart is not equal to the payment amount. |
ClientWebPos.CreateWebPosRequest.PaymentMustBeAuthorization | Payment must be authorized. |
ClientWebPos.CreateWebPosRequest.AuthorizationForbiddenForThisDealer | Authorization has been revoked for this dealer. |
ClientWebPos.CreateWebPosRequest.PoolPaymentNotAvailableForDealer | Pool payment is not defined for this dealer. |
ClientWebPos.CreateWebPosRequest.PoolPaymentRequiredForDealer | Pool payment is mandatory for this dealer. |
ClientWebPos.CreateWebPosRequest.TokenizationNotAvailableForDealer | Card storage permission is not defined for this dealer. |
ClientWebPos.CreateWebPosRequest.CustomerInfoIsRequiredToSaveTheCard | Customer information is required to register the card. |
ClientWebPos.CreateWebPosRequest.FirstNameIsRequiredToSaveTheCard | Your name is required to register the card. |
ClientWebPos.CreateWebPosRequest.InvalidGsmNumber | Invalid phone number |
ClientWebPos.CreateWebPosRequest.InvalidEmail | Invalid e-mail |
ClientWebPos.CreateWebPosRequest.DealerCustomerNotExists | There are no dealer customers. |
ClientWebPos.CreateWebPosRequest.DealerCustomerIdAndCustomerCodeConflicted | Dealer customer id and customer code do not match. |
EX | An unexpected error has occurred. |
Example of Failed Result
{
"Data":null,
"ResultCode":"ClientWebPos.CreateWebPosRequest.ForeignCurrencyNotAvailableForThisDealer",
"ResultMessage":"",
"Exception":null
}