Skip to content
AGG SYSTEM360
Docs

Integration Test

Test your Seamless Wallet before going live. Our testing servers call your balance, debit and credit endpoints with the same cases we check during certification and show you the result of each one.

Before you start

  • Use your testing environment and a testing player. Never enter production URLs or credentials.
  • The player needs a balance of at least 1.00 in the chosen currency. Every case uses new rounds and transactions, moves 2.00 at most and puts back what it moved, so the balance ends as it started.
  • The calls come from the Content360 testing servers, not from your browser. If your wallet only accepts known addresses, ask your Content360 contact for the addresses of the testing environment.
  • Your URLs and secret key go to those servers only to run the cases; they are not stored.

Run the test

Fill in your testing wallet, choose the cases and run them. Each case shows its result, the checks that failed and every call we made, with the signed string and your answer.

Connection
The details of your testing environment. Never use production credentials.

We call /balance, /debit and /credit on this URL.

The one of your testing environment. We sign every call with it in X-CONTENT-KEY.

Optional. Sent as session_token in every call.

Cases
Each case uses new transactions and leaves the player's balance as it was.
CaseResult
Balance
Get balanceAnswers code 0 with the player's balance.
Not run
Unknown playerAnswers code 2.
Not run
Invalid signatureRejects a wrong X-CONTENT-KEY with code 4.
Not run
Debit
Single betAnswers code 0 and deducts 1.00 from the balance.
Not run
Insufficient balanceA bet above the balance answers code 1 and deducts nothing.
Not run
Repeated betThe same transaction twice: the same answer and a single deduction.
Not run
Unknown player in debitA debit for a player that does not exist answers code 2.
Not run
Invalid signature in debitRejects a debit with a wrong X-CONTENT-KEY with code 4 and deducts nothing.
Not run
Credit
Single winAnswers code 0 and adds the win to the balance.
Not run
Repeated winThe same transaction twice: the same answer and a single credit.
Not run
Unknown player in creditA credit for a player that does not exist answers code 2.
Not run
Invalid signature in creditRejects a credit with a wrong X-CONTENT-KEY with code 4 and pays nothing.
Not run
Win without a betA win for a round with no bet answers code 3 and pays nothing.
Not run
Credits without a betPays promo_win and conciliation credits with no bet before them.
Not run
Rollback
Bet rollbackA credit with type rollback returns the bet to the player.
Not run
Unknown rollbackA rollback of a round that never arrived answers code 3.
Not run
Repeated rollbackThe same rollback twice: the same answer and the bet returned once.
Not run
Win voidA debit with type rollback takes a paid win back.
Not run
Protocol
Always HTTP 200Business errors travel in code, never as HTTP 4xx or 5xx.
Not run
Response timeEvery call answers in under 500 ms.
Not run

Cases

GroupCaseWhat we sendIt passes when
BalanceGet balanceA balance call for your player.You answer code: 0 with the balance as a number in data.balance.
BalanceUnknown playerA balance call for a player that does not exist.You answer code: 2.
BalanceInvalid signatureA balance call signed with a wrong key.You reject it with code: 4.
DebitSingle betA debit of 1.00, type bet.You answer code: 0, the balance in your answer and the next balance call are 1.00 lower.
DebitInsufficient balanceA debit of your balance plus 1000.00.You answer code: 1 and the balance does not change.
DebitRepeated betThe same debit twice, with the same transaction.Both answers are code: 0 with the same balance, and the balance goes down once.
DebitUnknown player in debitA debit for a player that does not exist.You answer code: 2.
DebitInvalid signature in debitA debit of 1.00 signed with a wrong key.You reject it with code: 4 and the balance does not change.
CreditSingle winA bet of 1.00 and a credit of 1.00, type win, for the same round.You answer code: 0 and the balance is back where it started.
CreditRepeated winThe same credit twice, with the same transaction.Both answers are code: 0 with the same balance, and the win is paid once.
CreditUnknown player in creditA credit for a player that does not exist.You answer code: 2.
CreditInvalid signature in creditA bet of 1.00 and its win signed with a wrong key, then the same win signed right.You reject the first with code: 4, and the win is paid once.
CreditWin without a betA credit of type win for a round with no bet.You answer code: 3 and the balance does not change.
CreditCredits without a betA credit of 1.00 of type promo_win and another of type conciliation, with no bet, then a debit of type conciliation that takes them back.You pay both with code: 0: they must be processed with no prior bet.
RollbackBet rollbackA bet of 1.00 and a credit of type rollback for that round.You answer code: 0 and return the bet.
RollbackUnknown rollbackA credit of type rollback for a round you never received.You answer code: 3 and the balance does not change.
RollbackRepeated rollbackA bet of 1.00 and the same credit of type rollback twice.Both answers are code: 0 with the same balance, and the bet comes back once.
RollbackWin voidA bet of 1.00, its win and a debit of type rollback for that round.You answer code: 0 and take the win back. A credit of type conciliation then returns the 1.00.
ProtocolAlways HTTP 200A balance and a debit for a player that does not exist.Both answers are HTTP 200 with an error code, never HTTP 4xx or 5xx.
ProtocolResponse timeA balance, a bet and its win.Each call answers in under 500 ms.

Every answer must be HTTP 200 with a JSON object whose code is an integer, and every successful debit or credit returns your transaction id in data.transaction. A case that needs the starting balance stops if the balance call fails or the player has less than 1.00.

How we call your wallet

The runner sends the same requests as production:

  • Balance: GET to your balance URL with action=BALANCE, currency, session_token (when you fill it in) and user in the query string.
  • Debit and credit: POST with a JSON body: action (DEBIT or CREDIT), amount, betRound, currency, game, round, session_token, transaction, type and user.
  • Signature: the X-CONTENT-KEY header is the HMAC-SHA256 of the request, with your secret key. We sort the fields by name and sign the JSON body; for balance we sign the JSON of the query fields, or the query string itself if your account is set up that way (choose it in Balance signature).
  • Rollback: a credit with type: rollback, the same round and amount as the bet, and the bet's transaction with a negative sign.
  • Win void: a debit with type: rollback, the same round and amount as the win, and its own transaction.
  • Time limits: 1 second for each balance attempt, with two retries when the connection fails, and 8 seconds for debit and credit.

The betRound of every test round starts with c360-test-, and the players of the unknown player cases with c360-test-unknown-, so you can find them in your records.

Notes

  • If a case fails after moving money and cannot put it back, the result says so: adjust the player's balance by hand.
  • You can run up to 60 cases per minute.
  • Download report saves the results as JSON, without your secret key, so you can attach them to a support request.