Skip to main content

Implementing the new payment gateway design for existing customers

The GoPay payment gateway now makes it possible to use the inline payment option even on older versions of the payment gateway API. The new integration lets merchants implement the inline payment gateway into their existing solution without disrupting its availability or stability.

💡 GoPay's tip:
Before you start using the inline payment gateway, please contact our technical department at [email protected] so that we can verify that your settings are correct.


​

Implementing the new payment gateway design for existing merchant outlets

The new payment gateway design is prepared for our merchants in such a way that implementing it does not disrupt the availability or stability of the existing integration, that is, of the standard payment gateway. Integrating the new payment gateway design is then significantly faster and cheaper.
​
All the functionalities that use the GoPay web service remain fully available.


​

Initialising the new payment gateway design

The part of the integration that differs lies in invoking the inline payment gateway instead of redirecting to the GoPay payment gateway. The inline payment gateway is invoked using a form with a JavaScript library, an encrypted signature and the paymentSessionId of a payment created beforehand. With the redirect option of the payment gateway, the customer is redirected to a page with the same design as the inline gateway, but without using the JavaScript library.


​

Test environment

In the test mode of the payment gateway you can fully fine-tune the adjustment of your existing integration for the version with the new design.


​Example of a form for initialising the inline payment gateway in the test environment

<form action="https://gw.sandbox.gopay.com/gw/v3/3100000099" method="post" id="gopay-payment-button"> <input type="hidden" name="signature" value="25ee53a1eccc253a8310f5267d2de6b483f58af9676d883e26600ce3316ai"/> <button name="pay" type="submit">Zaplatit</button> <script type="text/javascript" src="https://gw.sandbox.gopay.com/gp-gw/js/embed.js"></script></form>


​Example of a form for initialising the hosted payment gateway in the test environment

<form action="https://gw.sandbox.gopay.com/gw/v3/3100000099" method="post" id="gopay-payment-button"> <input type="hidden" name="signature" value="25ee53a1eccc253a8310f5267d2de6b483f58af9676d883e26600ce3316ai"/> <buttonname="pay" type="submit">Zaplatit</button></form>


​

Production environment

In the production mode of the payment gateway, which is made available once the necessary tests have been carried out and the contract has been signed, the addresses in the forms have to be changed from https://gw.sandbox.gopay.com to https://gate.gopay.cz together with the address of the web service and the goId and secureKey details.


​Example of a form for initialising the inline payment gateway in the production environment

<form action="https://gate.gopay.cz/gw/v3/3100000099 method="post" id="gopay-payment-button"> <input type="hidden" name="signature" value="25ee53a1eccc253a8310f5267d2de6b483f58af9676d883e26600ce3316ai"/> <button name="pay" type="submit">Zaplatit</button> <script type="text/javascript" src="https://gate.gopay.cz/gp-gw/js/embed.js"></script></form>


​Example of a form for initialising the hosted payment gateway in the production environment

<form action="https://gate.gopay.cz/gw/v3/3100000099 method="post" id="gopay-payment-button"> <input type="hidden" name="signature" value="25ee53a1eccc253a8310f5267d2de6b483f58af9676d883e26600ce3316ai"/> <button name="pay" type="submit">Zaplatit</button></form>

Parameter name

Parameter description

Mandatory

Example

paymentSessionId

The payment identifier, obtained once the payment has been created; it is added to the action parameter of the form, after the address of the payment gateway

YES

3100000099

signature

The encrypted signature of the payment

YES

25ee53a1ec­cc253a8310f5267d2de6b483f58a­f9676d883e26600ce3316ai

String for assembling the signature
​targetGoId+|+pa­ymentSessionId+|+se­cureKey

You can find a sample implementation for assembling the signature in PHP below.

$encryptedSignature = GopayHelper::encrypt( GopayHelper::hash( GopayHelper::concatPaymentCommand($targetGoId, $paymentSessionId, $secureKey) ), $secureKey);	
Did this answer your question?