Add payment methods

Accepting more payment methods helps your business expand its global reach and improve checkout conversion.

Choose your integration

MoneyCollect Checkout

Checkout is a MoneyCollect-hosted payment form that you can configure in the Dashboard. MoneyCollect selects enabled payment methods from your Dashboard by default but you can also manually select the payment methods using the payment method API.

MoneyCollect.apiKey = "live_pr_xxx";
List<String> paymentMethodTypes = new ArrayList<>();
paymentMethodTypes.add("klarna");
paymentMethodTypes.add("card");
paymentMethodTypes.add("kakao_pay");
SessionCreateParams params =
    SessionCreateParams.builder()
           .setReturnUrl("http://localhost:4242/success.html")
           .setCancelUrl("http://localhost:4242/cancel.html")
           .setNotifyUrl("http://localhost:4242/success.html")
           .setPaymentMethodTypes(paymentMethodTypes)
           .setAmountTotal(1800L)
           .setCurrency("USD")
           .setOrderNo("C"+System.currentTimeMillis())
           .setWebsite("https://www.localhost.com")
           .setBillingDetails(SessionCreateParams.BillingDetails.builder()
                   .setAddress(SessionCreateParams.Address.builder()
                           .setCity("Hong Kong")
                           .setCountry("CN")
                           .setLine1("193 Prince Edward Road")
                           .setPostalCode("12222")
                           .setState("Hong Kong").build())
                   .setEmail("test@mc.com")
                   .setFirstName("Su")
                   .setLastName("Diana")
                   .setPhone("12222211")
                   .build()).build();
Session session = Session.create(params);
response.redirect(session.getUrl());

Payment Element

The Payment Element is a UI component that you embed into your website or app. When customers are ready to complete a purchase, you create a Payment object and configure how you want to display payment methods. You can enable automatic payment methods and let MoneyCollect select enabled payment methods from your Dashboard, or list payment methods manually with payment method types.

MoneyCollect.apiKey = "live_pr_xxx";
PaymentMethod paymentMethod = PaymentMethod.create(
    PaymentMethodCreateParams.builder()
            .setType(PaymentMethodCreateParams.PaymentMethodType.Klarna)
            .setBillingDetails(PaymentMethodCreateParams.BillingDetails.builder()
                    .setAddress(PaymentMethodCreateParams.Address.builder()
                                .setCity("Hong Kong")
                                .setCountry("CN")
                                .setLine1("193 Prince Edward Road")
                                .setPostalCode("12222")
                                .setState("Hong Kong").build())
                    .setEmail("test@mc.com")
                    .setFirstName("Su")
                    .setLastName("Diana")
                    .setPhone("12222211")
                    .build())
            .build()
);
List<String> paymentMethodTypes = new ArrayList<>();
paymentMethodTypes.add(PaymentMethodCreateParams.PaymentMethodType.Klarna.getValue());
PaymentCreateParams params =
    PaymentCreateParams.builder()
            .setAmount(2000L)
            .setCurrency("USD")
            .setOrderNo("{order_no}")
            .setNotifyUrl("http://localhost:4242/notify")
            .setReturnUrl("http://localhost:4242/notify")
            .setPaymentMethodTypes(paymentMethodTypes)
            .setPaymentMethod(paymentMethod.getId())
            .setFromChannel("APP") //(WEB, H5, APP, MINI)
            .setIp("114.155.112.231") //Customer IP
            .setConfirm(true)
            .setAppScheme("moneycollect://payment:8080/webpay")
            .build();
Payment payment = Payment.create(params);
if("requires_action".equals(payment.getStatus())) {
        response.redirect(payment.getNextAction().getRedirectToUrl());
}

Choose payment methods

Your customers see the available payment methods during the checkout process. You can either manage payment methods from the MoneyCollect Dashboard or list payment methods manually in code.

If you let MoneyCollect select the payment methods activated from your Dashboard, we can automatically display all compatible payment methods to your customers depending on the chosen currency and other restrictions such as maximum transaction amounts. MoneyCollect also dynamically reorders them to prioritize the most relevant payment methods based on the customer’s currency, location and other characteristic parameters to help you increase conversion further.

Learn more about local payment methods

Last updated