Skip to content

Commit fba38ef

Browse files
committed
updates
1 parent 9bb80da commit fba38ef

99 files changed

Lines changed: 1857 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
import java.util.Optional;
9+
10+
@Getter
11+
@Setter
12+
@NoArgsConstructor
13+
public class ACHRequest extends Shared{
14+
15+
private String country;
16+
17+
public ACHRequest(String tx_ref, BigDecimal amount,
18+
String email, String phone_number, String currency, String country,
19+
String client_ip, String fullname, String redirect_url, String device_fingerprint, Optional<Meta> meta){
20+
this.setTx_ref(tx_ref);
21+
this.setAmount(amount);
22+
this.setEmail(email);
23+
this.setPhone_number(phone_number);
24+
this.country = country;
25+
this.setFullname(fullname);
26+
this.setCurrency(currency);
27+
this.setClient_ip(client_ip);
28+
this.setRedirect_url(redirect_url);
29+
this.setDevice_fingerprint(device_fingerprint);
30+
meta.ifPresent(this::setMeta);
31+
}
32+
33+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.util.Optional;
8+
9+
/**
10+
* @author Cleopatra Douglas
11+
*/
12+
@Getter
13+
@Setter
14+
@NoArgsConstructor
15+
public class AccountResolveRequest extends Shared{
16+
17+
private String type;
18+
private String country;
19+
20+
public AccountResolveRequest(String account_number, String account_bank,
21+
Optional<ChargeTypes> type, Optional<String> country){
22+
23+
this.setAccount_number(account_number);
24+
this.setAccount_bank(account_bank);
25+
type.ifPresent(chargeTypes -> this.type = chargeTypes.toString());
26+
country.ifPresent(s -> this.country = s);
27+
28+
}
29+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
import java.util.Optional;
9+
10+
@Getter
11+
@Setter
12+
@NoArgsConstructor
13+
public class ApplePayRequest extends Shared{
14+
15+
public ApplePayRequest(String tx_ref, BigDecimal amount,
16+
String email, String phone_number, String currency,
17+
String client_ip, String device_fingerprint, String billing_zip,
18+
String billing_city, String billing_address, String billing_state,
19+
String billing_country, String narration, Optional<Meta> meta){
20+
this.setTx_ref(tx_ref);
21+
this.setAmount(amount);
22+
this.setEmail(email);
23+
this.setPhone_number(phone_number);
24+
this.setCurrency(currency);
25+
this.setClient_ip(client_ip);
26+
this.setDevice_fingerprint(device_fingerprint);
27+
this.setBilling_address(billing_address);
28+
this.setBilling_city(billing_city);
29+
this.setBilling_zip(billing_zip);
30+
this.setBilling_state(billing_state);
31+
this.setBilling_country(billing_country);
32+
this.setNarration(narration);
33+
meta.ifPresent(this::setMeta);
34+
}
35+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
import java.util.List;
9+
10+
import static com.flutterwave.bean.AuthorizationModes.AUS_NOAUTH;
11+
import static com.flutterwave.bean.AuthorizationModes.PIN;
12+
13+
@Getter
14+
@Setter
15+
@NoArgsConstructor
16+
public class Authorization {
17+
18+
private String transfer_reference;
19+
private String transfer_account;
20+
private String transfer_bank;
21+
private String account_expiration;
22+
private String transfer_note;
23+
private BigDecimal transfer_amount;
24+
private String mode;
25+
private String note;
26+
private String account_number;
27+
private String sort_code;
28+
private String redirect;
29+
private String instruction;
30+
private String validate_instructions;
31+
private String city;
32+
private String address;
33+
private String state;
34+
private String country;
35+
private String zipcode;
36+
37+
private String pin;
38+
private List<String> fields;
39+
40+
public Authorization pinAuthorization(String pin){
41+
this.pin = pin;
42+
this.mode = PIN.toString().toLowerCase();
43+
return this;
44+
}
45+
46+
public Authorization avsAuthorization(String city, String address, String state, String country, String zipcode){
47+
this.mode = AUS_NOAUTH.toString().toLowerCase();
48+
this.city = city;
49+
this.address = address;
50+
this.state = state;
51+
this.country = country;
52+
this.zipcode = zipcode;
53+
return this;
54+
}
55+
56+
public AuthorizationModes getMode(){
57+
return AuthorizationModes.valueOf(this.mode.toUpperCase());
58+
}
59+
60+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.flutterwave.bean;
2+
3+
public enum AuthorizationModes {
4+
5+
AUS_NOAUTH,
6+
REDIRECT,
7+
OTP,
8+
PIN
9+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
import java.util.Optional;
9+
10+
@Getter
11+
@Setter
12+
@NoArgsConstructor
13+
public class BanKTransferRequest extends Shared{
14+
15+
private boolean is_permanent;
16+
private Integer expires;
17+
18+
public BanKTransferRequest(Optional<Boolean> is_permanent, String tx_ref, Optional<BigDecimal> amount,
19+
String email, Optional<String> phone_number, String currency,
20+
String client_ip, String device_fingerprint, String narration, Optional<Integer> expires){
21+
is_permanent.ifPresent(aBoolean -> this.is_permanent = aBoolean);
22+
expires.ifPresent(integer -> this.expires = integer);
23+
this.setTx_ref(tx_ref);
24+
amount.ifPresent(this::setAmount);
25+
this.setEmail(email);
26+
phone_number.ifPresent(this::setPhone_number);
27+
this.setCurrency(currency);
28+
this.setClient_ip(client_ip);
29+
this.setDevice_fingerprint(device_fingerprint);
30+
this.setNarration(narration);
31+
}
32+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
import java.util.Optional;
9+
10+
@Getter
11+
@Setter
12+
@NoArgsConstructor
13+
public class BillRequest extends Shared {
14+
15+
private String biller_name;
16+
private String recurrence;
17+
private String country;
18+
private String customer;
19+
20+
21+
public BillRequest(String country, String customer, BigDecimal amount,
22+
Optional<Recurrence> recurrence, Optional<GhanaAirtimeBills> ghanaAirtimeBills) {
23+
24+
this.country = country;
25+
this.customer = customer;
26+
this.setAmount(amount);
27+
recurrence.ifPresent(value -> this.recurrence = String.valueOf(value));
28+
ghanaAirtimeBills.ifPresent(s -> this.biller_name = s.name());
29+
}
30+
31+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
9+
@Getter
10+
@Setter
11+
@NoArgsConstructor
12+
public class BillSummary {
13+
14+
private String currency;
15+
private BigDecimal sum_bills;
16+
private BigDecimal sum_commission;
17+
private BigDecimal sum_dstv;
18+
private BigDecimal sum_airtime;
19+
private BigDecimal count_dstv;
20+
private BigDecimal count_airtime;
21+
22+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
@Getter
8+
@Setter
9+
@NoArgsConstructor
10+
public class Card {
11+
12+
private String first_6digits;
13+
private String last_4digits;
14+
private String issuer;
15+
private String country;
16+
private String type;
17+
private String expiry;
18+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.flutterwave.bean;
2+
3+
import lombok.Getter;
4+
import lombok.NoArgsConstructor;
5+
import lombok.Setter;
6+
7+
import java.math.BigDecimal;
8+
9+
@Getter
10+
@Setter
11+
@NoArgsConstructor
12+
public class CardRequest extends Shared{
13+
14+
private String card_number;
15+
private String cvv;
16+
private String expiry_month;
17+
private String expiry_year;
18+
private Authorization authorization;
19+
20+
public CardRequest(String card_number,
21+
String cvv,
22+
String expiry_month,
23+
String expiry_year,
24+
String currency,
25+
BigDecimal amount,
26+
String fullname,
27+
String email,
28+
String tx_ref,
29+
String redirect_url,
30+
Authorization authorization){
31+
32+
this.card_number = card_number;
33+
this.cvv = cvv;
34+
this.expiry_month = expiry_month;
35+
this.expiry_year = expiry_year;
36+
this.authorization = authorization;
37+
this.setCurrency(currency);
38+
this.setAmount(amount);
39+
this.setFullname(fullname);
40+
this.setEmail(email);
41+
this.setTx_ref(tx_ref);
42+
this.setRedirect_url(redirect_url);
43+
44+
}
45+
46+
}

0 commit comments

Comments
 (0)