Skip to content

konfig-sdks/blue-snap-java-sdk

Repository files navigation

Visit Bluesnap

At BlueSnap, we look at payments a little differently. Our Payment Orchestration Platform helps businesses accept payments globally and is designed to increase revenue and reduces costs. We provide a comprehensive back-end solutions that simplifies the complexity of payments, managing the full process from start to finish.

BlueSnap supports payments through multiple sales channels such as online and mobile sales, marketplaces, subscriptions, invoice payments and manual orders through a virtual terminal. And for businesses looking for embedded payments, we offer white-labeled payments for platforms with automated underwriting and onboarding that supports marketplaces and split payments.

And with one integration and contract, businesses can sell in over 200 geographies with access to local acquiring in 47 countries, 110+ currencies and 100+ global payment types, including popular eWallets, automated accounts receivable, world-class fraud protection and chargeback management, built-in solutions for regulation and tax compliance, and unified global reporting to help businesses grow.

With a US headquarters in Waltham, MA, and EU headquarters in Dublin, Ireland, BlueSnap is backed by world-class private equity investors including Great Hill Partners and Parthenon Capital Partners.

Learn more at BlueSnap.com

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

If you are adding this library to an Android Application or Library:

  1. Android 8.0+ (API Level 26+)

Installation

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.konfigthis</groupId>
  <artifactId>blue-snap-java-sdk</artifactId>
  <version>8976-Tools</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your build.gradle:

// build.gradle
repositories {
  mavenCentral()
}

dependencies {
   implementation "com.konfigthis:blue-snap-java-sdk:8976-Tools"
}

Android users

Make sure your build.gradle file as a minSdk version of at least 26:

// build.gradle
android {
    defaultConfig {
        minSdk 26
    }
}

Also make sure your library or application has internet permissions in your AndroidManifest.xml:

<!--AndroidManifest.xml-->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/blue-snap-java-sdk-8976-Tools.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.konfigthis.client.ApiClient;
import com.konfigthis.client.ApiException;
import com.konfigthis.client.ApiResponse;
import com.konfigthis.client.BlueSnap;
import com.konfigthis.client.Configuration;
import com.konfigthis.client.auth.*;
import com.konfigthis.client.model.*;
import com.konfigthis.client.api.AgreementApi;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    Configuration configuration = new Configuration();
    configuration.host = "https://sandbox.bluesnap.com/services/2";
    
    // Configure HTTP basic authorization: sec0
    configuration.username = "YOUR USERNAME";
    configuration.password = "YOUR PASSWORD";
    
    configuration.sec1  = "YOUR API KEY";
    BlueSnap client = new BlueSnap(configuration);
    String region = "ca"; // Represents the country. Possible Values: `au`, `ca`
    String type = "onetime"; // Represents the mandate type. Possible Values: `onetime`,`recurring`, `ondemand`
    String planid = "planid_example"; // SKU number
    String overriderecurringchargeamount = "overriderecurringchargeamount_example"; // the amount which overrides recurring charge
    try {
      client
              .agreement
              .createDebitForAusCan(region, type)
              .planid(planid)
              .overriderecurringchargeamount(overriderecurringchargeamount)
              .execute();
    } catch (ApiException e) {
      System.err.println("Exception when calling AgreementApi#createDebitForAusCan");
      System.err.println("Status code: " + e.getStatusCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }

    // Use .executeWithHttpInfo() to retrieve HTTP Status Code, Headers and Request
    try {
      client
              .agreement
              .createDebitForAusCan(region, type)
              .planid(planid)
              .overriderecurringchargeamount(overriderecurringchargeamount)
              .executeWithHttpInfo();
    } catch (ApiException e) {
      System.err.println("Exception when calling AgreementApi#createDebitForAusCan");
      System.err.println("Status code: " + e.getStatusCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://sandbox.bluesnap.com/services/2

Class Method HTTP request Description
AgreementApi createDebitForAusCan POST /agreements/debit/{region}/{type} Create Debit Agreement
AgreementApi getDebit GET /agreements/{agreementId} Get Debit Agreement
AuthorizationApi createTransaction POST /transactions Auth Only
PlanApi createRecurringPlan POST /recurring/plans Create Plan
PlanApi getAll GET /recurring/plans?{parameters} Retrieve All Plans
PlanApi getSpecific GET /recurring/plans/{planId} Retrieve Specific Plan
PlanApi updateRecurringPlan PUT /recurring/plans/{planId} Update Plan
ReversalApi authTransaction PUT /transactions Auth Reversal
ShopperApi createVaultedShopper POST /vaulted-shoppers Create Vaulted Shopper
ShopperApi deleteVaultedShopper DELETE /vaulted-shoppers/{vaultedShopperId} Delete Vaulted Shopper
ShopperApi get GET /vaulted-shoppers/{vaultedShopperId} Retrieve Vaulted Shopper
ShopperApi updateVaultedShopper PUT /vaulted-shoppers/{vaultedShopperId} Update Vaulted Shopper
SubscriptionApi createMerchantManagedCharge POST /recurring/ondemand/{subscriptionId} Create Merchant-Managed Subscription Charge
SubscriptionApi createMerchantManagedSubscription POST /recurring/ondemand Create Merchant-Managed Subscription
SubscriptionApi createNew POST /recurring/subscriptions Create Subscription
SubscriptionApi getSpecific GET /recurring/subscriptions/{subscriptionId} Retrieve Specific Subscription
SubscriptionApi getSwitchChargeAmount GET /recurring/subscriptions/:subscriptionId/switch-charge-amount Retrieve Subscription Switch Charge Amount
SubscriptionApi listAllSubscriptions GET /recurring/subscriptions?{parameters} Retrieve All Subscriptions
SubscriptionApi listCharges GET /:subscriptionId/charges?{parameters} Retrieve All Charges for a Subscription
SubscriptionApi updateSubscription PUT /recurring/subscriptions/{subscriptionId} Update Subscription
TransactionApi approveMerchantTransaction PUT /transactions/approval Merchant Approve Transaction
TransactionApi cancelPendingRefund DELETE /transactions/pending-refund/{transactionId} Cancel Pending Refund
TransactionApi createBatchTransaction POST /batch-transactions Create Batch Transaction
TransactionApi createSofortTransaction POST /alt-transactions Create Sofort Transaction
TransactionApi getBatchTransaction GET /batch-transactions/{batchId} Retrieve Batch Transaction
TransactionApi getById GET /transactions/{transactionId} Retrieve
TransactionApi getPaypalTransaction GET /alt-transactions/resolve?orderId={orderId} Retrieve PayPal Transaction
TransactionApi getPreNotificationDebitAgreement GET /agreements/prenotification/{transactionId} Get Pre-Notification Debit Agreement
TransactionApi getSepaDd GET /alt-transactions/{transactionId} Retrieve SEPA DD Transaction
TransactionApi getSofortTransaction GET /alt-transactions/resolve Retrieve Sofort Transaction
TransactionApi initiateRefund POST /transactions/refund/{transactionId} Refund
TransactionApi updatePaypalTransaction PUT /alt-transactions Update PayPal Transaction
VendorApi create POST /vendors Create Vendor
VendorApi getAllVendors GET /vendors?{parameters} Retrieve All Vendors
VendorApi getVendor GET /vendors/{vendorId} Retrieve Vendor
VendorApi updateVendor PUT /vendors/{vendorId} Update Vendor

Documentation for Models

Author

This Java package is automatically generated by Konfig

About

BlueSnap offers a Payment Orchestration Platform for global payments, increasing revenue and reducing costs. With comprehensive back-end solutions, businesses can accept payments through multiple sales channels in 200+ geographies. Headquartered in Waltham, MA and Dublin, Ireland.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors