Payment Service

Contact Information

Payment service is currently being maintained by these awesome developers:

Let them know if you need any assistance!

Capabilities and Business Functionality

This service handles all payment related APIs listed below:

  1. Payment provider
  2. Player payment account
  3. Operator payment account
  4. Payment transaction
  5. Payment group

Payment service also includes player wallet related functions such as deposit, withdrawal, and balance adjustments that relies on Wallet Service through gRPC methods.

Dependencies

Service Dependencies

Wallet service is dependent on other services through gRPC as listed below:

Service Name Method Usage
User Service ValidateAccess Validate access to API endpoints.
Wallet Service GetBalanceByPlayerId Get player balance by the player ID.
Wallet Service Deposit Add player balance through a deposit transaction.
Wallet Service Adjustment Deposit Add player balance through a deposit adjustment transaction.
Wallet Service Withdrawal Deduct player balance through a withdrawal transaction.
Wallet Service AdjustmentWithdrawal Deduct player balance through a withdrawal adjustment transaction.
Bonus Service GetPendingTransaction Get pending bonus redemptions.
Bonus Service GetRunningRedemptionByPlayerKey Get running bonus redemption by the player key.

RPC Methods

Refer to the payment proto file for a detailed information on the gRPC method.

Method Description
GetPaymentProviders Get a list of payment provider implementation in the operator system
GetPlayerPaymentAccounts Get a list of player payment accounts.
CreatePlayerPaymentAccounts Create a new player payment account.
GetOperatorPaymentAccounts Get a list of operator payment accounts.
GetOperatorPaymentAccount Get an operator payment account detail by the ID.
Create Transaction Create a new payment transaction.
Create Pulsa Transaction Create a new pulsa payment transaction.
GetTransactions Get a list of payment transactions.
GetTransactionByCode Get a detailed payment transaction by the transaction code.
CreateCryptoTransaction Create a new crypto payment transaction.
UpdatePlayerPaymentAccountsPlayerId Update player payment account's player ID. Used on a migrating player.
GetLastTransactionByPlayerKey Get last player payment transaction by the player key.
GetFirstDepositTransactionByPlayerKey Get the first deposit transaction by the player key.
GetFirstDepositTranasctionByPlayerKeys Get the first deposit transaction for multiple player keys.

Implementation

Storing Data

Below are the database table and collection within the payment service:
Database Table/Collection Description
Relational OperatorPaymentAccounts Holds the operator payment account data.
Relational PaymentAccountGroups Junction table for operator payment accounts and payment groups table.
Relational PaymentAccountTransactionTypes Junction table for payment accounts and transaction types table.
Relational PaymentGroups Holds the payment group data.
Relational PaymentMethods Holds the payment method data.
Relational PaymentProviders Holds the payment provider data.
Relational PlayerPaymentAccounts Holds the player payment account data.
Relational TransactionTypes Holds the transaction type data.
Document payments Holds the payment transaction data.

Environment Variables

Make sure to add these variables to your deployment environment before running the application.

Name Description
ENVIRONMENT The environment in which the application runs. For local development, this to local.
SERVICE_NAME The service name. Set this value to payment-service
GOOGLE_PROJECT_ID Google Cloud Project ID for Firebase database.
OPERATOR_CODE The operator code.
ZIPKIN_REPORTER_ENDPOINT_URL Zipkin reporter endpoint URL.
JWT_SIGNATURE_KEY JWT Secret key for authorization.
GCS_BUCKET Google Cloud Storage bucket name.
SOCKET_URL Socket server URL.
SOCKET_API_KEY API key on sending message to socket server.
USER_ID Postgres username.
PASSWORD Postgres password.
HOST Postgres host.
DB_PORT Postgres port.
DATABASE Postgres database name.
KAFKA_BROKERS_URL Kafka brokers URL.
KAFKA_CERT_PATH Path to Kafka cert file.
KAFKA_KEY_PATH Path to Kafka pem file.
KAFKA_PEM_PATH Path to Kafka pem file.
LOGS_TOPIC Kafka topic for logs message.
TRANSACTION_TOPIC Kafka topic for transaction message.
REDIS_ADDRESS Redis database address.
REDIS_DATABASE Redis database number.
WALLET_GRPC_HOST Wallet service gRPC host.
USER_GRPC_HOST User service gRPC host.
BONUS_GRPC_HOST Bonus service gRPC host.
PLAYER_GRPC_HOST Player service gRPC host.