All Projects → klarna → kco_rest_java

klarna / kco_rest_java

Licence: Apache-2.0 license
[DEPRECATED] Official Java SDK library for Klarna Services

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to kco rest java

cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (+76%)
Mutual labels:  java-sdk, payment-methods
m2-MSP CashOnDelivery
Cash on delivery module for Magento 2
Stars: ✭ 50 (+100%)
Mutual labels:  payment-methods
union-pay
simplest union pay(银联支付)
Stars: ✭ 32 (+28%)
Mutual labels:  pay
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (+376%)
Mutual labels:  order-management
OrderSystem
An independent micro-service that takes orders in and processes payments.
Stars: ✭ 16 (-36%)
Mutual labels:  order-management
next
(Work in progress) The rewritten version of the original PizzaQL 🍕
Stars: ✭ 45 (+80%)
Mutual labels:  order-management
commercetools-jvm-sdk
The e-commerce SDK from commercetools running on the Java virtual machine.
Stars: ✭ 59 (+136%)
Mutual labels:  java-sdk
hms-iap-clientdemo-android-studio
This demo app provides all 3 types of product to demonstrate the procedure and capability of Huawei IAP.
Stars: ✭ 36 (+44%)
Mutual labels:  pay
react-native-wx-ali-pay
react-native pay for Ali && WeiXin
Stars: ✭ 15 (-40%)
Mutual labels:  pay
vika.java
Vika is a API-based SaaS database platform for users and developers, Java SDK for connecting vikadata Open API.
Stars: ✭ 26 (+4%)
Mutual labels:  java-sdk
adyen-android
Adyen SDK for Android
Stars: ✭ 89 (+256%)
Mutual labels:  payment-methods
QuickBooks-V3-Java-SDK
Java SDK for QuickBooks REST API v3 services
Stars: ✭ 49 (+96%)
Mutual labels:  java-sdk
sdk-java
Temporal Java SDK
Stars: ✭ 117 (+368%)
Mutual labels:  java-sdk
postnl-magento2
This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend. https://tig.nl/postnl-extensie/
Stars: ✭ 52 (+108%)
Mutual labels:  shipping-service
iran-payment
a Laravel package to handle Internet Payment Gateways for Iran Banking System
Stars: ✭ 16 (-36%)
Mutual labels:  pay
CoinHive
A nice friendly simple and easly customizable GUI for coinhives javascript miner to embed onto websites so users of your site can interact with features of the miner on every single page this javascript miner is to help those who have problems with advertisements/advertising/ads popups banners mobile redirects malvertising/malware etc and provid…
Stars: ✭ 58 (+132%)
Mutual labels:  pay
DYFStoreKit
([Swift] https://github.com/chenxing640/DYFStore) A lightweight and easy-to-use iOS library for In-App Purchases (Objective-C). DYFStoreKit uses blocks and notifications to wrap StoreKit, provides receipt verification and transaction persistence and doesn't require any external dependencies.
Stars: ✭ 52 (+108%)
Mutual labels:  pay
fabric-java-block
集成springboot和fabric sdk 提供rest api的接口
Stars: ✭ 37 (+48%)
Mutual labels:  java-sdk
peasy-js-samples
Showcases business logic built with peasy-js and consumed by multiple clients
Stars: ✭ 19 (-24%)
Mutual labels:  order-management
sep-pay
Pay.ir Payment Package for Laravel 5.3+
Stars: ✭ 17 (-32%)
Mutual labels:  pay

[DEPRECATED] Official Klarna REST Java SDK

Maven Version Build Status Coverage Status

SDK Deprecation Warning and Sunsetting

Dear community, the SDK you are currently looking at is now deprecated. These are details related to sunsetting:

  • We intend to archive this repo on June 1 2020 (01/06/20)
  • Until November 1 2020 (01/11/20) high severity security issues found within the latest published version will be fixed. All support will cease after this date.
  • No new builds will follow effective April 20 (20/04/2020) apart from the fixes mentioned above.

Workarounds

We are making Klarna REST API definition files available in Swagger / OAS v2 format, under the Klarna API Reference section on the Klarna Developer Portal. These will be regularly updated as the APIs evolve. You can use tools like https://swagger.io/tools/swagger-codegen/ to generate your own SDKs, client libraries, etc.

Shop now. Pay later.

Shop at your favorite stores today and experience the freedom to pay later with Klarna.

⚠️ 22/01/20 Release of v4.0.0, see CHANGELOG for an overview of what changed.

Due to security vulnerability in com.fasterxml.jackson.core:jackson-databind we highly recommend you upgrade your Java SDK to version >=3.1.1.

More information about the issue:

Getting started

SDK covers all of Klarna API: https://developers.klarna.com/api/

Prerequisites

API Credentials

Before getting a production account you can get a playground one. Register below to be able to test your SDK integration before go live, by selecting your region:

https://developers.klarna.com/documentation/testing-environment/#developer-signup-test-credentials

Installing the Java SDK

The Java SDK requires Java 1.7 version or higher.

Maven

To install the Java SDK from the Central Maven repository using Maven, add the following lines to pom.xml:

<dependency>
    <groupId>com.klarna</groupId>
    <artifactId>kco-rest</artifactId>
    <version>[4.0,)</version>
</dependency>

Gradle

To install the Java SDK from the Central Maven repository using Gradle, add the following lines to build.gradle:

dependencies {
    compile group: 'com.klarna', name: 'kco-rest', version:'4.0+'
}

Documentation

The various documentation is available:

Usage

Example files can be found in the examples package.

The basic workflow is the following:

  1. Create an SDK Client

  2. Build the new API instance via created Client

    package com.mycompany.app;
    
    import com.klarna.rest.Client;
    import com.klarna.rest.api.checkout.CheckoutOrdersApi;
    import com.klarna.rest.api.checkout.model.CheckoutOrder;
    import com.klarna.rest.http_transport.HttpTransport;
    import com.klarna.rest.model.ApiException;
    
    import java.io.IOException;
    
    /**
     * Klarna Checkout Example
     */
    public class App
    {
        public static void main( String[] args )
        {
            Client client = new Client("username", "password", HttpTransport.EU_BASE_URL);
            CheckoutOrdersApi checkoutOrdersApi = client.newCheckoutOrdersApi();
    
            try {
                CheckoutOrder order = checkoutOrdersApi.fetch("checkoutOrderID-123");
    
                // Order has been successfully fetched, we can get some info, e.g. HTML Snippet
                // This snippet can be embedded into your website/templates/etc
                String htmlSnippet = order.getHtmlSnippet();
                System.out.println(htmlSnippet);
    
                // Or print a whole order data
                System.out.println(order);
    
            } catch (IOException e) {
                System.out.println("Connection problem: " + e.getMessage());
            } catch (ApiException e) {
                System.out.println("API issue: " + e.getMessage());
            }
        }
    }

Logging and Debugging

The Java SDK uses the slf4j library as an abstraction for various logging frameworks. We have not provided any back-end implementation. Choose an implementation that applies to your project.

For more information, see the slf4j documentation.

You can debug and check all the requests and responses made via the SDK. In order to enable debug mode you need to change the logging level of your Logger to "debug".

For example, if you use log4j2 logger, put this line to your log4j2.properties file:

rootLogger.level = debug

The output will look like:

[18-Oct-25 14:16:09:652] [DEBUG] [HttpUrlConnectionTransport:312] - DEBUG MODE: Request
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GET: https://api.playground.klarna.com/customer-token/v1/tokens/TOKEN
Headers: Headers: {User-Agent=[Language/Java_1.8.0_161 (Vendor/Oracle Corporation; VM/Java HotSpot(TM) 64-Bit Server VM) Library/Klarna.kco_rest_java_3.0.0 OS/Mac OS X_10.13.4], Content-Type=[application/json]}
Payout:

DEBUG MODE: Response
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Headers: {null=[HTTP/1.1 200 OK], Server=[openresty], Connection=[keep-alive], Vary=[Accept-Encoding], Content-Length=[166], Date=[Thu, 25 Oct 2018 12:16:09 GMT], Content-Type=[application\/json]}
Payout: {"status" : "ACTIVE","payment_method_type" : "INVOICE"}

How to contribute

At Klarna, we strive toward achieving the highest possible quality for our products. Therefore, we require you to follow these guidelines if you wish to contribute.

To contribute, the following criteria needs to be fulfilled:

  • Description regarding what has been changed and why
  • Pull requests should implement a boxed change
  • All code and documentation must follow the style specified by the included configuration (src/checkstyle.xml)
  • New features and bug fixes must have accompanying unit tests:
    • Positive tests
    • Negative tests
    • Boundary tests (if possible)
    • No less than 90% decision coverage
  • All unit tests should pass

Questions and feedback

If you have any questions concerning this product or the implementation, please create an issue: https://github.com/klarna/kco_rest_java/issues/new/choose

Use an official Klarna Contact us form (https://klarna.com) if you have a question about the integration.

License

The Klarna Checkout REST Java SDK is released under Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].