For the complete documentation index, see llms.txt. This page is also available as Markdown.

Android

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 MoneyCollect 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. (Default server port is 9099 which can be modified).(The dashboard interface address is the local ip:9898)

2.Set up Client-side

Import MoneyCollect android SDK and initialize SDK.

2.1 Add configuration in build.gradle file

To install the SDK, add moneycollect-android to the dependencies block of your build.gradle file:

2.2 Add viewbinding and the MoneyCollect library to the app’s main module build.gradle

2.3 Initialize SDK

Initialize MoneyCollect android sdk() in the project application

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.(TestRequestData is data constant class,please check moneycollect-api-android-demo for more details)

After the customer completes the payment by clicking Pay Now button, the payment activity will be dismissed and return to the PaymentSheetDemoActivity. At the same time,will callback PAYMENT_RESULT_PAYMENT.

Use the completion block for handling the payment result.

If payment fails with an error, display the appropriate message to your customer so they can take action and try again. If no error has occurred, tell your customer that the payment was successful.

After the customer completes the payment by tapping Pay Now button, the payment activity will be dismissed and return to the PaymentSheetDemoActivity. At the same time,will callback PAYMENT_RESULT_PAYMENT.

Use the completion block for handling the payment result.

If payment fails with an error, display the appropriate message to your customer so they can take action and try again. If no error has occurred, tell your customer that the payment was successful.

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

JCB

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 transactions

4000 0000 0000 0077

Visa

Always fails with a decline code of declined.

Mobile Sdk发起交易示例图

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 MoneyConnectServer API, it needs MoneyCollect dashboard to initiate a request through the private key.

Download the mock merchant portal server 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. (Default server port is 9099 which can be modified).(The dashboard interface address is the local ip:9898)

2. Set up Client-side

Import MoneyCollect android SDK and initialize SDK.

2.1 Add configuration in project build.gradle

2.2 Add viewbinding and the MoneyCollect library to the app’s main module build.gradle

2.3 Initialize SDK

Initialize MoneyCollect android sdk() in the project application

3. Create a payment

After the merchant collects the user information, create a payment and complete the payment on the client side.(TestRequestData is data constant class,please check moneycollect-api-android-demo for more details).

Collect transaction information

Create a payment

When the transaction is created andconfirmationMethodis manual,confirmation of the payment is required to complete this transaction.

If confirmationMethod is automatic, the transaction can be completed directly.

Confirm a payment

If the payment needs to integrate 3D secure authentication, please refer to 3D secure authentication.

4. Additional testing resources

There are several test cards you can use to make sure your integration is ready for production. Use them with anyCVC, 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