Test cases

Use these scenarios to validate that your integration works reliably across success, failure, and edge conditions. They’re grouped by integration type so you can focus on what’s relevant.

ℹ️

This section highlights core categories to test — for the full list of test cases to complete before go-live, please contact us at [email protected].

API integration

ScenarioHow to testExpected result
Calculate carbon impactSend a valid POST /impact_calculator requestResponse includes footprint, equivalents and compensationValue
Handle missing dataOmit a required field (e.g. amount)400 Bad Request error returned
Invalid API keyCall with a wrong or missing X-Api-Key401 Unauthorised error returned
Funds allocationSend valid POST /projects/funds requestContribution succeeds, referenceId returned
ReversalReverse a previous contribution with POST /reversalContribution is reversed, linked to the original referenceId

Post-purchase SDKs (ImpactPay)

ScenarioHow to testExpected result
Session createdCall POST /impactpay/sessions with valid detailsResponse includes impactPaySessionId + clientSecret
Invalid sessionUse missing or bad paramsError response returned
Page takeoverClick on CTA in takeover componentRedirects to redirectUrl with success
Embedded flowRender embedded component in confirmation pageSDK loads with correct impact data

ImpactPay URL

ScenarioHow to testExpected result
Calculate carbon impactSend a valid POST /impact_calculator requestResponse includes footprint, equivalents and compensationValue
Valid URLOpen ImpactPay URL with valid footprintIdPage loads with correct impact data
Invalid referenceOpen URL with invalid footprintIdError page shown
Contribution flowComplete hosted contributionConfirmation screen, webhook fires

Webhooks

ScenarioHow to testExpected result
Valid eventSend test webhook with correct signatureEvent accepted
Invalid signatureSend webhook with wrong signatureEvent rejected
Endpoint unavailableTemporarily block your endpointEvent retried with exponential backoff
Event typesMake contribution via ImpactPayIMPACT_PAYMENT received

Checkout SDK

ScenarioHow to testExpected result
Session createdCall POST /checkout/sessions with valid detailsResponse includes checkoutSessionId + clientSecret and footprintId
Invalid sessionUse invalid product/merchant dataError response returned
Toggle behaviourToggle compensation/round-up in checkoutEvents emitted, basket total updates accordingly
Error handlingBreak SDK load or trigger invalid stateCheckout continues, ekko:error event logged

Test cards

Depending on the payment processor for your integration of ImpactPay, you can use the following test cards for an end-to-end flow through ImpactPay on sandbox (https://impactpay-sandbox.ekko.earth/....)

Best practices

  • Always run tests for both happy paths and error conditions
  • Include edge values (very small, very large amounts, different currencies)
  • Log identifiers (reference, footprintId, impactPaySessionId, checkoutSessionId) to simplify debugging