Learn how to migrate to the latest version of the Java SDK
Warning
This feature is currently in Beta testing, and the final specification may still change.
Mollie uses API specification to autogenerate the SDK and enhance its consistency, ensure frequent updates and provide a more streamlined integration experience for developers.
The new version of Java SDK introduces a number of changes that might affect the way your integration works and require adjustments in your current setup: new ways of defining specific arguments, changes to methods and parameter names etc.
This guide takes you through all the changes specific to Java SDK to help you upgrade your integration.
You can still use the legacy version of this SDK along with the new version but we advise to upgrade as soon as possible to ensure continuous compatibility.
Here are some things you need to know about the new Java SDK to ensure a consistent integration:
-
Client Creation The method to create the client changed, consolidating the Api Key and the oAuth methods.
-
Method Names The method names have been updated for better clarity and consistency across all the SDKs.
Old
import be.woutschoovaerts.mollie.Client;
import be.woutschoovaerts.mollie.ClientBuilder;
public class Application {
public static void main(String[] args) {
Client client = new ClientBuilder()
.withApiKey("API_KEY")
.build();
}
}New
import com.mollie.mollie.Mollie;
import com.mollie.mollie.models.components.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Mollie sdk = Mollie.builder().security(
Security.builder().apiKey("API_KEY").build()
).build();
}
}Old
Could not find an example.
New
import com.mollie.mollie.Mollie;
import com.mollie.mollie.models.components.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Mollie sdk = Mollie.builder().security(
Security.builder().apiKey("OAUTH_KEY").build()
).build();
}
}To see code examples for each method refer to the README.
| API | Endpoint | Java Method Name | New SDK Method Name |
| Payments API | Create payment | client.payments.createPayment | client.payments.create |
| List payments | client.payments.listPayments | client.payments.list | |
| Get payment | client.payments.getPayment | client.payments.get | |
| Update payment | client.payments.updatePayment | client.payments.update | |
| Cancel payment | client.payments.cancelPayment | client.payments.cancel | |
| Release payment authorization | - | client.payments.releaseAuthorization | |
| Methods API | List payment methods | client.methods.listMethods | client.methods.list |
| List all payment methods | client.methods.listAllMethods | client.methods.all | |
| Get payment method | client.methods.getMethod | client.methods.get | |
| Enable payment method | client.profiles.enablePaymentMethod | client.methods.enable | |
| Disable payment method | client.profiles.disablePaymentMethod | client.methods.disable | |
| Enable payment method issuer | client.profiles.enableGiftCardIssuer client.profiles.enableVoucherIssuer | client.methods.enableIssuer | |
| Disable payment method issuer | client.profiles.disableGiftCardIssuer client.profiles.disableVoucherIssuer | client.methods.disableIssuer | |
| Refunds API | Create payment refund | client.refunds.createRefund | client.refunds.create |
| List payment refunds | client.refunds.listRefunds | client.refunds.list | |
| Get payment refund | client.refunds.getRefund | client.refunds.get | |
| Cancel payment refund | client.refunds.cancelRefund | client.refunds.cancel | |
| Create order refund | client.orders.createOrderRefund | client.refunds.createOrder | |
| List order refunds | client.orders.getOrderRefunds | client.refunds.getOrder | |
| List all refunds | client.refunds.listRefunds | client.refunds.all | |
| Chargebacks API | List payment chargebacks | client.chargebacks.listChargebacks | client.chargebacks.list |
| Get payment chargeback | client.chargebacks.getChargeback | client.chargebacks.get | |
| List all chargebacks | client.chargebacks.listChargebacks | client.chargebacks.all | |
| Captures API | Create capture | client.captures.createCapture | client.captures.create |
| List captures | client.captures.listCaptures | client.captures.list | |
| Get capture | client.captures.getCapture | client.captures.get | |
| Wallets API | Request Apple Pay payment session | client.wallets.requestApplePaySession | client.wallets.requestApplePaySession |
| Payment Links API | Create payment link | client.paymentLinks.createPaymentLink | client.paymentLinks.create |
| List payment links | client.paymentLinks.listPaymentLinks | client.paymentLinks.list | |
| Get payment link | client.paymentLinks.getPaymentLink | client.paymentLinks.get | |
| Update payment link | client.paymentLinks.updatePaymentLink | client.paymentLinks.update | |
| Delete payment link | client.paymentLinks.deletePaymentLink | client.paymentLinks.delete | |
| Get payment link payments | client.paymentLinks.listPaymentLinkPayments | client.paymentLinks.listPayments | |
| Terminals API | List terminals | client.terminals.listTerminals | client.terminals.list |
| Get terminal | client.terminals.getTerminal | client.terminals.get | |
| Delayed Routing API | Create a delayed route | - | client.delayedRouting.create |
| List payment routes | - | client.delayedRouting.list | |
| Orders API | Create order | client.orders.createOrder | client.orders.create |
| List orders | client.orders.getOrders | client.orders.list | |
| Get order | client.orders.getOrder | client.orders.get | |
| Update order | client.orders.updateOrder | client.orders.update | |
| Cancel order | client.orders.cancelOrder | client.orders.cancel | |
| Manage order lines | client.orders.manageOrderLines | client.orders.manageLines | |
| Cancel order lines | client.orders.cancelOrderLines | client.orders.cancelLines | |
| Update order line | client.orders.updateOrderLine | client.orders.updateLine | |
| Create order payment | client.orders.createOrderPayment | client.orders.createPayment | |
| Shipments API | Create shipment | client.shipments.createShipment | client.shipments.create |
| List shipments | client.shipments.getShipments | client.shipments.list | |
| Get shipment | client.shipments.getShipment | client.shipments.get | |
| Update shipment | client.shipments.updateShipment | client.shipments.update | |
| Customers API | Create customer | client.customer.createCustomer | client.customers.create |
| List customers | client.customer.listCustomers | client.customers.list | |
| Get customer | client.customer.getCustomer | client.customers.get | |
| Update customer | client.customer.updateCustomer | client.customers.update | |
| Delete customer | client.customer.deleteCustomer | client.customers.delete | |
| Create customer payment | client.customer.createCustomerPayment | client.customers.createPayment | |
| List customer payments | client.customer.listCustomerPayments | client.customers.listPayment | |
| Mandates API | Create mandate | client.mandates.createMandate | client.mandates.create |
| List mandates | client.mandates.listMandates | client.mandates.list | |
| Get mandate | client.mandates.getMandate | client.mandates.get | |
| Revoke mandate | client.mandates.revokeMandate | client.mandates.revoke | |
| Subscriptions API | Create subscription | client.subscriptions.createSubscription | client.subscriptions.create |
| List customer subscriptions | client.subscriptions.listSubscriptions | client.subscriptions.list | |
| Get subscription | client.subscriptions.getSubscription | client.subscriptions.get | |
| Update subscription | client.subscriptions.updateSubscription | client.subscriptions.update | |
| Cancel subscription | client.subscriptions.cancelSubscription | client.subscriptions.cancel | |
| List all subscriptions | client.subscriptions.listAllSubscriptions | client.subscriptions.all | |
| List subscription payments | client.subscriptions.listSubscriptionPayments | client.subscriptions.listPayments | |
| OAuth API | Authorize | client.oAuth.createAuthorizationUrl | client.oauth.authorize |
| Generate tokens | client.oAuth.generateTokens | client.oauth.generate | |
| Revoke tokens | client.oAuth.revokeToken | client.oauth.revoke | |
| Permissions API | List permissions | client.permissions.getPermissions | client.permissions.list |
| Get permission | client.permissions.getPermission | client.permissions.get | |
| Organizations API | Get organization | client.organizations.getOrganization | client.organizations.get |
| Get current organization | client.organizations.getMyOrganization | client.organizations.current | |
| Get partner status | client.organizations.getPartner | client.organizations.partner | |
| Profiles API | Create profile | client.profiles.createProfile | client.profiles.create |
| List profiles | client.profiles.getProfiles | client.profiles.list | |
| Get profile | client.profiles.getProfile | client.profiles.get | |
| Update profile | client.profiles.updateProfile | client.profiles.update | |
| Delete profile | client.profiles.deleteProfile | client.profiles.delete | |
| Get current profile | client.profiles.getMyProfile | client.profiles.current | |
| Onboarding API | Get onboarding status | client.onboarding.getOnboardingStatus | client.onboarding.get |
| Submit onboarding data | client.onboarding.submitOnboardingData | client.onboarding.submit | |
| Capabilities API | List capabilities | - | client.capabilities.list |
| Clients API | List clients | client.clients.getClients | client.clients.list |
| Get client | client.clients.getClient | client.clients.get | |
| Client Links API | Create client link | client.clientLinks.createClientLink | client.clientLinks.create |
| Balances API | List balances | client.balances.getBalances | client.balances.list |
| Get balance | client.balances.getBalance | client.balances.get | |
| Get primary balance | client.balances.getPrimaryBalance | client.balances.primary | |
| Get balance report | client.balances.getBalanceReport | client.balances.report | |
| List balance transactions | client.balances.getBalanceTransactions | client.balances.transactions | |
| Settlements API | List settlements | client.settlements.getSettlements | client.settlements.list |
| Get settlement | client.settlements.getSettlement | client.settlements.get | |
| Get open settlement | client.settlements.getOpenSettlement | client.settlements.open | |
| Get next settlement | client.settlements.getNextSettlement | client.settlements.next | |
| Get settlement payments | client.settlements.getSettlementPayments | client.settlements.payments | |
| Get settlement captures | client.settlements.getSettlementCaptures | client.settlements.captures | |
| Get settlement refunds | client.settlements.getSettlementRefund | client.settlements.refunds | |
| Get settlement chargebacks | client.settlements.getSettlementChargebacks | client.settlements.chargebacks | |
| Invoices API | List invoices | client.invoices.getInvoices | client.invoices.list |
| Get invoice | client.invoices.getInvoice | client.invoices.get |