Testing a MobilePay Online payment
As PSP, you can now initiate a MobilePay Online payment against our Sandprod environment.
- Create a test merchant by calling:
- Initiate a payment by calling:
POST /api/v1/paymentsYou will receive redirectToMobilePayUrl in response
- Open redirectToMobilePayUrl in a browser to access MobiePay landing page (or from an app). On the landing page enter the test phone number you have received during the technical onoarding.
- Use either test app or user simulation API to accept the payment.
- Receive token or cardData callback. In production you will call the aquire at this point.
- Update authorization attempt with succeeded true or false by calling:
- Create capture by calling:
In order to complete a payment flow in the sandprod environment, a test version of the MobilePay app is available. This version of the MobilePay app is similar to the live version, but only supports payments in the sandprod environment.
To install, you will have to allow installation from “unknown sources”.
iOS MobilePay Sandbox app is available through Apple TestFlight. Therefore Apple TestFlight must be installed to the device. Using below link on a mobile device will initiate download of and registration to TestFlight. No prior registration or invitation needed. Please open below link on your mobile device:
Log on to test app
- Install and open the MobilePay DK/FI Vendor app
- Select "Log på (Eksisterende bruger)" / "Kirjaudu sovellukseen / "Log on (existing user)"
- Enter a valid Sandbox phone number (see below section about test users)
- Enter SSN (Only relevant on fresh install)
- Denmark CPR no.: 000000-0000
- Finland henkilötunnus: 00000000000
- Enter PIN: “1234”
- Enter activation code: “123456” and press "OK" / "Jatka"
User simulation API
To complete a payment flow in the sandprod environment you will need to make user actions. We have made an API that can mimick the actions of a user. You find it in the API overview: Choose 'Online User Simulation'
With the API simulate user behavior:
- User enter phone number for payment.
- User selects the first eligible card for payment.
- User swipes to accept payment.
How to use the User simulation API:
- Initiate a payment:
- Accept the payment:
The test user may have more than one card available. In order to choose a specific card use
LastFourDigits. Last for digit of the decired payment card to be used. These can be found in the test app or by contacting Developer Support. If not defined the first eligible card will be used.
Automated integration tests in Sandbox
The API supports automated integration tests running in Sandbox using the Online User Simulation API. Please refrain from any overly aggressive testing strategies, we expect any continously running tests to call at most once per second.
Through the technical onboarding you will receive a sandbox test user. If you have not yet received one, please contact firstname.lastname@example.org to request a test user. The test user is assigned to your integration and not shared with others.
If you are a merchant please contact your MobilePay Online integrator/PSP to receive a test user from them. Test setup varies from PSP to PSP and therefore MobilePay cannot directly assist with this.
If you experience any issues with the test user, please contact email@example.com