Mobile SDKs
All mobile SDKs use the hosted checkout in an embedded WebView. Your app stays out of PCI scope (SAQ-A).
iOS (Swift)
swift
// SPM: https://github.com/minnha/minnha-pay-ios
import MinnhaPay
let result = try await MinnhaPay.shared.startCheckout(
options: .init(sessionToken: token, locale: "ar"),
from: self // any UIViewController
)
switch result.status {
case .success: print("paid:", result.transactionId ?? "")
case .failed: showError(result.message)
case .cancelled, .requiresAction: break
}Android (Kotlin)
kotlin
// implementation("com.minnha:pay:0.1.0")
class CheckoutFragment : Fragment() {
private val launcher = registerForActivityResult(MinnhaPay.contract) { result ->
when (result.status) {
CheckoutStatus.SUCCESS -> showThanks(result.transactionId)
CheckoutStatus.FAILED -> showError(result.message)
else -> Unit
}
}
fun onPayClick(token: String) {
launcher.launch(CheckoutOptions(sessionToken = token, locale = "ar"))
}
}React Native
tsx
// yarn add @minnha/pay-react-native react-native-webview
import { useMinnhaCheckout, MinnhaCheckoutModal } from "@minnha/pay-react-native";
const checkout = useMinnhaCheckout();
const onPay = async () => {
const { sessionToken } = await fetch("/api/checkout", { method: "POST" }).then(r => r.json());
const result = await checkout.open({ sessionToken, locale: "ar" });
if (result.status === "success") navigation.navigate("Thanks");
};
return (
<>
<Button title="Pay" onPress={onPay} />
<MinnhaCheckoutModal
visible={checkout.visible}
options={checkout.options}
onResult={checkout.onResult}
onClose={checkout.onClose}
closeLabel="إغلاق"
/>
</>
);For native Apple Pay / Google Pay support, see the (upcoming) Wallets guide. Today, mobile SDKs delegate wallet support to the hosted checkout.