Add file for live Payment Key

In FoodZone and Grocers we have used Stripe, Paypal and RazorPay payment gateways for online transaction. For each payment we have used sandbox key for testing transactions.

Payment live key is sensitive data to we can not ask or we can not add any live key. For adding live key you must have to add file at android side. without this file it might be possible that the app will not work or crashed on release build. For this you must have to follow bellow steps.

Step 1 : Create file

make a file name of inside android>app that should be : android/app/ then paste below code inside file

-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
-keepattributes JavascriptInterface
-keepattributes *Annotation*
-dontwarn com.razorpay.**
-keep class com.razorpay.** {*;}
-optimizations !method/inlining/*
-keepclasseswithmembers class * {
public void onPayment*(...);
-keep class** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
# -keep class** { *; } // uncomment this if you are using firebase in the project
-dontwarn io.flutter.embedding.**

Step 2: Assign that file to build.gredle

go to android>app>build.gradle and find buildTypes inside buildTypes>release add some lines

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''