DISCLAIMER: this plugin isn't maintained anymore.
This plugin is a wrapper around HyperPay iOS and Android SDK, it's still in alpha release, and supports limited set of functionality and brands.
Note: this plugin is unofficial.
✔️ Credit Card payment VISA, MasterCard
✔️ Local Saudi payment with MADA
✔️ Apple Pay
✔️ Check payment status
✔️ Custom UI
✖️ Ready UI
Add your Bundle Identifier as a URL Type.
Open ios folder using Xcode, make sure you select Runner traget, then go to Info tab, and there add a new URL type, then paste your Bundle Identifier and append.paymentsto it.
Open Podfile, and paste the following inside of it:
target'Runner'douse_frameworks!use_modular_headers!flutter_install_all_ios_podsFile.dirname(File.realpath(__FILE__))# Add from herepod'oppwamobile',:git=>'https://github.com/nyartech/oppwamobile-ios-sdk.git'
$static_framework =['hyperpay']pre_installdo |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method,:verify_no_static_framework_transitive_dependencies){}installer.pod_targets.eachdo |pod|
if $static_framework.include?(pod.name)defpod.build_type;Pod::BuildType.static_libraryendendendend# To hereend- Open
android/app/build.gradleand add the following lines:
implementation (name:'oppwa.mobile-4.5.0-release', ext:'aar')
- Open
app/build.gradleand make sure that theminSdkVersionis 21, andcompileSdkVersionis 33. - Open your AndroidManifest.xml, and make sure it looks like the example app.
IMPORTANT: the scheme you choose should match exactly your application ID but without any underscores, and then append.paymentsto it.
For example:com.nyartech.hyperpay_examplebecomescom.nyartech.hyperpayexample.payments
On older versions of the plugin, adding the AAR SDK file manually on Android was required. Now it's not. To migrate:
- Remove any of these dependencies in your
app/build.gradle:
implementation project(":oppwa.mobile")
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "com.google.android.material:material:1.4.0"
implementation "com.google.android.gms:play-services-base:17.6.0"- Add a dependency over the AAR file:
implementation (name:'oppwa.mobile-4.5.0-release', ext:'aar')- in
settings.gradle, remove the following line:
include ':oppwa.mobile'- Finally, remove the folder
oppwa.mobilefrom the rootandroidfolder in your app.
It's important to setup your own server with 2 endpoints:
- Get Checkout ID
- Get payment status
Find full details on set up your server page.
After that, setup 2 Uri objects with your endpoints specifications, refer to example/lib/constants for an example.
String _host ='YOUR_HOST';
Uri checkoutEndpoint =Uri(
scheme:'https',
host: _host,
path:'',
);
Uri statusEndpoint =Uri(
scheme:'https',
host: _host,
path:'',
);The first time you launch your app, setup the plugin with your configurations, it's highly recommended to use flavors to switch between modes.
Implement HyperpayConfig class and put your merchant entity IDs as provided to you by HyperPay.
classTestConfigimplementsHyperpayConfig {
@overrideString? creditcardEntityID ='';
@overrideString? madaEntityID ='';
@overrideString? applePayEntityID ='';
@overrideUri checkoutEndpoint = _checkoutEndpoint;
@overrideUri statusEndpoint = _statusEndpoint;
@overridePaymentMode paymentMode =PaymentMode.test;
}Then you might consider using Dart environment variables to switch between Test and Live modes.
constbool isDev =bool.fromEnvironment('DEV');
voidsetup() async {
awaitHyperpayPlugin.instance.setup(
config: isDev?TestConfig() :LiveConfig(),
);
}Refer to example directory for a full app usage example. As this is still an alpha release, consider testing your implementation first in the example app before starting in your own app.
For any problems, please file an issue.
Contributions are more than welcome to fix bugs or extend this plugin!




