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.
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
- Create an InvoiceDirect
- Create multiple InvoiceDirect
- Cancel an unpaid Invoice
InvoiceLink
- Create an Invoice Link
- Create multiple InvoiceLink
Consent:
- 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
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.
- DK test users
- FI test users
Authenticated user id | ConsumerCard | Phone number | Consumer name |
---|---|---|---|
f1a75bb4-c8a6-41f8-8603-4cf9278cd5ba | 6956b1ae-be59-4d7c-ba1c-8aa188db83b7 | +4557373259 | Test name |
4f474aa2-6161-4094-97fd-62616ff3d21e | a6d8044d-176b-4639-a55f-d14d1ae11e28 | +4599592431 | Test name* |
d5e4e229-b482-4304-80f1-237d2a3abc48 | d77db24c-f078-4eaf-8026-fbaa8411a8fe | +4522509895 | Test name |
40b881f7-ac3d-43bb-81e6-2ac9ef279d89 | 6cdf304d-d4c5-4126-9775-a286ce16838b | +4554048573 | Test name |
147a8bbd-6a87-40e7-9980-937d1b8d0de4 | 9c55892e-66dc-41c8-b256-13bf599ac377 | +4585155935 | Test name |
*Card is expired. Use this testuser to test error handling for failed card scenarios
Authenticated user id | ConsumerCard | Phone number | Consumer name |
---|---|---|---|
439d1721-0a36-499f-b236-8bfc61c6cbb7 | b5f78182-e2ff-402e-a646-46c7da8459a0 | +358121161343 | FI Test name |
f5588bb0-d90d-419f-9ec5-7ef138c23f83 | d7328e72-7d21-4f7d-b7f4-9a6861551b70 | +358121161892 | FI Test name |
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.