I am Implementing hyper pay payment gateway for flutter project using flutter hyper pay plugin. payment process is working fine on IOS devices. Its not working on android devices release build but working fine with the debug build. Ready ui user interface is appearing after clicking subscribe button but after I insert card details and click the pay button on the ready ui its giving me payment result error as checkout result error. Can any one give me solution for this matter.
import 'package:gym_app/services/initiation/hyperpay_readyui_service.dart';
import 'package:hyperpay_plugin/flutter_hyperpay.dart';
import '../../screens/demo/hyperpay_test.dart';
import '../initiation/payment_service.dart';
import '../service_locator.dart';
class HyperPayReadyUIServiceImplementation extends HyperPayReadyUIService {
late FlutterHyperPay flutterHyperPay;
final PaymentService _paymentService = getIt<PaymentService>();
HyperPayReadyUIServiceImplementation() {
flutterHyperPay = FlutterHyperPay(
shopperResultUrl: InAppPaymentSetting.shopperResultUrl,
//paymentMode: PaymentMode.test,
paymentMode: PaymentMode.live,
lang: InAppPaymentSetting.getLang(),
);
}
@override
dynamic payRequestNowReadyUI(
{required List<String> brandsName,
required String checkoutId,
required String entityId}) async {
PaymentResultData paymentResultData;
dynamic result;
try {
paymentResultData = await flutterHyperPay.readyUICards(
readyUI: ReadyUI(
brandsName: brandsName,
checkoutId: checkoutId,
shopperResultUrl: InAppPaymentSetting.shopperResultUrl,
merchantIdApplePayIOS: InAppPaymentSetting.merchantId,
countryCodeApplePayIOS: InAppPaymentSetting.countryCode,
companyNameApplePayIOS: "9R KSA",
themColorHexIOS: "#000000", // FOR IOS ONLY
setStorePaymentDetailsMode:
false // store payment details for future use
),
);
print('payRequestReady ui');
print(paymentResultData.paymentResult);
print(paymentResultData.errorString);
if (paymentResultData.paymentResult == PaymentResult.success ||
paymentResultData.paymentResult == PaymentResult.sync) {
print(checkoutId);
result = await _paymentService.getPaymentStatus(entityId, checkoutId);
return result;
} else {
print('Redy ui result error');
return null;
}
} catch (ex) {
print('Try catch Error payRequestNowReadyUI ${ex}');
}
}
}
I have checked the api endpoints are correct and access tokens are correct. check out id getting process is working fine. Also I double checked the android dependencies in build.gradle. Initially I thought cord minifying is the reason to this error when bulding application for release so I add minifyEnabled false
to my build.gradle but it did n't work as well.
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
viewBinding {
enabled = true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
minifyEnabled false
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation(name: "oppwa.mobile-release", ext: 'aar')
debugImplementation(name: "ipworks3ds_sdk", ext: 'aar')
releaseImplementation(name: "ipworks3ds_sdk_deploy", ext: 'aar')
implementation "com.google.android.material:material:1.6.1"
implementation "androidx.appcompat:appcompat:1.5.1"
implementation 'com.google.android.gms:play-services-wallet:19.1.0'
implementation "androidx.browser:browser:1.4.0"
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.android.support:support-v4:29.0.0'
implementation 'com.android.support:design:29.0.0'
implementation 'com.android.support:customtabs:29.0.0'
}