iOS

Mobile Sdk initiate transaction schematic diagram

Set up MoneyCollect Server side Client side

Firstly, you need a MoneyCollect account. Register now.

1. Set up Server-side

If the client side wants to access most of the MoneyCollect Server API, it needs the dashboard to initiate a request through the private key.

Download the mock merchant portal interface code on github.

1.1 Using your own key to replace the public key and private key in the MobilePayController.java file

The format of PUBLIC_SECRET & PRIVATE_SECRET is("Bearer"+PUBLIC_SECRET)

1.2 Modify server port(Default to be 9898)

The merchant replaces the public key and private key in the code with their own, and then switch on the server code's default port 9099 can be modified.(The dashboard interface address is the local ip:9898)

2. Set up Client-side

Import MoneyCollect iOS sdk, and then initialize the sdk.

2.1 Installation

To integrate MoneyCollect into your Xcode project using CocoaPods, specify it in your Podfile:

2.2 Initialize sdk

Initialize MoneyCollect iOS sdk in the project AppDelegate.

3. Construct the data parameters to initiate transaction, and then start the payment activity

The merchant constructs the transaction request parameters and clicks the Checkout button to start the payment activity.(The details of using constructMCCreatePaymentParams method to construct data please refer to Example)

After the customer completes the payment by clicking Pay Now button, the payment activity will be dismissed and return to the Example's MCPaymentSheetCheckoutVC. At the same time,return the payment result responseObject through the proxy.

4. Additional testing resources

There are several test cards you can use to make sure your integration is ready for production. Use them with any CVC, postal code, and future expiration date.

Card Number
Brand
DESCRIPTION

4242 4242 4242 4242

Visa

Succeeds and immediately processes the payment.

3566 0020 2036 0505

JCBA

Succeeds and immediately processes the payment.

6011 1111 1111 1117

Discover

Succeeds and immediately processes the payment.

3782 8224 6310 0052

American Express

Succeeds and immediately processes the payment.

5555 5555 5555 4444

Mastercard

Succeeds and immediately processes the payment.

4000002500003155

Visa

This card requires 3D authentication on all transaction

4000 0000 0000 0077

Visa

Always fails with a decline code of declined.

Last updated