Payment Form

With the Craftgate payment form, you can easily start receiving payments and use features such as installment checks, front-end payment validations, BIN inquiry, payment with 3D secure, and card storage without any additional development costs. The use of the common payment page is completed in two steps. See: Common Payment Page

  1. Create a common payment form
  2. Retrieve the result of the payment

Create a Common Payment Form

After the merchant sends the request to initiate the payment form via the Craftgate API, the pageUrl and token parameters are sent to the merchant as a response. When the user opens the URL in the pageUrl parameter on their browser, they see the payment form. Optionally, the page can be displayed as an iframe by adding the iframe=true parameter to this URL. Likewise, when the animatedCard=true parameter is added to the URL, a card image shaped by user input can also be added to the common payment page. The user completes the payment after filling in the required fields on the page and entering the card information. By using the payment form, users can optionally store their card or use their stored cards if the cardUserKey parameter is filled in by the merchant while the payment form request is started. After the payment process is completed —successfully or unsuccessfully— the token information generated based on the payment form request is returned to the URL address in the callbackUrl field that the member merchant filled in while creating the payment form request. In addition to the callbackUrl parameter, if the merchantWebhookUrl parameter is sent, the server sends token information in json format to this address by HTTP POST method.

Retrieve The Payment Result

You can query the payment form result again via the Craftgate API once you send the token information to the address in the callbackUrl field after the Craftgate API payment. As a result of this query made using the token information, you can see the details of the payment, whether there was an error and if there was, what type of error it was.

In payments made using the Common Payment Page, transactions such as using a wallet and choosing installments are determined by the end user at the time of payment. The merchant should update the number of installments (installment), the amount collected (paidPrice) and the amount collected from the wallet (walletPrice) information in its system using the information in the payment form result.

You can find the details of the Common Payment Page on Common Payment Page.