Skip to content

Commit ada57ab

Browse files
committed
merge branch optionalize-display-fee
2 parents d21577a + bcce057 commit ada57ab

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

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)