iOS
1.Create a Customer
Pass a customerId to MoneyCollect to attach to the customer.
// Use your customerId
var customerId = "cus_1452880617225281538"2.Construct data, and pay in PaymentSheet model
When creating a payment method, you can specify customer parameters and automatically attach the payment method to an existing customer.
/** Merchant ID */
@property (nonatomic,copy) NSString *customerID;
/** Billing details */
@property (nonatomic,strong) MCBillingDetails *billingDetails;
/** Create payment parameter object */
@property (nonatomic,strong) MCCreatePaymentParams *createPaymentParams;
// Initiate controller
MCSelectPaymentCardVC *selectPaymentCardVC = [[MCSelectPaymentCardVC alloc] init];
selectPaymentCardVC.delegate = self;
// Build request parameters
selectPaymentCardVC.customerID = [MCConfigurationFile getCustomerID];
selectPaymentCardVC.billingDetails = [MCConfigurationFile getBillingDetailsModel];
selectPaymentCardVC.createPaymentParams = [self constructMCCreatePaymentParams];
// Display view
[selectPaymentCardVC present:self];3.Start Hosted Payment Page mode
Tap “Checkout” button to pay in Hosted Payment Page mode.
In Hosted payment page,select the previously saved card or add a new card.
Finally, tap the PayNow button to complete the payment.
4.Customer selects "save this card" during payment
4.1 Select "Save this card for your future use" on the Add a card page.
Select the payment card in the future, when using setupFutureUsage set to "on", otherwise to "off"
4.2 Click "Add a card.
4.3 After create a payment method and attach the payment method to customer will save the card details to customer.
5.Return the payment result
1.Create a Customer
Pass a customerId to MoneyCollect to attach to the customer.
2.Construct data, and add payment methods with PaymentSheet customizable models
When creating a payment method, you can specify customer parameters to automatically attach the payment method to an existing customer.
3.Customer selects save this card during payment
save this card during payment
3.1 Select
Save this card for your future useon the Add a card page.
Select the payment card in the future, when setupFutureUsage set to on, otherwise it will set to off.
3.2 Click
Add a card.3.3 After create a payment method and attach the payment method to customer will save the card details to customer.
4.Customer selects the card to make payment

Click on the Pay Now button to complete the transaction.
5.Return the payment result
The payment result is obtained by calling the confirmPayment API for payment confirmation, and then the result data is passed to the component.
Last updated