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.00in the chosen currency. Every case uses new rounds and transactions, moves2.00at 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.
| Case | Result | |
|---|---|---|
| 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
| Group | Case | What we send | It passes when |
|---|---|---|---|
| Balance | Get balance | A balance call for your player. | You answer code: 0 with the balance as a number in data.balance. |
| Balance | Unknown player | A balance call for a player that does not exist. | You answer code: 2. |
| Balance | Invalid signature | A balance call signed with a wrong key. | You reject it with code: 4. |
| Debit | Single bet | A debit of 1.00, type bet. | You answer code: 0, the balance in your answer and the next balance call are 1.00 lower. |
| Debit | Insufficient balance | A debit of your balance plus 1000.00. | You answer code: 1 and the balance does not change. |
| Debit | Repeated bet | The same debit twice, with the same transaction. | Both answers are code: 0 with the same balance, and the balance goes down once. |
| Debit | Unknown player in debit | A debit for a player that does not exist. | You answer code: 2. |
| Debit | Invalid signature in debit | A debit of 1.00 signed with a wrong key. | You reject it with code: 4 and the balance does not change. |
| Credit | Single win | A 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. |
| Credit | Repeated win | The same credit twice, with the same transaction. | Both answers are code: 0 with the same balance, and the win is paid once. |
| Credit | Unknown player in credit | A credit for a player that does not exist. | You answer code: 2. |
| Credit | Invalid signature in credit | A 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. |
| Credit | Win without a bet | A credit of type win for a round with no bet. | You answer code: 3 and the balance does not change. |
| Credit | Credits without a bet | A 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. |
| Rollback | Bet rollback | A bet of 1.00 and a credit of type rollback for that round. | You answer code: 0 and return the bet. |
| Rollback | Unknown rollback | A credit of type rollback for a round you never received. | You answer code: 3 and the balance does not change. |
| Rollback | Repeated rollback | A 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. |
| Rollback | Win void | A 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. |
| Protocol | Always HTTP 200 | A 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. |
| Protocol | Response time | A 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:
GETto your balance URL withaction=BALANCE,currency,session_token(when you fill it in) anduserin the query string. - Debit and credit:
POSTwith a JSON body:action(DEBITorCREDIT),amount,betRound,currency,game,round,session_token,transaction,typeanduser. - Signature: the
X-CONTENT-KEYheader 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
creditwithtype: rollback, the sameroundandamountas the bet, and the bet'stransactionwith a negative sign. - Win void: a
debitwithtype: rollback, the sameroundandamountas the win, and its owntransaction. - 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.