Integration Steps

MoneyHash SDKs are available across Web and Mobile platforms. The integration steps follow the same concepts across all platforms - install the SDK, initialize it with your public API key, create an intent on your backend, then use SDK methods to drive the payment flow. Platform-specific syntax is covered in the dedicated pages below.

Note

Integration Steps assume you have completed your server-side integration and your account is configured in the MoneyHash dashboard. If you haven't done that yet, start with Integration Types Overview.


Installation

Install the SDK for your platform using the package manager of your choice.

PlatformPackageInstall from
Web@moneyhash/js-sdknpm
iOSMoneyHashSwift Package Manager (CocoaPods also available)
Androidio.moneyhash:androidMaven Central
Fluttermoneyhash_paymentpub.dev
React Native@moneyhash/reactnative-sdknpm

Install the SDK for your platform:

npm install @moneyhash/js-sdk
Xcode → File → Add Package Dependencies…
https://github.com/MoneyHash/moneyhash-spm
// build.gradle.kts
dependencies {
    implementation("io.moneyhash:android:<LATEST_VERSION>")
}
flutter pub add moneyhash_payment
npm install @moneyhash/reactnative-sdk

Initialization

After installation, initialize the SDK with your account's public API key. This must be done before calling any SDK methods.

The public API key is available in your MoneyHash dashboard under Settings → API Keys.

import MoneyHash from "@moneyhash/js-sdk/headless";

const moneyHash = new MoneyHash({
  type: "payment", // or "payout"
  publicApiKey: "<YOUR_PUBLIC_API_KEY>",
});
import MoneyHash

let moneyHash = MoneyHashSDKBuilder()
    .setPublicKey("<YOUR_PUBLIC_API_KEY>")
    .build()
import com.moneyhash.sdk.android.core.MoneyHashSDKBuilder

val moneyHash = MoneyHashSDKBuilder
    .setPublicKey("<YOUR_PUBLIC_API_KEY>")
    .build()
import 'package:moneyhash_payment/moneyhash_payment.dart';

final moneyHash = MoneyHashSDKBuilder().build();
moneyHash.setPublicKey("<YOUR_PUBLIC_API_KEY>");
import { MoneyHashSDKBuilder } from "@moneyhash/reactnative-sdk";

const moneyHash = MoneyHashSDKBuilder.build();
moneyHash.setPublicKey("<YOUR_PUBLIC_API_KEY>");
Note

The public API key is safe to use on the client side. Never use your secret API key in the SDK - it is for server-side use only.


How the SDK flow works

The SDK is state-driven. Every call to an SDK method returns an intent state and a stateDetails object. Your code reads the state and renders the appropriate UI or calls the next SDK method. The flow advances state by state until the intent reaches a terminal state.

The intent is always created on your backend first - the SDK then takes the intentId and drives the customer-facing experience from there.

For the full state reference including all possible states, what each means, and how to handle them - see SDK Architecture.


Platform pages

Each sub-page below covers a specific capability with platform-specific code across Web, iOS, Android, Flutter, and React Native.

PageWhat it coversPlatforms
SDK ArchitectureBasic Concepts, Get Available Methods, Collect Card Information, Pay Using Card Information, Save Card for Future UseAll
Build Card FormBuild a fully custom card formAll
Apple PayIntegrate Apple Pay nativelyWeb, iOS, Flutter, React Native
Google PayIntegrate Google Pay nativelyWeb, Android, Flutter, React Native
Bank AccountAdd bank account as a payment methodAll
Installment PlansDisplay and select installment optionsAll
Subscription PlansSet up subscription-based paymentsAll
BIN LookupLook up card details by BIN before paymentWeb

Did this page help you?