# Add payment methods

### Choose your integration

#### MoneyCollect Checkout

Checkout is a MoneyCollect-hosted payment form that you can configure in the [Dashboard](https://portal.moneycollect.com/). MoneyCollect selects enabled payment methods from your [Dashboard ](https://portal.moneycollect.com/login)by default but you can also manually select the payment methods using the [payment method API](https://apireference.moneycollect.com/docs/api-v1/250b72f42620b-create-a-session).

![](/files/ZVAqgkAOVPqhoo63x9xJ)

```java
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](https://docs.moneycollect.com/docs/payment/pages/kJ3QKKdbPEpF1x2Jf2es#2.-create-a-payment) 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](https://apireference.moneycollect.com/docs/api-v1/c29346f36c5c8-create-a-payment-method).

![](/files/YlQhCFyD5DP6pIflxCwN)

```java
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](https://portal.moneycollect.com/settings/paymentMethods) or list payment methods manually in code.&#x20;

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](/docs/business-operation/alternative-payment-methods.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moneycollect.com/docs/payment/payment-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
