Payment Service

Overview

The Payment service allows transactions to be performed with both real and virtual currency, and integrates with Adyen, Xsolla, Stripe, PayPal, AliPay, WxPay, and wallet services. The payment service provides a retry mechanism that prevents notifications from failing to appear during the payment process. This retry mechanism will resend failed notifications until the client acknowledges their receipt, or the maximum number of retries has been reached.

The Payment service includes several features to support the payment process, including:

  • Real and virtual currency One payment service can cover both real currency purchases of games or add-ons, or in-game purchases of items or boosters using AccelByte coins.
  • Support for multiple payment providers Our Payment service can integrate with Adyen Xsolla, and Stripe payment aggregators, and can accept payments from PayPal, Visa, Mastercard, AliPay, and WxPay.
  • Payment account management Our Admin Portal allows you to manage what types of payments you accept and configure your payment aggregators.
  • Customized payment station You can change the look of your payment station to highlight your brand.
  • Email notifications for paid orders Players receive email verification of successful transactions.

Tutorials

Configuring Adyen as a Payment Aggregator

To set Adyen as your payment aggregator you’ll need to perform a few actions on the Adyen platform, which means you must already have an Adyen account. Once you have everything you need from Adyen, you can set Adyen to be your payment aggregator in our Admin Portal. To set up Adyen, follow the steps below

Getting the API Key in Adyen

An API key is a unique value that is used to authenticate API requests from a particular account. You will need to provide the API key from Adyen in each API request to their payment platform.

  1. Log in to your Customer Area in Adyen. Then, navigate to Account and choose Users.

    payment

  2. Select the user ws@Company.[YourCompanyAccount].

    payment

  3. Under Authentication, click Generate New API Key. Don't forget to copy and securely store the API Key in your system. If you lose this API Key, you won't be able to restore it.

    payment

When you’re done, click Save.

Getting HMAC Keys and Skins

In order to use the Signature Calculation, you need to generate a secret HMAC key. This request is used to ensure the authenticity and data integrity of an incoming request to Adyen.

  1. Log in to your Customer Area in Adyen. Then, navigate to Account and choose Skins.

    payment

  2. Select an existing skin from the List tab or create a new skin by switching to the New tab.

    payment

  3. In the New tab, click Generate new HMAC key for both the Test platform and the Live platform.

    payment

  4. Copy the new keys and store them in a secure place in your system, so that you can access these values later.

    payment

Finally, in order to save the skin, click Create New Skin on Test at the bottom of the page.

How to Set Up Notifications

You must set up notifications to integrate Adyen with AccelByte.

  1. Go to your Customer Area in Adyen and select Account. Then, select Server Communication.

    payment

  2. Click the Add button next to Standard Notification.

    payment

  3. Fill in the required fields for the Standard Notification.

    payment

    • Input the URL.
    • Select the SSL Version.
    • Choose the Communication Method you want to use, either JSON, SOAP, or HTTP POST.
  4. In the Authentication section, enter the Username and Password.

    payment

  5. Then generate your new HMAC key from the Additional Settings menu

    payment

When you’re done, save the configuration.

How to Customize Payment Methods

  1. Go to your Customer Area in Adyen and select Account. Then, choose Payment Methods.

    payment

  2. Here you can select the payment methods you want to accept.

    payment

Setting Up Adyen as a Payment Aggregator in Admin Portal

  1. In the Admin Portal, go to the Payment Configurations menu under the Platform Configurations dropdown on the top-right header.

    payment

  2. Add a new configuration by clicking the New Configuration button.

    payment

  3. Fill in the required fields.

    payment

    • Select the Namespace for the payment configuration. You can select all namespaces if desired.
    • Select the Region for the payment configuration. You can select all regions if desired.
    • Select Adyen from the Payment Aggregator dropdown list.
    • You can leave the Payment Methods field empty.

When you’re done, click the Submit button and you will be redirected to the Payment Configuration page.

  1. In your newly created payment configurations, go to the Payment Aggregator section and click the Configure now button.

    payment

  2. Fill in the required fields.

    payment

    • Input the API Key from Adyen.
    • Input the Adyen Merchant Account.
    • Input the Notification Hmac Key.
    • Input the Notification Username and Password.
    • Input the Live Endpoint URL Prefix.
    • Input the Return URL.
    • Choose if you want to enable Authorize as Capture.

When you’re done, click Add and your config will be saved.

Configuring Xsolla as a Payment Aggregator

Like Adyen, setting up Xsolla as your payment aggregator requires that you have an Xsolla account. After you perform the necessary setup in the Xsolla platform, you can configure your payment aggregator in our Admin Portal. To set up Xsolla, follow the steps below.

Setting Up an Xsolla Project

  1. Open the Xsolla Publisher Dashboard and click Projects on the left sidebar menu.

    payment

  2. On the Projects page, click Create a new project.

    payment

  3. Fill in the following information:

    payment

    • Select the Project Localization to decide which localization you are going to use.

    • Input the Project Name.

    • Input your Website URL.

    • Input your project’s Description.

    • In the Webhooks field, choose On if you want to use webhooks or Off if you don’t want to use webhooks.

    • If you chose On above, input the Webhook URL with the appropriate format. See below for an example:

      Note:

      • You can copy and paste the format, then modify the link with your own URL. The project number will be generated after the configuration is saved. You will need to edit the Webhook URL again after you have the project number ready.
    • Input the Return URL of your project. This is where a player will be redirected to after completing a payment.

    • Generate the Secret Key and make sure to store it somewhere safe. You will need the key to configure Xsolla in the AccelByte Admin Portal.

    • Enable Virtual Currency if you want to sell in-game currency.

    • Enable Virtual items if you want to sell in-game content for real or virtual currencies.

    • Enable Subscriptions if you sell subscription packages.

    • Enable Coupons if you want to be able to create coupon codes that entitle players to items.

    • Enable Pay2Play if you want to sell PIN codes directly from your game's website.

    • Enable Simple Checkout to enable this feature, if desired.

    • Click the Advanced Settings and you can see more advanced configurations but, in this case we only enable the External ID of the transaction.

    When you’re done, click Save.

  4. After you save your configuration, the Project Number will be generated in front of the Project Name. You will need to edit the project again to add the project number to the Webhook URL, as seen below:

Retrieving the Xsolla API Key

  1. Open the Xsolla Publisher Dashboard.

  2. In the top navigation bar, open the Settings dropdown menu and choose Company.

    payment

  3. In the API Key section, click Generate to generate a new API key, then click Save. If you have previously generated the API key, you can copy it from here.

    payment

Xsolla Simple Checkout Test

  1. Open the Xsolla Publisher Dashboard and from the left sidebar menu, go to Projects.

    payment

  2. Click Simple Checkout on the desired project.

    payment

  3. You will be redirected to the Simple Checkout page. You can test if the simple checkout works by entering the following information:

    payment

    • Input your AccelByte User ID.
    • Input the Xsolla Invoice ID. You can fill it with a random number for testing purposes.
    • Select a Currency from the dropdown list.
    • Input the transaction Amount.
    • Input the Invoice ID. You can fill it with a random string for testing purposes.
  4. Click the Test button and make sure all of the test result indicators are green.

  5. Go to the next step by clicking Launch on the top navigation bar.

    payment

  6. Make sure The module is launched in enabled.

    payment

Setting Up Xsolla as a Payment Configuration in the Admin Portal

  1. In the Admin Portal, go to the Payment Configurations menu under the Platform Configurations dropdown on the top-right header.

    payment

  2. Add a new configuration by clicking the New Configuration button.

    payment

  3. Fill in the required information.

    payment

    • Select the Namespace for the payment configuration. You can select all namespaces if desired.
    • Select the Region for the payment configuration. You can select all regions if desired.
    • Select Xsolla from the Payment Aggregator dropdown list.
    • You can leave the Payment Methods field empty.
  4. Click Submit to continue. You will be redirected to the Payment Configuration page.

  5. In the Payment Aggregator section, under the Xsolla tab, fill in the required information.

  6. Click the Test button, and make sure you get Xsolla Configured Correctly notification.

Configuring Stripe as a Payment Aggregator

Besides Xsolla and Adyen, you can also use Stripe as a payment aggregator. To set up Stripe, follow the steps below.

Setting Up a Stripe Project

  1. Go to the Stripe Dashboard and choose Developers from the left sidebar.

    payment

  2. Once the Developers menu appears, select the API Keys menu.

    payment

  3. On the API Keys page, go to the Secret Key section and click the Reveal test key token button to show the secret key. You will need the secret key to configure the payment station in the Admin Portal.

    payment

  4. Then, click the Webhooks menu on the left sidebar.

    payment

  5. On the Webhooks page, click the Add endpoint button.

    payment

  6. Fill in the required information.

    • Input the Endpoint URL using the following format.

      <base_url>/platform/public/stripe/notifications
    • Input a Description of the webhook. This field is optional.

    • Select an available event to connect the webhook to, or you can add all available events by clicking receive all events.

    payment

Setting Up Stripe as a Payment Configuration in the Admin Portal

  1. In the Admin Portal, go to the Platform Configurations dropdown and choose Payment Configurations.

    payment

  2. Click the New Configuration button to add a new configuration.

    payment

  3. Fill in the required fields.

    • Select the Namespace for the payment configuration. You can select all namespaces if desired.
    • Select the Region for the payment configuration. You can select all regions if desired.
    • Select Stripe from the Payment Aggregator dropdown list.
    • You can leave the Payment Methods field empty.

    payment

    When you’re done, click the Submit button and you will be redirected to the Payment Configuration page.

  4. In the Payment Aggregator section, click Configure Now.

    payment

  5. Fill in the required fields.

    • Input the Publishable Key field with the key you received from the Stripe dashboard.
    • Input the Secret Key field with the key you received from the Stripe dashboard.
    • Input the Webhook Secret field with the secret you received from the Stripe dashboard.

    payment

  6. Click the Test button and make sure you receive a notification that Stripe has been configured correctly.

Managing Your Payment Methods

After you’ve configured your payment aggregator, you can also configure the payment methods you support.

  1. In the Admin Portal, go to Payment Configurations Details and scroll down to the Payment Methods panel.

    payment

  2. In the Payment Methods, choose your payment method and input the required information.

    a. For AliPay:

    • Input the App ID from the AliPay platform.
    • Input the Private Key.
    • Input the Public Key.
    • Input the Return URL.

    b. For AliPay Sandbox:

    • Input the App ID from the AliPay Sandbox platform.
    • Input the Private Key.
    • Input the Return URL.
    • Input the Public Key.

    c. For WxPay:

    • Input the App ID from the WxPay platform.
    • Input the Key.
    • Input the MCHID.
    • Input the Return URL.
    • Upload the Certificate AWS Path by clicking the Upload button and searching for the file on your computer.

    After you’ve filled in the correct form, click the Test button to test the payment configuration.

What’s Next?

  • For more information about the Payment service, check out the API Reference.
  • Take a look at our Fulfillment service.
  • Learn about how to set up Currency on our platform.