Step 2 - Sandbox Testing 

In this section, you can find information on testing in sandbox, as well as how to get test data. The MobilePay Sandbox is a self-contained, testing environment that mimics the live MobilePay production environment. To ensure a good user experience, we recommend you to test your solution thoroughly before launching. 

The sandbox environment can be found here: https://sandbox-developer.mobilepay.dk/

Testing a MobilePay Online payment

As PSP, you can now initiate a MobilePay Online payment against our Sandprod environment.

  1. Create a test merchant by calling: POST /api/v1/merchants
  2. Initiate a payment by calling: POST /api/v1/payments Receive redirectToMobilePayUrl in response
  3. 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. In production you would now get a notification on your phone, but this is not yet working in sandbox
  4. Login to the app using your test credentials (see below section about test app)
  5. You should automatically see a confirmation page for the payment
  6. Swipe to approve
  7. Receive cardDataCallback end decrypt this. In production you will call the aquire at this point.
  8. Update authorization attempt with succeeded true or false by calling: PATCH /api/v1/payments/{paymentId}/authorizationattempts/{authorizationAttemptId}
  9. Create capture by calling: POST /api/v1/payments/{paymentId}/captures
Test app

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.

Android
To install, you will have to allow installation from “unknown sources”.
MobilePay DK Vendor
MobilePay FI Vendor

iOS
When the app is installed, you have to accept “MobilePay A/S” as app distributor under Settings > General > Profiles & Device management, to make it work.
MobilePay DK Vendor
MobilePay FI Vendor

Log on to test app

  1. Install and open the MobilePay DK/FI Vendor app
  2. Select "Log på (Eksisterende bruger)" / "Kirjaudu sovellukseen / "Log on (existing user)"
  3. Enter a valid Sandbox phone number (see below section about test users)
  4. Enter PIN: “1234”
  5. Enter activation code: “123456” and press "OK" / "Jatka"

Android                                                     iOS
android      ios

Check in to beacon and accept payment

  1. After logon choose "Betal" / "Maksa"
  2. Click "Scan QR" / "Skannaa QR"
  3. Create QR as described in Github documentation 
  4. Scan QR code and accept payment
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:
1) User enter phone number for payment.
2) User selects the first eligible card for payment.
3) User swipes to accept payment.

You must subscribe to the User simulation API before you can use it. When calling the API, you must supply:

Input Source
Header: x-ibm- client-id From the developer portal
Header: x-ibm-client-secret From the developer portal
Phonenumber  Received during techincal onboarding. Please contact Developer Support if you do not have a test user
LastFourDigits Optional. 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

How to use the User simulation API:

  1. Initiate a payment: POST /api/v3/payments
  2. Accept the payment: POST /api/v1/product/payments/simulation/enter-phone-and-swipe/{paymentId}
Test user

Through the technical onboarding you will receive a sandbox test user. If you have not yet received one, please contact developer@mobilepay.dk 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.
 
Note: Please inform if you wish to test the checkout feature. This will require a special test user and are not available with the regular test users. 

If you experience any issues with the test user, please contact developer@mobilepay.dk
GitHub Documentation

​Review our documentation on Github using the link below. Here you find extended technical documentation

Step 3. Verification

You need to go through a small verification when moving from sandprod til hidden production, and before going live to ensure that your setup is ready.