Skip to content

Commit cd8c8ee

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents ba7e75f + e7b00ca commit cd8c8ee

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The minimum supported SDK version is 15
2828
**Step 2.** Add the dependency
2929

3030
dependencies {
31-
implementation 'com.github.Flutterwave:rave-android:1.0.36'
31+
implementation 'com.github.Flutterwave:rave-android:1.0.37'
3232
}
3333

3434
**Step 3.** Add the required permission

app/src/main/java/com/flutterwave/rave_android/MainActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class MainActivity extends AppCompatActivity {
5050
SwitchCompat accountAchSwitch;
5151
SwitchCompat addSubAccountsSwitch;
5252
SwitchCompat isPreAuthSwitch;
53+
SwitchCompat shouldDisplayFeeSwitch;
5354
SwitchCompat shouldShowStagingLabelSwitch;
5455
List<Meta> meta = new ArrayList<>();
5556
List<SubAccount> subAccounts = new ArrayList<>();
@@ -77,6 +78,7 @@ protected void onCreate(Bundle savedInstanceState) {
7778
accountAchSwitch = findViewById(R.id.accountAchSwitch);
7879
isMpesaSwitch = findViewById(R.id.accountMpesaSwitch);
7980
isPreAuthSwitch = findViewById(R.id.isPreAuthSwitch);
81+
shouldDisplayFeeSwitch = findViewById(R.id.isDisplayFeeSwitch);
8082
ghMobileMoneySwitch = findViewById(R.id.accountGHMobileMoneySwitch);
8183
ugMobileMoneySwitch = findViewById(R.id.accountUgMobileMoneySwitch);
8284
isLiveSwitch = findViewById(R.id.isLiveSwitch);
@@ -205,6 +207,7 @@ private void validateEntries() {
205207
.setSubAccounts(subAccounts)
206208
.isPreAuth(isPreAuthSwitch.isChecked())
207209
.showStagingLabel(shouldShowStagingLabelSwitch.isChecked())
210+
.shouldDisplayFee(shouldDisplayFeeSwitch.isChecked())
208211
// .setMeta(meta)
209212
// .withTheme(R.style.TestNewTheme)
210213
.initialize();

raveandroid/src/main/java/com/flutterwave/raveandroid/RavePayInitializer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public RavePayInitializer(String email, double amount, String publicKey,
4343
boolean withUgMobileMoney,
4444
boolean withAch, int theme,
4545
boolean staging, String meta, String subAccounts, String payment_plan, boolean isPreAuth,
46-
boolean showStagingLabel) {
46+
boolean showStagingLabel, boolean displayFee) {
4747
this.email = email;
4848
this.amount = amount;
4949
this.publicKey = publicKey;
@@ -67,6 +67,7 @@ public RavePayInitializer(String email, double amount, String publicKey,
6767
this.payment_plan = payment_plan;
6868
this.isPreAuth = isPreAuth;
6969
this.showStagingLabel = showStagingLabel;
70+
this.displayFee = displayFee;
7071
}
7172

7273
public RavePayInitializer() {

raveandroid/src/main/java/com/flutterwave/raveandroid/RavePayManager.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class RavePayManager {
4040
boolean allowSaveCard = true;
4141
boolean isPreAuth = false;
4242
boolean showStagingLabel = true;
43+
boolean displayFee = true;
4344

4445
public RavePayManager allowSaveCardFeature(boolean allowSaveCard) {
4546
this.allowSaveCard = allowSaveCard;
@@ -180,11 +181,16 @@ public void initialize() {
180181
}
181182
}
182183

184+
public RavePayManager shouldDisplayFee(Boolean displayFee){
185+
this.displayFee = displayFee;
186+
return this;
187+
}
188+
183189
public RavePayInitializer createRavePayInitializer() {
184190
return new RavePayInitializer(email, amount, publicKey, encryptionKey, txRef, narration,
185191
currency, country, fName, lName, withCard, withAccount, withMpesa,
186192
withGHMobileMoney, withUgMobileMoney, withAch, theme, staging, meta, subAccounts,
187193
payment_plan,
188-
isPreAuth, showStagingLabel);
194+
isPreAuth, showStagingLabel,displayFee);
189195
}
190196
}

0 commit comments

Comments
 (0)