Skip to content

Commit dd7df20

Browse files
committed
- fix merge conflicts
2 parents 35f80cb + 9353d02 commit dd7df20

File tree

17 files changed

+1000
-5
lines changed

17 files changed

+1000
-5
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
@@ -46,6 +46,7 @@ public class MainActivity extends AppCompatActivity {
4646
SwitchCompat ghMobileMoneySwitch;
4747
SwitchCompat ugMobileMoneySwitch;
4848
SwitchCompat rwfMobileMoneySwitch;
49+
SwitchCompat zmMobileMoneySwitch;
4950
SwitchCompat bankTransferSwitch;
5051
SwitchCompat isLiveSwitch;
5152
SwitchCompat isMpesaSwitch;
@@ -83,6 +84,7 @@ protected void onCreate(Bundle savedInstanceState) {
8384
shouldDisplayFeeSwitch = findViewById(R.id.isDisplayFeeSwitch);
8485
ghMobileMoneySwitch = findViewById(R.id.accountGHMobileMoneySwitch);
8586
ugMobileMoneySwitch = findViewById(R.id.accountUgMobileMoneySwitch);
87+
zmMobileMoneySwitch = findViewById(R.id.accountZmMobileMoneySwitch);
8688
rwfMobileMoneySwitch = findViewById(R.id.accountRwfMobileMoneySwitch);
8789
bankTransferSwitch = findViewById(R.id.bankTransferSwitch);
8890
isLiveSwitch = findViewById(R.id.isLiveSwitch);
@@ -208,6 +210,7 @@ private void validateEntries() {
208210
.acceptAchPayments(accountAchSwitch.isChecked())
209211
.acceptGHMobileMoneyPayments(ghMobileMoneySwitch.isChecked())
210212
.acceptUgMobileMoneyPayments(ugMobileMoneySwitch.isChecked())
213+
.acceptZmMobileMoneyPayments(zmMobileMoneySwitch.isChecked())
211214
.acceptRwfMobileMoneyPayments(rwfMobileMoneySwitch.isChecked())
212215
.acceptBankTransferPayments(bankTransferSwitch.isChecked())
213216
.onStagingEnv(!isLiveSwitch.isChecked())

app/src/main/res/layout/activity_main.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@
102102
android:checked="false"
103103
android:text="Accept RWF Mobile money payments" />
104104

105+
<android.support.v7.widget.SwitchCompat
106+
android:id="@+id/accountZmMobileMoneySwitch"
107+
android:layout_width="match_parent"
108+
android:layout_height="wrap_content"
109+
android:layout_marginBottom="10dp"
110+
android:checked="false"
111+
android:text="Accept ZM Mobile money payments" />
112+
105113
<android.support.v7.widget.SwitchCompat
106114
android:layout_width="match_parent"
107115
android:layout_height="wrap_content"

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,18 @@ public Payload createGhMobileMoneyPayload() {
251251
return payload;
252252
}
253253

254+
public Payload createZmMobileMoneyPayload() {
255+
List<Meta> metaObj = Utils.pojofyMetaString(meta);
256+
List<SubAccount> subaccountsObj = Utils.pojofySubaccountString(subAccounts);
257+
Payload payload = new Payload(phonenumber, metaObj, subaccountsObj, narration, ip, lastname,
258+
firstname, currency, country, amount, email, device_fingerprint, txRef, pbfPubKey);
259+
payload.setIs_mobile_money_ug("1");
260+
payload.setPayment_type("mobilemoneyzambia");
261+
payload.setVoucher(voucher);
262+
payload.setNetwork(network);
263+
return payload;
264+
}
265+
254266
public Payload createUgMobileMoneyPayload() {
255267
List<Meta> metaObj = Utils.pojofyMetaString(meta);
256268
List<SubAccount> subaccountsObj = Utils.pojofySubaccountString(subAccounts);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class RaveConstants {
2424
public static String RWF = "RWF";
2525
public static String NOAUTH = "NOAUTH";
2626
public static String PIN = "PIN";
27+
public static String selectNetwork = "Select network";
2728
public static String AVS_VBVSECURECODE = "AVS_VBVSECURECODE";
2829
public static String enterOTP = "Enter your one time password (OTP)";
2930
public static String NOAUTH_INTERNATIONAL = "NOAUTH_INTERNATIONAL";

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.flutterwave.raveandroid.mpesa.MpesaFragment;
2828
import com.flutterwave.raveandroid.rwfmobilemoney.RwfMobileMoneyFragment;
2929
import com.flutterwave.raveandroid.ugmobilemoney.UgMobileMoneyFragment;
30+
import com.flutterwave.raveandroid.zmmobilemoney.ZmMobileMoneyFragment;
3031

3132
import org.parceler.Parcels;
3233

@@ -118,6 +119,10 @@ else if (ravePayInitializer.getCountry().equalsIgnoreCase("ng") && ravePayInitia
118119
raveFragments.add(new RaveFragment(new GhMobileMoneyFragment(), "GHANA MOBILE MONEY"));
119120
}
120121

122+
if (ravePayInitializer.isWithZmMobileMoney()) {
123+
raveFragments.add(new RaveFragment(new ZmMobileMoneyFragment(), "ZAMBIA MOBILE MONEY"));
124+
}
125+
121126
if (ravePayInitializer.isWithUgMobileMoney()) {
122127
raveFragments.add(new RaveFragment(new UgMobileMoneyFragment(), "UGANDA MOBILE MONEY"));
123128
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class RavePayInitializer {
2828
boolean withGHMobileMoney = false;
2929
boolean withUgMobileMoney = false;
3030
boolean withRwfMobileMoney = false;
31+
boolean withZmMobileMoney = false;
3132
boolean withBankTransfer = false;
3233
int theme;
3334
boolean staging = true;
@@ -40,7 +41,7 @@ public RavePayInitializer(String email, double amount, String publicKey,
4041
String currency, String country, String fName,
4142
String lName, boolean withCard,
4243
boolean withAccount, boolean withMpesa, boolean withGHMobileMoney,
43-
boolean withUgMobileMoney, boolean withRwfMobileMoney,
44+
boolean withUgMobileMoney, boolean withRwfMobileMoney, boolean withZmMobileMoney,
4445
boolean withAch, boolean withBankTransfer, int theme,
4546
boolean staging, String meta, String subAccounts, String payment_plan, boolean isPreAuth,
4647
boolean showStagingLabel, boolean displayFee) {
@@ -58,6 +59,7 @@ public RavePayInitializer(String email, double amount, String publicKey,
5859
this.withGHMobileMoney = withGHMobileMoney;
5960
this.withUgMobileMoney = withUgMobileMoney;
6061
this.withRwfMobileMoney = withRwfMobileMoney;
62+
this.withZmMobileMoney = withZmMobileMoney;
6163
this.withBankTransfer = withBankTransfer;
6264
this.withMpesa = withMpesa;
6365
this.withCard = withCard;
@@ -139,6 +141,9 @@ public boolean isWithRwfMobileMoney() {
139141
return withRwfMobileMoney;
140142
}
141143

144+
public boolean isWithZmMobileMoney() {
145+
return withZmMobileMoney;
146+
}
142147

143148
public boolean isWithBankTransfer() {
144149
return withBankTransfer;
@@ -259,6 +264,7 @@ public void setPreAuth(boolean isPreAuth) {
259264
public boolean getIsDisplayFee() {
260265
return displayFee;
261266
}
267+
262268
public void setIsDisplayFee() {
263269
this.displayFee = displayFee;
264270
}

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

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class RavePayManager {
3636
boolean withGHMobileMoney = false;
3737
boolean withUgMobileMoney = false;
3838
boolean withRwfMobileMoney = false;
39+
boolean withZmMobileMoney = false;
3940
boolean withBankTransfer = false;
4041
private int theme = R.style.DefaultTheme;
4142
boolean staging = true;
@@ -98,6 +99,11 @@ public RavePayManager acceptRwfMobileMoneyPayments(boolean withRwfMobileMoney) {
9899
return this;
99100
}
100101

102+
public RavePayManager acceptZmMobileMoneyPayments(boolean withZmMobileMoney) {
103+
this.withZmMobileMoney = withZmMobileMoney;
104+
return this;
105+
}
106+
101107
public RavePayManager acceptBankTransferPayments(boolean withBankTransfer) {
102108
this.withBankTransfer = withBankTransfer;
103109
return this;
@@ -199,10 +205,33 @@ public RavePayManager shouldDisplayFee(boolean displayFee) {
199205
}
200206

201207
public RavePayInitializer createRavePayInitializer() {
202-
return new RavePayInitializer(email, amount, publicKey, encryptionKey, txRef, narration,
203-
currency, country, fName, lName, withCard, withAccount, withMpesa,
204-
withGHMobileMoney, withUgMobileMoney, withRwfMobileMoney, withAch, withBankTransfer, theme, staging, meta, subAccounts,
208+
return new RavePayInitializer(
209+
email,
210+
amount,
211+
publicKey,
212+
encryptionKey,
213+
txRef,
214+
narration,
215+
currency,
216+
country,
217+
fName,
218+
lName,
219+
withCard,
220+
withAccount,
221+
withMpesa,
222+
withGHMobileMoney,
223+
withUgMobileMoney,
224+
withRwfMobileMoney,
225+
withZmMobileMoney,
226+
withAch,
227+
withBankTransfer,
228+
theme,
229+
staging,
230+
meta,
231+
subAccounts,
205232
payment_plan,
206-
isPreAuth, showStagingLabel,displayFee);
233+
isPreAuth,
234+
showStagingLabel,
235+
displayFee);
207236
}
208237
}

raveandroid/src/main/java/com/flutterwave/raveandroid/di/components/AppComponent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.flutterwave.raveandroid.di.modules.NetworkModule;
1313
import com.flutterwave.raveandroid.di.modules.RwandaModule;
1414
import com.flutterwave.raveandroid.di.modules.UgandaModule;
15+
import com.flutterwave.raveandroid.di.modules.ZambiaModule;
1516

1617
import javax.inject.Singleton;
1718

@@ -33,6 +34,8 @@ public interface AppComponent {
3334

3435
GhanaComponent plus(GhanaModule ghanaModule);
3536

37+
ZambiaComponent plus(ZambiaModule zambiaModule);
38+
3639
CardComponent plus(CardModule cardModule);
3740

3841
BankTransferComponent plus(BankTransferModule bankTransferModule);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.flutterwave.raveandroid.di.components;
2+
3+
4+
import com.flutterwave.raveandroid.di.modules.ZambiaModule;
5+
import com.flutterwave.raveandroid.di.scopes.ZambiaScope;
6+
import com.flutterwave.raveandroid.zmmobilemoney.ZmMobileMoneyFragment;
7+
8+
import dagger.Subcomponent;
9+
10+
@ZambiaScope
11+
@Subcomponent(modules = {ZambiaModule.class})
12+
public interface ZambiaComponent {
13+
void inject(ZmMobileMoneyFragment zmMobileMoneyFragment);
14+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.flutterwave.raveandroid.di.modules;
2+
3+
import com.flutterwave.raveandroid.zmmobilemoney.ZmMobileMoneyContract;
4+
5+
import javax.inject.Inject;
6+
7+
import dagger.Module;
8+
import dagger.Provides;
9+
10+
@Module
11+
public class ZambiaModule {
12+
13+
private ZmMobileMoneyContract.View view;
14+
15+
@Inject
16+
public ZambiaModule(ZmMobileMoneyContract.View view) {
17+
this.view = view;
18+
}
19+
20+
@Provides
21+
public ZmMobileMoneyContract.View providesContract() {
22+
return view;
23+
}
24+
}

0 commit comments

Comments
 (0)