Integration Testing Scenarios
Following document lists recommended test cases that API clients should test while and after integrating with Bitclear API.
Bitclear recommends testing the scenarios with both Sandbox and Production environments and re-running frequently, especially after each change to your integration.
Under each scenario please find a description of expected behavior
Payment paid correctly
- New Payment
- Payment is paid correct amount
- Bitclear API will send one Payment notification with status
CONFIRMED
,priceAmount
andtransferAmount
will match what was requested
Payment paid after expiration
- New Payment
- Expiration time passes
- API will send one Payment notification with status
EXPIRED
,priceAmount
andtransferAmount
will be zero - Some time passes and payment is paid by the client.
- Bitclear API will send
INVALID
notification,priceAmount
andtransferAmount
will match what was paid (using exchange rate from the moment of payment by the client)
Underpayment
- New Payment
- Payment is paid too little
- API will send one Payment notification with status
UNDERPAID
,priceAmount
andtransferAmount
will match what was paid - Expiration time passes
- API will send
INVALID
notification,paidTransferAmount
andpaidBtc
will not change
Underpayment and the rest was paid
- New Payment
- Payment is paid too little
- API will send one Payment notification with status
UNDERPAID
,priceAmount
andtransferAmount
will match what was paid - Before expiration time passes, user pays the rest.
- API will send
CONFIRMED
notification,priceAmount
andtransferAmount
will match what was originally requested
Payment expired
- New Payment
- Expiration time passes
- API will send
EXPIRED
notification,priceAmount
andtransferAmount
will be zero.
Overpayment (single transaction)
- New Payment
- Payment is paid too much
- API will send
INVALID
notification,paidTransferAmount
andpaidBtc
will match what was paid
Overpayment (two transactions)
- New Payment
- Payment is paid too little
- API will send
UNDERPAID
notification,priceAmount
andtransferAmount
will match what was paid. - User notices the error and sends the missing BTC, due to mistake user sends too much
- API will send
INVALID
notification,priceAmount
andtransferAmount
will match total paid
Unconfirmed Payment
- New Payment
- Payment is paid correct amount
- API decides that due to high amount of Payment it requires one network notification
- API will send
UNCONFIRMED
notification,priceAmount
andtransferAmount
will match what was requested. - Few minutes pass (API receives network confirmation about incoming transaction)
- API will send
CONFIRMED
notification ,priceAmount
andtransferAmount
will match what was requested.
Note: Creating payments for high amounts is the easiest situation to reproduce UNCONFIRMED
state, API analyzes multiple factors to decide if incoming transaction requires network confirmation, so you can trigger this case when testing other scenarios
Unconfirmed Payment invalidated
(This case is very hard to reproduce, please contact support)
- New Payment
- Payment is paid correct amount
- API decides that due to high amount of Payment it requires one network notification
- API will send
UNCONFIRMED
notification,priceAmount
andtransferAmount
will match what was requested. - API notices that the incoming transaction was fraudulent and is removed from blockchain
- API will send
INVALID
notification ,priceAmount
andtransferAmount
will be zero.