Client-Side Implementation Steps
-
Initialise Payment
- Get Product Bundle Ids from the Pay1st Admin Console. These are for the bundles created for each purchase bundle that is created.
- Set up a successful callback URL for the product from the Pay1st Admin Console. This will be called when a payment is successful as mentioned in section here.
- Set up a failure callback URL for the product from Pay1st Admin Console. This will be called when a payment has failed as mentioned in section here.
- When a user selects a bundle, redirect to the platform purchase endpoint with the following params:
Param Format Description username String The user identity. This should be a unique identifier used to identify the user in the game. platform String {AND, IOS, WEB} The mobile platform is used to load the Platform. Use WEB for payments from web applications. productBundleId Long The bundle identifier as configured in Platform countryCode String The ISO 2 country code, e.g. ZA externalReference String (Optional) Your own reference that you would want to use for reconciliation. It will be sent back in the summary webhook. amount Decimal (Optional) The amount to pay. currencyCode String (Optional) The currency code for the amount. partnerSource String The source that identifies the partner. quantity Decimal The quantity of product bundle being bought isPay1st Boolean The value of this attribute should be set to 'true' channelId Long The id of the payment method isHeadless Boolean The value of this attribute should be set to 'true' URL params:
https://<payments_url>/payment?username=<USERNAME>&platform=<PLATFORM>&productBundleId=<PRODUCT_BUNDLE_ID>&countryCode=<COUNTRY_CODE>&externalReference=<EXTERNAL_REFERENCE>&amount=<AMOUNT>¤cyCode=<CURRENCY_CODE>&headless=<TRUE>&partnerSource=<PARTNER_SOURCE>&quantity=<QUANTITY>&isPay1st=<TRUE>&channelId=<PAYMENT_METHOD_ID>