Skip to main content

SDK Android

Integration

import com.aplazame.sdk.AplazameSDK;

String accessToken = "api_public_key";
Boolean sandbox = true;
AplazameSDK.setConfiguration(accessToken, sandbox);

Check availability

To display the payment button with Aplazame based on the limits set in your account

Double amount = 120.50;
String currency = "EUR";

AplazameSDK.checkAvailability(amount, currency, new AvailabilityCallback() {
@Override
public void onAvailable() {
// Aplazame is available for this checkout
}

@Override
public void onNotAvailable() {
// Aplazame is not available for this checkout. You should not show Aplazame as an available payment method.
}

@Override
public void onFailure() {
// An error has occurred
}
});
ParameterTypeRequiredDescription
selectorcss selectorNoCSS selector to display/hide Aplazame’s payment method.
amountdecimalYesQuantity to be financed.
currencyISO 4217YesThe currency code of the order.

Checkout start

Here you can see how to integrate the SDK.

AplazameSDK.setCheckout("checkout id");

Once you have defined the checkout ID, the checkout will start along with the callbacks for the result described in the next section.

Show result

WebView webView = findViewById(R.id.webview);
AplazameSDK.initializeAplazameWebView(webView, new JsWebViewEvents() {
@Override
public void onReadyEvent() {
// JS application has been started
webView.setVisibility(View.VISIBLE);
}

@Override
public void onStatusChangeEvent(String status) {
switch (status) {
case SUCCESS:
break;
case PENDING:
break;
case KO:
break;
}
}

@Override
public void onCloseEvent(String status) {
switch (status) {
case SUCCESS:
break;
case PENDING:
break;
case DISMISS:
break;
case KO:
break;
}
}
});
info

You can find more detailed information at https://github.com/aplazame/android-sdk/