Skip to main content

Test

In this section, you will find information on testing, as well as test data. All users, items, and payment involved in Sandbox transactions are fictitious. You are able to test all the Invoice features, just as they are in the production environment. However, it is not possible to interact with the MobilePay app, therefor it is not possible to accept or reject invoices from the app. Instead, you have access to a testing API: Invoice User Simulation API , which makes it possible to imitate user actions

Making the first call

Step 1. Get Tokens When you have gone through OpenID Connect, then you can start calling the API. All calls to Invoice endpoints require access tokens, and they are used to make API requests on behalf of a user. The content of the header should look like the following.

Header examples
accept: application/json
content-type: application/json
authorization:: REPLACE_THIS_VALUE

We recommend you start with getting the MerchantId .

Step 2. Get MerchantId MerchantId is a unique identifier of a merchant in our system. After you retrieve an access token from OpenID flow use the following endpoint to retrieve your MerchantId.

GET /api/v1/merchants/me

Step 3. Get Invoice Issuer Afterwards you should get an invoice issuer. Invoice issuer represents merchant’s company information. The merchant is the customer company and the Invoice Issuer is the actual service provider name under which they create invoices

GET /api/v1/merchants/{merchantId}/invoiceissuers

Read more about Invoice Issuer on GitHub here

Test Actions

InvoiceDirect

  1. Create an InvoiceDirect
  2. Create multiple InvoiceDirect
  3. Cancel an unpaid Invoice

InvoiceLink

  1. Create an Invoice Link
  2. Create multiple InvoiceLink

Consent:

  1. Test User Consent for Invoice Direct

User simulation API

We supply a testing API, Invoice User Simulation, that simulates user actions in the app. With the API, you can:

  • Get an Invoice PDF
  • Accept an Invoice
  • Reject an Invoice
  • Test User Consent

We expect that you have simulated the 4 features listed above, before you start the verification process. Then it can be completed in a day. You should test both InvoiceDirect and InvoiceLink.

Test users and test data

When testing Invoice, then you'll use the Invoice User Simulation API that you'll find here. To create an Invoice, you must supply

  • Authenticated user id
  • ConsumerCard
  • Phone number

Below you can find a list of test users for Denmark and Finland. If there is an issue with a test user, please try a different user, or contact us at developer@mobilepay.dk

note

When testing Invoice payments in Sandbox remember to use the same authenticated user id for both creating and approving the invoice. The testusers are CPR validated, so the maximum amount is 3.000 kr., which is why we recommend that you test only using low amounts.

Authenticated user idConsumerCardPhone numberConsumer name
f1a75bb4-c8a6-41f8-8603-4cf9278cd5ba6956b1ae-be59-4d7c-ba1c-8aa188db83b7+4557373259Test name
4f474aa2-6161-4094-97fd-62616ff3d21ea6d8044d-176b-4639-a55f-d14d1ae11e28+4599592431Test name*
d5e4e229-b482-4304-80f1-237d2a3abc48d77db24c-f078-4eaf-8026-fbaa8411a8fe+4522509895Test name
40b881f7-ac3d-43bb-81e6-2ac9ef279d896cdf304d-d4c5-4126-9775-a286ce16838b+4554048573Test name
147a8bbd-6a87-40e7-9980-937d1b8d0de49c55892e-66dc-41c8-b256-13bf599ac377+4585155935Test name

*Card is expired. Use this testuser to test error handling for failed card scenarios

note

You cannot use the MobilePay app installed on your phone when you are testing in sandbox environment. Instead you must use the Invoice User Simulation API to simulate customer actions.