Skip to main content

Pay By Bank - Test Plan

Overview

Following your development and before going live with Pay By Bank, use this test plan to ensure that you have implemented the core functionality correctly and as intended.

Authentication

This section ensures you are handling client tokens correctly i.e. using a client token multiple client requests throughout its validity period, and renewing the token on expiry time, for subsequent requests.

Valid Client Token

Test ActionAssertions
1. Retrieve a client token (with client ID, secret)Receive 200 response
access_token is included in the response
2. Perform a client request (such as a payment request creation, payment status query, or bank query)Receive 200 Response, with no GraphQL errors
3. Hold client token in memory
4. Perform another client request, still within expiry time (in expires_in seconds)Receive 200 Response, with no GraphQL errors

Expired Client Token

Test ActionAssertions
1. Retrieve a client token successfully (with client ID, secret)Receive 200 response
access_token is included in the response
3. Hold client token in memory, until expiry (in expires_in seconds)
3. Retrieve new client tokenReceive 200 response
access_token is included in the response
4. Perform a client request with the old token, after its expiryReceive 200 Response, with UNAUTHENTICATED error
5. Perform a client request with the newly created tokenReceive 200 Response, with no GraphQL errors

Payment Requests

This section ensures that typical payment flows are being handled as expected, and statuses reflect as expected for each request, after the relevant action has been taken.

Successful Payment Flow

Test ActionAssertions
1. Generate a payment request URL, for any amountReceive 200 Response, no GraphQL errors
Payment initiation URL and Payment ID returned
2. Open fully-built URL (with white-listed redirect URL)Can open link successfully (via browser or iFrame)
Stitch intro page, bank selection list shown
3. Choose Standard Bank and follow to completion (auto-fill OTP)Successful Stitch end-screen shown
User redirected back to specified redirect URL
Redirection includes payment's id, externalReference and status = completed
Webhook with payment request status PaymentInitiationRequestCompleted received by subscribed endpoint
User presented with client-specific success screen, after successful payment

Should you query your payment at this point, the payment's request status will reflect as PaymentInitiationRequestCompleted.

Closed Payment Flow

Test ActionAssertions
1. Generate a payment request URL, for any amountReceive 200 Response, no GraphQL errors
Payment initiation URL and Payment ID returned
2. Open fully-built URL (with white-listed redirect URL)Can open link successfully (via browser or iFrame)
Stitch intro page, bank selection list shown
3. Close Stitch window by clicking X (top right of window)Redirected back to specified redirect URL
Redirection includes payment's id, externalReference and status = closed
User presented with client-specific screen, after payment closure
No webhook for payment is received by the subscribed endpoint

Should you query your payment at this point, the payment's request status will reflect as PaymentInitiationRequestPending.

Expired Payment Flow

Test ActionAssertions
1. Generate a payment request URL, for any amount, with specified expiry timeReceive 200 Response, no GraphQL errors
Payment initiation URL and Payment ID returned
2. Wait for specified expiry time to passWebhook with payment request status PaymentInitiationRequestExpired received by subscribed endpoint

Should you query your payment at this point, the payment's request status will reflect as PaymentInitiationRequestExpired.

Cancelled Payment Flow

This can be skipped if you are not initiating cancellations as part of your implementation.

Test ActionAssertions
1. Generate a payment request URL, for any amountReceive 200 Response, no GraphQL errors
Payment initiation URL and Payment ID returned
2. Initiate Cancellation for payment, using provided Payment IDReceive 200 Response, no GraphQL errors
Webhook with payment request status PaymentInitiationRequestCancelled received by subscribed endpoint

Should you query your payment at this point, the payment's request status will reflect as PaymentInitiationRequestCancelled.