### Install Aerosync Web SDK for Capacitor Source: https://dev.aero.inc/docs/capacitor-example Installs the Aerosync web SDK using npm within the web app directory of your Capacitor project. This is a prerequisite for integrating the Aerosync widget. ```bash npm i aerosync-web-sdk ``` -------------------------------- ### Checkout with Aeropay Generated Button Source: https://dev.aero.inc/docs/examples This example shows how to initialize the AeroPay SDK and render a pre-generated checkout button. It includes optional event callbacks for success and other events. ```javascript window.AeroPay.init({ env: "sandbox" }); var onSuccess = function(uuid) { console.log(uuid); }; // event callback is optional var onEvent = function(event) { console.log(event); }; var apButton = window.AeroPay.button({ location: "6ced28ccc4", type: "checkout", onSuccess: onSuccess, onEvent: onEvent // optional }); apButton.total("88.50"); apButton.render("aeropay-button-container"); ``` -------------------------------- ### Subscription with Aeropay Generated Button (with amount) Source: https://dev.aero.inc/docs/examples This example shows how to set up a subscription with a pre-defined amount using an Aeropay generated button. It includes setting the subscription ID and amount before rendering the button. ```javascript window.AeroPay.init({ env: "sandbox" }); var onSuccess = function(result) { console.log(result); }; // event callback is optional var onEvent = function(event) { console.log(event); }; var apButton = window.AeroPay.button({ location: "6ced28ccc4", type: "subscription", onSuccess: onSuccess, onEvent: onEvent // optional }); apButton.subId("28"); apButton.subAmount("79.00"); apButton.render("aeropay-button-container"); ``` -------------------------------- ### Subscription with Custom Button (no amount) Source: https://dev.aero.inc/docs/examples This example demonstrates initiating a subscription with a custom button without specifying a pre-selected amount. The `launchSub` method is used, requiring only the subscription ID. ```javascript window.AeroPay.init({ env: "sandbox" }); var onSuccess = function(result) { console.log(result); }; // event callback is optional var onEvent = function(event) { console.log(event); }; var apButton = window.AeroPay.button({ location: "6ced28ccc4", type: "subscription", onSuccess: onSuccess, onEvent: onEvent // optional }); document .getElementById("my-aeropay-button") .addEventListener("click", function apClickEvent() { apButton.launchSub("28"); }); ``` -------------------------------- ### Self-Checkout with Custom Generated Button Source: https://dev.aero.inc/docs/examples This example demonstrates initiating a self-checkout process using a custom button. The `apButton.launch()` method is called when the custom button is clicked. ```javascript window.AeroPay.init({ env: "sandbox" }); var onSuccess = function(uuid) { console.log(uuid); }; // event callback is optional var apButton = window.AeroPay.button({ location: "6ced28ccc4", type: "selfCheckout", onSuccess: onSuccess }); document .getElementById("my-aeropay-button") .addEventListener("click", function apClickEvent() { apButton.launch(); }) ``` -------------------------------- ### Setup AeroSync Embedded View and Widget in React Native Source: https://dev.aero.inc/docs/embedded-view-1 This snippet demonstrates the core setup for displaying the AeroSync embedded view and triggering the widget for bank linking in a React Native application. It includes state management for widget visibility and error handling, along with essential event callbacks for user interactions. Ensure 'aerosync-react-native-sdk' is installed as a dependency. ```jsx import { AeroSyncWidget, Environment, SuccessEventType, WidgetEventType, AeroSyncEmbeddedView, WidgetEventBankClickType } from "aerosync-react-native-sdk"; import { SafeAreaView, ScrollView, StyleSheet, Text, View } from "react-native"; import { useState } from "react"; import Toast from "react-native-toast-message"; import Modal from 'react-native-modal'; import { useStore } from "../context/StoreContext"; import { useThemeContext } from "../context/ThemeContext"; export default function PaymentScreen() { const { widgetConfig } = useStore(); const { isDarkTheme } = useThemeContext(); // State to control whether the widge is shown const [isWidgetEnabled, setIsWidgetEnabled] = useState(false); // Stores the stateCode returned from embedded view for initializing the widget const [embeddedStateCode, setEmbeddedStateCode] = useState(''); // Determine widget theme based on app theme const currentTheme = isDarkTheme ? 'dark' : 'light'; // Deeplink scheme used for routing back from external services const DEEP_LINK = 'syncroVibeReactCli://'; // --- Callback: Widget loaded successfully const onWidgetLoad = () => { console.log('Widget loaded'); }; // --- Callback: Widget was closed (either manually or automatically) const onWidgetClose = () => { console.log('Widget closed'); setIsWidgetEnabled(false); // Hide widget modal }; // --- Callback: User successfully linked their bank and widget closed const onWidgetSuccess = (event: SuccessEventType) => { console.log('Bank linking successful', event); setIsWidgetEnabled(false); // Hide widget modal // Show a toast to inform the user of success(optional) Toast.show({ type: 'success', text1: 'Bank linked successfully!', }); }; // --- Callback: Fired on every widget event const onWidgetEvent = (event: WidgetEventType) => { console.log('Widget event:', event); }; // --- Callback: Widget encountered an error const onWidgetError = (event: string) => { console.log('Widget error:', event); }; // --- Callback: User tapped a bank in the embedded view const onEmbeddedBankClick = (event: WidgetEventBankClickType) => { // Store stateCode and show the widget modal // Required to properly initiate the full bank linking flow if (event.stateCode) { setEmbeddedStateCode(event.stateCode); setIsWidgetEnabled(true); } }; // --- Callback: Embedded view loaded successfully const onEmbeddedLoad = () => { console.log('Embedded view loaded'); }; // --- Callback: Embedded view encountered an error const onEmbeddedError = (event: string) => { console.log('Embedded view error:', event); }; return ( {/* Full-screen modal to display the AeroSync widget after a bank is selected. This modal is optional — you can customize or replace it with your own layout/styling as needed. */} {/* AeroSync Widget: bank linking process */} {/* Main content area */} {/* AeroSync Embedded View: displays the list of banks */} ); } const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 20, }, modal: { margin: 0, // Ensure modal takes full screen justifyContent: 'flex-end', // Position content at the bottom }, }); ``` -------------------------------- ### Aeropay Webhook Example Source: https://dev.aero.inc/docs/webhooks-1 An example of the JSON structure for an Aeropay webhook, including headers and body. ```json { "headers": { "ap-signature": "c46f292ed0a1b308cf55c3af6de926a8ff8a738cbcf575e9650222955d6477bf" }, "body": { "topic": "user_suspended", "payloadVersion": "2.0", "data": { "userid": "12695" }, "date": "2024-04-12 20:42:35" } } ``` -------------------------------- ### Aerosync SDK Integration (iOS) Source: https://dev.aero.inc/docs/ios-deprecated Guides on integrating the Aerosync SDK into an iOS application using SwiftUI. Includes details on parameters and callback functions. ```APIDOC ## Aerosync SDK Widget ### Description Integrates the Aerosync SDK into your iOS application. This widget facilitates secure bank linking and data aggregation. It is typically presented within a `NavigationLink`. ### Method N/A (Client-side SDK integration) ### Endpoint N/A (Client-side SDK integration) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body This section describes the parameters for initializing the `AerosyncSDK` view in SwiftUI. - **token** (string) - Required. The SDK token obtained from the `/v2/aggregatorCredentials` endpoint. - **env** (string) - Required. Specifies the environment. Available values: `sandbox`, `production`. - **deeplink** (string) - Required. The deeplink URL of your application, used for OAuth authentication. - **consumerId** (string) - Optional. A unique identifier for client-specific customizations. Contact the Aero Inc. team for details. - **onEvent** (function(response)) - Required. Callback function triggered during the bank linking workflow. - **onSuccess** (function(response)) - Required. Callback function triggered upon successful bank addition. - **onClose** (function(response)) - Required. Callback function triggered when the Aerosync widget is closed. - **onLoad** (function(response)) - Required. Callback function triggered after the webpage content has loaded. - **onError** (function(response)) - Required. Callback function triggered if any errors occur within the Aerosync UI. ### Request Example ```swift AerosyncSDK( token: "your_sdk_token_here", env: "sandbox", deeplink: "your_app_deeplink://", consumerId: "optional_consumer_id", onEvent: self.onEvent, onSuccess: self.onSuccess, onClose: self.onClose, onLoad: self.onLoad, onError: self.onError ) ``` ### Response #### Success Response (Callbacks) Each callback function (`onEvent`, `onSuccess`, `onClose`, `onLoad`, `onError`) receives a `response` parameter, which is typically a String message detailing the event or outcome. #### Response Example (Callback) ``` // Example for onSuccess callback func onSuccess(message: Any) { print("Bank added successfully: \(message)") } ``` ### Notes - Ensure your iOS application is configured to handle Universal Links or URL Schemes for the `deeplink` parameter to function correctly. - Refer to the [Aerosync guide](https://dev.aero.inc/docs/aerosync-implementation-guides) for detailed integration steps. ``` -------------------------------- ### Install react-native-webview using npm Source: https://dev.aero.inc/docs/aerosync-react-native-javascript-sdk This code snippet shows how to install the 'react-native-webview' package using the npm package manager. This command adds the necessary library to your project for integrating web views into your React Native application. ```bash $ npm install --save react-native-webview ``` -------------------------------- ### Example Connected Account Payload (JSON) Source: https://dev.aero.inc/docs/aerosync-web-javascript-sdk An example JSON structure representing the data payload received upon successful connection of an account. This data includes client information, login account identifiers, user ID, and user password, which are used for authentication with the AeroSync API. ```json { "payload": { "ClientName": "client3", "FILoginAcctId": "{\"u_guid\":\"USR-701a457e-5b93-4598-b7a1-b968c495ee3f\", \"m_guid\": \"MBR-d699c457-90f7-4b96-96c1-c50a445eabec\", \"a_guid\": \"ACT-9f5549d6-e402-43f4-8351-cd4018de7a80\"}", "user_id": "a2c7f64f-3df9-4090-b3bd-ad6fc3003c90", "user_password": "735e33b9-78ec-4887-99d7-a3056997ceb9" }, "type": "pageSuccess" } ``` -------------------------------- ### Install Aerosync React Native SDK (v4.0+) Source: https://dev.aero.inc/docs/react-native-sdk This snippet shows how to install the latest version of the aerosync-react-native-sdk library using npm. Ensure you are using version 4.0 or later for full compatibility and access to updated features. ```bash npm install aerosync-react-native-sdk ``` -------------------------------- ### Install react-native-webview Dependency Source: https://dev.aero.inc/docs/release-notes-1 Instructions for manually installing the 'react-native-webview' package, which is a peer dependency of 'aerosync-react-native-sdk'. This is necessary to avoid version conflicts and ensure proper functionality. ```bash npm install react-native-webview ``` -------------------------------- ### Checkout with Custom Button and Branding Source: https://dev.aero.inc/docs/examples This example demonstrates how to use a custom button to trigger the AeroPay checkout process. It requires an existing HTML element with the ID 'my-aeropay-button' and handles the click event to launch the payment. ```javascript window.AeroPay.init({ env: "sandbox" }); var onSuccess = function(uuid) { console.log(uuid); }; // event callback is optional var onEvent = function(event) { console.log(event); }; var apButton = window.AeroPay.button({ location: "6ced28ccc4", type: "checkout", onSuccess: onSuccess, onEvent: onEvent // optional }); document .getElementById("my-aeropay-button") .addEventListener("click", function apClickEvent() { apButton.launch("88.50"); }); ``` -------------------------------- ### Aeropay Webhook Payload Examples (JSON) Source: https://dev.aero.inc/docs/webhooks-1 These examples show the structure of payloads received from Aeropay webhooks for different topics. The first illustrates a 'transaction_completed' event with detailed transaction data, while the second shows a 'user_suspended' event with a user ID. ```json { "topic": "transaction_completed", "payloadVersion": "2.0", "data": { "id": "b1ebceb4-74f3-4702-928f-df655798084f", "amount": { "amount": 123, "currency": "USD" }, "status": "pending", "paymentType": "payment", "userId": "1294664", "title": "Online Transaction", "referenceId": "newReferenceID-TestinMatt21", "createdDate": "2026-01-23T18:53:03+00:00", "apFee": "0.02", "isRtp": false, "merchantId": 582, "locationId": 541 }, "date": "2026-01-23 18:53:13" } ``` ```json { "topic" : "user_suspended", "payloadVersion": "2.0", "data" : { "userid" : "12695" }, "date": "2024-04-05 15:25:49" } ``` -------------------------------- ### Configure Aeropay Environment Source: https://dev.aero.inc/docs/integration-guide Initialize the Aeropay SDK by configuring the environment. The 'sandbox' environment is used for development and testing purposes. ```javascript window.AeroPay.init({ env: 'sandbox' }); ``` -------------------------------- ### GET /v2/aggregatorCredentials Source: https://dev.aero.inc/docs/aerosync-implementation-guides Retrieve the Aerosync widget URL and a token required for subsequent interactions. This endpoint is crucial for initializing the Aerosync widget. ```APIDOC ## GET /v2/aggregatorCredentials ### Description Retrieves the Aerosync widget URL and a token required for subsequent interactions. This endpoint is crucial for initializing the Aerosync widget. ### Method GET ### Endpoint /v2/aggregatorCredentials ### Query Parameters - **aggregator** (string) - Required - Must be set to `aerosync`. ### Headers - **Content-Type**: application/json - **accept**: application/json - **authorization**: Bearer {{token}} ### Request Example ```curl curl --request GET \ --url 'https://api.sandbox-pay.aero.inc/v2/aggregatorCredentials?aggregator=aerosync' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --header 'authorization: Bearer {{token}}' ``` ### Response #### Success Response (200) - **fastlinkURL** (string) - The URL for the Aerosync widget. - **token** (string) - A token for authenticating Aerosync widget interactions. - **username** (string) - The username associated with the token. #### Response Example ```json { "fastlinkURL": "https://sandbox.aerosync.com/", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNDYzZjhhYwefNmEyLTQzOTctOWIyNC00NWYzZGY2MDcxYjciLCJleHAiOjE2ODY0Mzk4NTYsInVzZXJJZCI6ImU3OTQzMmNiOWFmNTQ2ZTRiMDBiN2NmMDU3ZjdlZWEyIiwidXNlclBhc3N3b3JkIjoiODYxNDg3OGExMzEyNDA2Njg5MDBlN2VkMGNhNDhkNTkiLCJDbGllbnRJZCI6InRlc3QxIiwiQ2xpZW50TmFtZSI6ImNsaWVudDEifQ.XufkfsgGc7CGDy8DZRTOc0e_-kJYt9puyCAqneX4Ze0", "username": "e79432cb9af546e4b00b7cf057fasea2" } ``` ``` -------------------------------- ### Initialize and Launch Aerosync Widget Source: https://dev.aero.inc/docs/aerosync-web-javascript-sdk This section explains how to initialize the Aerosync widget object and launch it, typically in response to a user action like clicking a button. ```APIDOC ## Initialize and Launch Aerosync Widget ### Description Initializes the widget object and provides an example of launching the Aerosync widget on a button click event. ### Method N/A (JavaScript interaction) ### Endpoint N/A ### Parameters N/A ### Request Example ```javascript // Assume 'widget' is an initialized Aerosync widget object // Assume 'openButton' is an HTML element openButton.addEventListener('click', function () { // launch Aerosync widget widget.launch(); }); ``` ### Response N/A ``` -------------------------------- ### Minimal Aerosync Bank-Link-Sdk Implementation in Android Source: https://dev.aero.inc/docs/android-sdk A minimal Kotlin example demonstrating how to implement the Aerosync bank-link-sdk in an Android activity. It covers initializing the widget, setting configuration parameters, and handling success, event, error, and close callbacks. ```kotlin package com.aerosync.test_client_android import android.content.Context import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.View import android.widget.Toast import com.aerosync.bank_link_sdk.EventListener import com.aerosync.bank_link_sdk.Widget import com.aerosync.bank_link_sdk.Theme class Homepage : AppCompatActivity(), EventListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_homepage) } fun onClick(v: View?) { when (v?.id) { R.id.button -> { // open Aerosync widget var config = Widget(this, this); config.environment = "PROD"; //STAGE,PROD config.deeplink = "aerosync://bank-link"; config.token = ""; config.configurationId = "xxx"; config.aeroPassUserUuid = "xxx"; config.defaultTheme = Theme.LIGHT; config.open(); } } } override fun onSuccess(response: String?, context: Context) { // perform steps when user have completed the bank link workflow // sample code Toast.makeText(context, "onSuccess--> $response", Toast.LENGTH_SHORT).show() val intent = Intent(context, Homepage::class.java) context.startActivity(intent); } override fun onEvent(type: String?, payload: String?, context: Context) { // capture all the Aerosync events // sample code Toast.makeText(context, "onEvent--> $payload", Toast.LENGTH_SHORT).show() } override fun onError(error: String?, context: Context) { // error handling // sample code Toast.makeText(context, "onError--> $error", Toast.LENGTH_SHORT).show() } override fun onClose(context: Context) { // when widget is closed by user // sample code Toast.makeText(context,"widget closed", Toast.LENGTH_SHORT).show() val intent = Intent(context, Homepage::class.java) context.startActivity(intent); } } ``` -------------------------------- ### Get Aerosync Widget URL and Token (cURL) Source: https://dev.aero.inc/docs/aerosync-implementation-guides Retrieves the Aerosync widget URL and a token by making a GET request to Aeropay's /v2/aggregatorCredentials endpoint. Requires 'aerosync' as the aggregator query parameter and an authorization token. The response contains 'fastlinkURL' and 'token' for subsequent steps. ```curl curl --request GET \ --url 'https://api.sandbox-pay.aero.inc/v2/aggregatorCredentials?aggregator=aerosync' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --header 'authorization: Bearer {{token}}' ``` -------------------------------- ### Aerosync Widget Initialization and Event Handling (JavaScript) Source: https://dev.aero.inc/docs/aerosync-web-javascript-sdk This snippet demonstrates how to initialize the Aerosync widget with various configuration options and event handlers. It includes setting up the widget reference, handling click events to launch the widget, and defining callbacks for different events like onLoad, onSuccess, and onError. The onSuccess and onError handlers update a designated HTML element with the event data. ```javascript var openButton = document.getElementById('openBank'); openButton.addEventListener('click', function () { widgetRef.launch(); }) //Aerosync widget var widgetRef = new window.AerosyncConnect({ token: id: "widget", iframeTitle: "Connect", width: "375px", height: "95%", environment: "production", deeplink: deeplink, consumerId: consumerId, onEvent: function (type, payload) { console.log("onEvent", type, payload); }, onLoad: function (event) { console.log("onLoad", event); }, onSuccess: function (event) { var successData = document.getElementById("wrapData"); successData.innerHTML = ""; successData.innerText = "success : " + "\n" + JSON.stringify(event, null, 4); }, onBankAdded: function (event) { }, onError: function (event) { console.log("onError", event); var errorData = document.getElementById("wrapData"); errorData.innerHTML = ""; errorData.innerText = "Error : " + "\n" + JSON.stringify(event, null, 4); } }); ``` -------------------------------- ### POST /v2/preauthTransaction Source: https://dev.aero.inc/docs/api-quick-start Creates a preauthorized transaction. This endpoint requires a bank account ID obtained from the GET /v2/bankAccounts endpoint. Tipping and invoicing details can be included in the request body's attributes. ```APIDOC ## POST /v2/preauthTransaction ### Description Creates a preauthorized transaction. This endpoint stores transaction details for later capture by an employee, without initiating fund movement. ### Method POST ### Endpoint /v2/preauthTransaction ### Parameters #### Query Parameters None #### Request Body - **bankAccountId** (string) - Required - The ID of the user's linked bank account. - **merchantId** (string) - Required - The ID of the merchant. - **amount** (object) - Required - The transaction amount. - **currency** (string) - Required - The currency of the amount (e.g., "USD"). - **amount** (number) - Required - The transaction amount value. - **description** (string) - Optional - A description for the transaction. - **attributes** (object) - Optional - Additional details for tipping and invoicing. - **key** (object) - Example attribute. - **value** (string) - Required - The value of the attribute. - **description** (string) - Optional - A description for the attribute. - **referenceId** (string) - Optional - A unique reference ID for the transaction. #### Headers - **Content-Type**: application/json - **authorization**: Bearer {{userForMerchantScope token}} - **Idempotency-Key**: UUID (Optional) - Ensures idempotent transactions. ### Request Example ```json { "bankAccountId": {{bankAccountTransactionId}}, "merchantId": {{mainMerchantId}}, "amount": { "currency": "USD", "amount": 222 }, "description": "DESCRIPTION", "attributes": { "key": { "value": "KEY VALUE", "description": "KEY DESCRIPTION" } }, "referenceId": "Testing V2" } ``` ### Response #### Success Response (200) - **transactionId** (string) - The ID of the created preauthorized transaction. - **status** (string) - The status of the transaction (e.g., "PREAUTHED"). #### Response Example ```json { "transactionId": "txn_12345abcde", "status": "PREAUTHED" } ``` ``` -------------------------------- ### Initialize and Launch Aerosync Widget (JavaScript) Source: https://dev.aero.inc/docs/aerosync-web-javascript-sdk This JavaScript code defines the Aerosync SDK, including its constructor and methods for launching the widget. It handles configuration, styling, and communication via postMessage. The `launch` method creates and appends an iframe to the DOM, and event listeners manage widget interactions. ```javascript (function () { var t = function (t) { (this.options = t || {}), this.options.onLoad || (this.options.onLoad = function () {}), this.options.onClose || (this.options.onClose = function () {}), this.options.onSuccess || (this.options.onSuccess = function () {}), this.options.onEvent || (this.options.onEvent = function () {}), this.options.onError || (this.options.onError = function () { }), (this.options.config = t.config || null), (this.configInitialized = !1), this.options.config ? window.addEventListener("message", this._handlePostMessage.bind(this)) : window.addEventListener("message", this._onPostMessage.bind(this)); }; (t.prototype.launch = function () { var t; var path = ("?token=" + this.options.token) + (this.options.consumerId? "&consumerId=" + this.options.consumerId: "") + (this.options.deeplink? "&deeplink="+this.options.deeplink: ""); var bg = (this.options.style && this.options.style.bgColor && this.options.style.opacity)? (this.options.style.bgColor + ( Math.floor(this.options.style.opacity * 255).toString(16))) : "#000000b2"; (t = "local" == this.options.environment ? "http://localhost:8080/"+path : "staging" === this.options.environment ? "https://staging.aerosync.com/"+path : "production" === this.options.environment ? "https://www.aerosync.com/"+path : ""), (e = (this.options.style && this.options.style.width)?this.options.style.width: "375px"), (n = (this.options.style && this.options.style.height)?this.options.style.height: "688px"), (o = document.createElement("iframe")), (d = document.createElement("div")), (s = document.getElementById(this.options.id)), o.setAttribute("width", e), o.setAttribute("height", n), o.setAttribute("border", "0"), o.setAttribute("frame", "0"), o.setAttribute("frameborder", "0"), o.setAttribute("allowTransparency", "true"), o.setAttribute("src", t), o.setAttribute("marginheight", "0"), o.setAttribute("marginwidth", "0"), o.setAttribute("onload", this.options.onLoad()), o.setAttribute("title", this.options.iframeTitle, "Connect"), d.setAttribute("id", "widget-box"), (s.innerHTML = ""), s.appendChild(d); var i = document.getElementById("widget-box"); (i.style.display = "flex"), (i.style.position = "fixed"), (i.style.width = "100%"), (i.style.left = "0"), (i.style.top = "0"), (i.style.backgroundColor = bg), (i.style.zIndex = "1"), (i.style.height = "100%"), (i.style.justifyContent = "center"), (i.style.alignItems = "center"), window.matchMedia("(max-height: 700px)").matches && o.setAttribute("height", "95%"), (i.innerHTML = ""), i.appendChild(o), (this.iframeDetails = { iframe: o, targetElement: i }), this.options.config && ((this.configInterval = setInterval( function () { this.configInitialized ? clearInterval(this.configInterval) : this._setClientConfig(this.options.config); }.bind(this), 100 )), setTimeout( function () { clearInterval(this.configInterval); }.bind(this) )); }), (t.prototype._onPostMessage = function (t) { var e = {}; if ( this.iframeDetails && this.iframeDetails.iframe && t.source === this.iframeDetails.iframe.contentWindow ) { try { e = JSON.parse(t.data); } catch (t) { console.warn("Error processing event", t); } e.type && this._handleEvent(e); } }), (t.prototype._handleEvent = function (t) { var e = { pageSuccess: { callback: this.options.onSuccess }, widgetPageLoaded: { callback: this.options.onEvent }, widgetLoaded: { callback: this.options.onLoad }, widgetClose: { callback: this.options.onClose }, widgetError: { callback: this.options.onError }, initialized: { callback: function () { this.configInitialized = !0; }.bind(this), }, }[t.type]; ("widgetClose" != t.type && "bankAdded" != t.type) || (document .querySelector('iframe[title="' + this.options.iframeTitle + '"]') .remove(), document.getElementById("widget-box").remove()), e.callback(t.payload); }), (t.prototype._setClientConfig = function (t) { t.hasOwnProperty("ce_user_id") && (t.ce_user_id = t.ce_user_id), t.hasOwnProperty("FILoginAcctId") && ``` -------------------------------- ### Handle OAuth Bank Authentication Manually in Capacitor Source: https://dev.aero.inc/docs/capacitor-example Captures the 'launchExternalWindow' event from the Aerosync SDK and opens the provided OAuth URL using Capacitor's in-app browser. This allows for manual control over the OAuth flow on native platforms. ```javascript async onEvent(event) { try { // Check if the app is running on a native platform (iOS or Android) if (Capacitor.isNativePlatform()) { // Verify that the event payload exists, pageTitle equals "launchExternalWindow", // and onLoadApi URL is present if ( event?.payload?.pageTitle === "launchExternalWindow" && event?.payload?.onLoadApi ) { // Open the URL in Capacitor's in-app browser await Browser.open({ url: event.payload.onLoadApi }); } } } catch (error) { console.error("Failed to open URL in Capacitor Browser:", error); } } ``` -------------------------------- ### Install Aerosync Bank-Link-Sdk using Maven and Gradle Source: https://dev.aero.inc/docs/android-sdk Instructions for adding the Aerosync bank-link-sdk library to an Android project using Apache Maven and Gradle build tools. Specifies the artifact coordinates and version numbers. ```apache-maven com.aerosync bank-link-sdk 2.0.0 ``` ```gradle implementation group: 'com.aerosync', name: 'bank-link-sdk', version: '1.0.9' ``` -------------------------------- ### Self-Checkout with Aeropay Generated Button Source: https://dev.aero.inc/docs/examples This example shows how to render a self-checkout button using the AeroPay SDK. It's designed for scenarios where the user completes the checkout directly within the AeroPay interface. ```javascript window.AeroPay.init({ env: "sandbox" }); var onSuccess = function(uuid) { console.log(uuid); }; // event callback is optional var onEvent = function(event) { console.log(event); }; var apButton = window.AeroPay.button({ location: "6ced28ccc4", type: "selfCheckout", onSuccess: onSuccess, onEvent: onEvent // optional }); apButton.render("aeropay-button-container"); ``` -------------------------------- ### Integration Approval - Payment SDK & Payment Links Source: https://dev.aero.inc/docs/launch-checklist Process for obtaining production keys for Payment SDK and Payment Links integrations, including demo requirements and key integration questions. ```APIDOC ## Integration Approval - Payment SDK & Payment Links ### Integration Videos To receive production keys, share demo videos of your integration with your Solutions Engineer. Demos should cover: 1. **Payment Experience**: Full end-to-end user payment flow using Aeropay SDK or payment links. 2. **Back Office Experience (Payment Completion)**: Show how your back office responds to a completed payment. 3. **Back Office Experience (Preauth Management)**: (If applicable) Show how your back office can capture, update (PATCH), or cancel preauth payments. ### Integration Questions 1. What webhooks is your system subscribed to, and what automations are in place? ``` -------------------------------- ### Preauthorized Transaction Response Example (JSON) Source: https://dev.aero.inc/docs/preauth-transaction-step-4-create-a-payment Example JSON response received after successfully creating a preauthorized transaction. It includes transaction details such as ID, amount, status, user information, and timestamps. ```json { "transaction": { "id": "53024f75-f7d1-45b7-8e4d-4449fed355ab", "amount": { "currency": "USD", "amount": 222 }, "status": "live", "userId": "d5e17cbf-92ad-44e7-b483-19dba7adaaa4", "referenceId": "Testing V2", "description": "Online Transaction", "attributes": { "key": { "value": "KEY VALUE", "description": "KEY DESCRIPTION" } }, "createdDate": "2026-01-02T12:00:56+00:00", "expiryDate": "2026-01-04T12:00:56+00:00", "userName": "Begos Andres", "userEmail": "begona.andresm@aeropay.com", "merchantId": 1057, "userAccountId": 1717, "locationId": 1147 } } ``` -------------------------------- ### Aerosync Widget Response Example Source: https://dev.aero.inc/docs/standard-transaction-step-3-link-a-bank-to-the-user This is an example of the response received after a successful Aerosync widget interaction. It includes a 'connectionId' which is crucial for linking the bank account to Aeropay in the subsequent step. Keep this 'connectionId' for future use. ```json { "connectionId": "a2c7f64f-3df9-4090-b3bd-ad6fc3003c90", "clientName": "Patrice's Pizza" "aeroPassUserUuid": "735e33b9-78ec-4887-99d7-a3056997ceb9" } ``` -------------------------------- ### Initialize and Launch Aerosync Widget (JavaScript) Source: https://dev.aero.inc/docs/npm-sdk Initializes and launches the Aerosync widget using the 'openWidget' function from the SDK. This snippet demonstrates how to configure the widget with various parameters including environment, styling, event handlers, and the mandatory 'aeroPassUserUuid'. The 'launch' method is called on the returned widget reference to display the widget. ```javascript /** * Integrate AeroSync UI AddBank */ import { openWidget } from 'aerosync-web-sdk'; openAerosyncWidget() { let token = ""; // Signature to instigate Aerosync services let deeplink = ""; // Unique URL that points to the specific page within the mobile app let configurationId = ""; // Unique ID that represents the merchant for customization. Previously consumerId. let handleMFA = false; // if true then handle the additional MFA workflow for balance refresh let jobId = ""; // Unique ID for current job (only required if handleMFA is true) let connectionId = ""; // Unique ID for user (only required if handleMFA is true) let aeroPassUserUuid = ""; // Aeropass user id - REQUIRED let widgetRef = openWidget({ id: "widget", iframeTitle: 'Connect', environment: 'sandbox', // sandbox, production token: token, style: { width: '375px', height: '688px', bgColor: '#000000', opacity: 0.7 }, deeplink: deeplink, handleMFA: handleMFA, jobId: jobId, connectionId: connectionId, configurationId: configurationId, aeroPassUserUuid: aeroPassUserUuid, onEvent: function (event, type) { console.log("onEvent", event, type); }, onLoad: function () { console.log("onLoad"); }, onSuccess: function (event) { console.log("onSuccess", event); }, onClose: function () { console.log("onClose"); }, onError: function (event) { console.log("onError", event); } }); // launch Aerosync widget with the configuration widgetRef.launch(); } ``` -------------------------------- ### Initialize and Launch Aerosync Widget (JavaScript) Source: https://dev.aero.inc/docs/aerosync-web-javascript-sdk Initializes the Aerosync widget and provides a JavaScript code snippet to launch it when a custom button is clicked. This involves adding an event listener to the button that calls the widget's launch() method. ```javascript // custom button to launch the Aerosync widget on click event openButton.addEventListener('click', function () { // launch Aerosync widget widget.launch(); }) ``` -------------------------------- ### Aeropay Error Message Examples (JSON) Source: https://dev.aero.inc/docs/error-handling These examples demonstrate the structure of error messages returned by the Aeropay API. They include a help field for support, an error code, and a descriptive message. Note that all Aeropay errors are returned with an HTTP 200 response. ```json // example error message 1 { "error": { "help": "contact support@aeropay.com for help", "code": "AP113", "message": "User does not exist" } } // example error message 2 { "error": { "code": "AP701", "message": "Improperly formatted parameter: ['id']" } } ``` -------------------------------- ### Release Configuration (Proguard) Source: https://dev.aero.inc/docs/android-sdk Instructions for configuring Proguard rules for release builds to ensure proper functioning of the SDK, especially when using WebView with JavaScript interfaces. ```APIDOC ## Release Configuration (Proguard) ### Description Instructions for configuring Proguard rules for release builds. ### Code ```proguard # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: -keepclassmembers class com.aerosync.bank_link_sdk.EventListener { public *; } ``` ``` -------------------------------- ### GET /v2/user Source: https://dev.aero.inc/docs/user-flows Retrieves information about a specific user within the Aeropay network. ```APIDOC ## GET /v2/user ### Description This endpoint retrieves detailed information about a specific user based on their unique Aeropay user ID. ### Method GET ### Endpoint /v2/user ### Parameters #### Query Parameters - **user_id** (string) - Required - The unique identifier of the user in the Aeropay network. ### Request Example ``` GET /v2/user?user_id=user_abc123 ``` ### Response #### Success Response (200) - **user_id** (string) - The unique identifier of the user. - **merchant_id** (string) - The identifier of the merchant associated with the user. - **email** (string) - The email address of the user. - **phone_number** (string) - The phone number of the user. - **created_at** (string) - Timestamp of when the user was created. #### Response Example ```json { "user_id": "user_abc123", "merchant_id": "merchant_xyz789", "email": "user@example.com", "phone_number": "+15551234567", "created_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### GET /v2/merchantReputation Source: https://dev.aero.inc/docs/user-reputation-program Fetches the current reputation status for a specific user with a merchant-scoped token. ```APIDOC ## GET /v2/merchantReputation ### Description Fetches a user's current reputation status with a merchant-scoped token. ### Method GET ### Endpoint /v2/merchantReputation ### Parameters #### Query Parameters - **userId** (string) - Required - The ID or UUID of the user whose reputation status is to be fetched. ### Request Example ```curl curl --request GET \ --url "https://api.sandbox-pay.aero.inc/v2/merchantReputation?userId=d5e17cbf-92ad-44e7-b483-19dba7adaaa4" \ --header 'Content-Type: application/json' \ --header 'accept: application/json' ``` ### Response #### Success Response (200) - **userId** (string) - The ID of the user. - **merchantId** (string) - The ID of the merchant. - **dateModified** (string) - The date the user's reputation was last modified. - **paging** (object) - Pagination details (if applicable). - **userReputation** (integer) - The current reputation status of the user (0: Standard, 1: Trusted, 2: Blocked). #### Response Example ```json { "userId": "d5e17cbf-92ad-44e7-b483-19dba7adaaa4", "merchantId": "1057", "dateModified": "None", "paging": null, "userReputation": 0 } ``` ``` -------------------------------- ### Payout Transaction API Source: https://dev.aero.inc/docs/api-quick-start Creates a payout transaction, allowing funds to flow from the merchant to a user. ```APIDOC ## POST /v2/payoutTransaction ### Description Creates a payout transaction, enabling payments from a merchant to a user. This can be used for withdrawals or rewards. ### Method POST ### Endpoint /v2/payoutTransaction ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **userId** (string) - Required - The ID of the user receiving the payout. - **bankAccountId** (integer) - Required - The ID of the user's bank account to receive the payout. - **amount** (object) - Required - The payout amount and currency. - **currency** (string) - Required - The ISO 4217 currency code (e.g., "USD"). - **amount** (integer) - Required - The payout amount in the smallest currency unit (e.g., cents). - **merchantId** (integer) - Required - The ID of the merchant initiating the payout. - **rtp** (boolean) - Optional - Indicates if Real-Time Payments should be used (if available). - **referenceId** (string) - Required - A unique identifier for the payout transaction. ### Request Example ```json { "userId": "bc81e829-d35b-43cb-acb9-d218674878be", "bankAccountId": 27381938, "amount": { "currency": "USD", "amount": 1000 }, "merchantId" : 12345, "rtp": true, "referenceId": "newReferenceID-TestingEA" } ``` ### Response #### Success Response (200) - **payoutId** (string) - The unique identifier for the created payout transaction. - **status** (string) - The status of the payout transaction (e.g., "PENDING", "COMPLETED"). #### Response Example ```json { "payoutId": "payout_xyz7890123456", "status": "PENDING" } ``` ### Notes Before creating a payout transaction, ensure you have a valid merchant token. You can fetch the user's linked bank accounts using `GET /v2/bankAccounts` to obtain the `bankAccountId`. ```