|
| 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 | +} |
0 commit comments