Some payment methods are becoming more and more popular among others and become desirable by customers, so it's worth showing them that your store provides this method.
This tutorial will show you how to easily display the popular payment method in the basket of your store.

The payment method promotion should start by adding a button in the basket along with the logotype and description of the method in parallel to others. In this tutorial, we'll use the example of the card payment method from the Google Pay e-wallet.

When your customer chooses the Google Pay method, you'll need to provide this information to the next script that will complete the order. The mentioned script will be able to create a transaction in tpay.com system immediately with the selected method of payment, thereby shortening the payment process.

In tpay.com, each payment method has its own unique, unique identifier. The Google Pay is 166 ID, which you can save permanently or download dynamically from the list of available payment methods for your merchant account.

Once the order is created in your sales system, you must generate the transaction exactly the same as the other but with the additional parameter "group", with the value 166. This operation can be carried out in two ways:

  • Generate a transaction via the API using the "create" method with sample parameters:
    {
      "id": 1010,
      "amount": 13.99,
      "description": "Payment for order X",
      "md5sum": "6d6807ef9edd112bf09c1a9d10292ff6",
      "group": 166,
      "email": "[email protected]",
      "name": "john doe",
      "accept_tos": 1,
      "api_password": "[email protected]$$w0rd#@!"
    }​​

    which will return a ready link to the transaction via the Google Pay method:

    {
      "result": 1,
      "title": "TR-BRA-12NBZKX",
      "amount": 13.99,
      "online": 1,
      "url": "https://secure.tpay.com/?gtitle=TR-BRA-12NBZKX",
    }​

    Now all you have to do is redirect the client to the link from the "url" parameter so that he can make the payment.
    For more information on how transactions are generated via the API, see the case study Bank selection on the store website, creating transactions via API and WhiteLabel

    This method is recommended when the promotion of the selected payment method is associated with a sponsored promotional campaign because after redirecting to the transaction, the client can no longer change the method to another one.

  • Generate a form that leads to the Tpay transaction panel, with the appropriate parameters:
    <form action="https://secure.tpay.com" method="post">
      <input type="hidden" name="id" value="1010"/>
      <input type="hidden" name="amount" value="13.99"/>
      <input type="hidden" name="description" value="Payment for order X"/>
      <input type="hidden" name="md5sum" value="6d6807ef9edd112bf09c1a9d10292ff6"/>
      <input type="hidden" name="group" value="166"/>
      <input type="hidden" name="email" value="[email protected]"/>
      <input type="hidden" name="name" value="john doe"/>
      <input type="hidden" name="accept_tos" value="1"/>
      <input type="submit" value="Pay"/>
    </form>​

    As a result of this form, the customer will go straight to the transaction panel, with the selected method of payment.
    Other parameters that can be added to the payment form are described in the integration without API documentation.

    Please note that with this integration method, the customer will be able to change the payment method to another in the Tpay panel. If the promotion of the payment method is caused by a sponsored promoting action, the API method described in the previous section is recommended.