Deposit

This poker software supports real money gateways like PayPal, Paysafe, etc. You can also integrate any crypto payment gateways like nowpayments.io, coinpayments.net, coingate.com, etc.

Making a deposit can be possible with just a few clicks. From the cashier section, under the deposit tab, a player can choose the available payment option to make his first deposit. Depending on the client's choice and business process it can be manual fiat or crypto too.

To make a deposit, a player must follow these steps: -After login go to the Cashier. -Select the deposit tab and select your preferred payment option. -Enter the amount you want to deposit. -Click on the Deposit button to confirm the process.

Based on the gateway response and opted payment method a confirmation will be sent to your email. Check your chip balance as it will auto-process.

Gateway Integration Guide - General Process

This guide will give you a high-level approach to the general integration process. Here, you will get every single necessary step that is required for a gateway instruction. There are lots of gateways in the market, so it's not possible to cover each and every one. We hope this general approach will help you.

Merchant ID The first step is to signup for your payment gateway. From the gateway dashboard, you have to collect merchant identification parameters according to their internal setup. It can be a Client ID, Client Secret Key, API Key, etc.

OAuth Almost, each payment gateway uses REST API for communication using HTTPS requests. The OAuth protocol handles different types of authorized access for each API functions via access tokens. Merchant IDs are required to generate the tokens.

Token Before creating any payment it is required to generate the token. For each API request, there must be a token that will work along with the API function which resides in the request header.

Generally, it is very easy to get tokens by making an API call to /api/oauth2/token URL. For each token we suggest creating a token with two scopes of authorizations; -The first is for payment-create and only use for creating new payments. -Second will be for payment-all that handle other payment operations.

It is necessary to create a fresh new token for any expired token.

Note: Mostly, each token expires in 20-30 minutes and resides in the header.

Creating the Payment

To create a payment you have to make Gateway's REST API call to /api/payments/payment URL. During the payment creation process, it is required to specify all the required parameters; amount, currency, accepted payment methods, default payment method, order method, gateway language, notification address (notification_url), and return address (return_url).

POST /api/payments/payment HTTP/1.1 

Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
Content-Type: application/json
Accept: application/json

{
    "payer": {
        "allowed_payment_instruments": [
            "CRYPTO",
            "PAYMENT_CARD"
            "BANK_ACCOUNT"

        ],
        "default_payment_instrument": "PAYMENT_CARD",
        "allowed_swifts": [
            "FIOBCZPP",
            "BREXCZPP"
        ],
        "default_swift": "FIOBCZPP",
        "contact": {
            "first_name": "Zbyněk",
            "last_name": "Žák",
            "email": "[email protected]",
            "phone_number": "+433663456123",
            "city": "České Budějovice",
            "street": "Planá 67",
            "postal_code": "37301",
            "country_code": "CZE"
        }
    },
    "target": {
        "type": "ACCOUNT",
        "Gatewayid": 8123456789
    },
    "items": [
        {
            "type": "CHIPS",
            "name": "Chips Deposit",
            "amount": 200,
            "count": 1,
            "vat_rate": "0",
            "ean": 1234567890123,
            "product_url":"https://example.com/profile/?addchips=add"
        }
    ],
    "amount": 200,
    "currency": "CZK",
    "order_number": "OBJ20200825",
    "order_description": "Chips Deposit",
    "lang": "CS",
    "callback": {
        "return_url": "https://www.example.com/return",
        "notification_url": "https://www.example.com/notify"
    },
    "additional_params": [
        {
            "name": "invoicenumber",
            "value": "2015001003"
        }
    ]
}

Note: For a successful request, the header must contain the token that is created earlier during payment initiation.

In response, your gateway returns the JSON object with all details about the payment. The primary and most important parameter is id which is a unique identification number to recognize a payment within the gateway system. Save this information in your poker software database.

Another important parameter is the gateway_url which is core parameter to initiate the gateway process.

Initiate your Payment Gateway

As explained in the "Introduction" you can initiate the payment using both methods by using either the 'Redirect' or the 'Inline' method. Check your gateway to which option they have and follow with that.

Further for initializing the payment gateway you can choose any one method from a javascript initializing or a pre-created payment. We suggest you use "Javascript initializing" which can follow a one-click payment. If you plan to with multi-step payment by collecting other information then, follow the "pre-created payment".

Javascript Initializing This method also knows as Javascript calling. After getting the payment request confirmation, the game server receives an order ajax request. Meanwhile, an access token is also get generated in order to create the payment. In response, a gateway_url is created to initialize the payment gateway with javascript.

JavaScript gatewaty.checkout({gatewayUrl: url, inline: true});

Here in this code sample, the method is parameterized with gatewayUrl as an object of the created payment, and the inline parameter defines the option to initialize the payment gateway.

In order to follow gateway.checkout you must include the Gateway Javascript API like this;

<script type="text/javascript" src="https://gatewayUrl/pay/js/embed.js">

Here is an example of code that is using javascript to initialize the payment gateway.

<body>
<script type="text/javascript" src="https://api/js/embed.js"></script>
<h3>Inline-gw</h3>
<script type="text/javascript">
   $( document ).ready(function() {
       //event handler for making the payment
       $( '#payment-invoke-checkout' ).on( 'click', function( event ) {
           event.preventDefault();
           postParams = $('#payment-container').serialize();
           //payment is created by asynchronous request to server-side script (first 'access token', then 'payment create')
           $.ajax({
               url: '/eshop/create-payment',
               type: 'POST',
               data: postParams

           }).done(function( inlineCreateResult ) {
               //there should be the gatewayUrl in the response (gatewayUrl is obtained )
               //the embed payment gateway is initialized with .js API
               gateway.checkout({gatewayUrl: inlineCreateResult.gatewayUrl, inline: true}, function(checkoutResult) {

                  //the callback can catch the embed closing
                  //the parameter of the callback is the checkoutResult object, which contains id and url (return-url)
                  //!!but making the return from the purchasing process to the returnURL must be taken into account!! (payment buttons)

                  //make a payment status call and display the result
                  $.ajax({
                    url: '/project/get-payment-status',
                    type: 'POST',
                    data: {inlineGetState: null, projectId: $(actionBean.project.projectId), paymentId: checkoutResult.id}

                  }).done(function( inlineGetStateResult ) {
                      $("#payment-container").prepend("<p style='background-color:yellow;padding:8px;border:solid black 1px'>Stav platby: " + inlineGetStateResult.state + "<br><br>URL: <a href='" + checkoutResult.url + "'>" + checkoutResult.url + "</a></p>")
                  });
               });

           }).error(function(data) {
               alert('error' + data);
           });
        });
    });
</script>

<form id="payment-container" action="/project/create-payment">
   <input type="hidden" name="order_id" value="123"/>
   <button id="payment-invoke-checkout" type="submit" name="pay">Pay</button>
</form>
</body>

Return update from Payment Gateway

For a payer, each payment activity either payment success or canceled must have a return back status along with a notification. There are two methods that are mostly used by payment gateway companies.

Return URL It's already explained, that for each created payment we have a returl_url. As the payment is created, the return_url parameter must be passed in the callback object. Once the payment gets finished, the player returns to the return_url and you can use the GET method to retrieve the id which works as player identification. A payment status call function must be applied to show the current payment status.

Callback Function In case, if your payment gateway does not support the required URL redirection you can find a callback function together with gateway.checkout function while initializing the payment gateway.

The sample code looks like this;

gateway.checkout({gatewayUrl: inlineCreateResult.url, inline: true}, function(checkoutResult) { alert(checkoutResult);})

Just after the payment is made, this defined callback function will be executed. We recommend following an ajax request to the game server which updates the payment status to display the payer.

Note: Both methods, returl_url and callback function have their own subjectivity. Read gateway documentation thoroughly before applying.

Payment Status Notifications

Notifications help payers to get updates about the payment status which comes from the game server during the payment cycle.

As explained, during creating the payment, a notification address (notification_url) is passed in the callback object. This URL received an HTTP/GET notification as the payment status is updated. The id parameter will map a particular order and you can make a payment status call to define the recent payment status. It is recommended to save the status in the game server database and perform other activities if required.

Profile API - Pokerscript

The profile API provides all the required parameters that are required for any payment gateway. POST URL "https://example.com/profile/?addchips=add" For security reasons, it is mandatory to use HTTPS for each request.

Request Body Here is a sample JSON representation of users' profile requests.

 {
 “user”: {
   “id”: “7b66cb5d-4771-4951-bf7a-978952d77955”,
   “email”: “[email protected]”,
   “username”: “userone”,
   “firstName”: “Firstname”,
   “lastName”: “Lastname”,
   “mobileNumber”: “+442071234567”,
   “nonLogin”: false
   “source”: “legacy-signup”,
   “amount”: “200”,
   "currency": "USD"
   "currencyType": "Fiat"  
 }
}

In case you have any problem with your gateway integration, talk to the support team. Personalized one-to-one guidance will be provided by the assigned support developer.

Last updated

Was this helpful?