Skip to content

Commit

Permalink
Q2 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ivyxiao-mc committed Feb 1, 2022
1 parent 561b692 commit ac713a9
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>biller-management-client</artifactId>
<packaging>jar</packaging>
<name>biller-management-client</name>
<version>1.10.0</version>
<version>1.12.0</version>
<description>Reference Application for Biller Mangement API</description>

<parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class AddRequestGenerator {

Expand All @@ -24,6 +25,11 @@ public static List<BillerManagementRequest> generateRequest() {
// "Add" action with convenienceFee false, cardPaymentEnabled false and namCorridor false
requestList.add(generateAddRequest(false, false, false));

// "Add" action with Multiple Payments field
requestList.add(generateAddRequestWithMultiplePayments());

// "Add" action with Multiple Payment Caps
requestList.add(generateAddRequestWithPaymentCaps());
return requestList;
}

Expand Down Expand Up @@ -55,6 +61,36 @@ public static BillerManagementRequest generateAddRequest(boolean convenienceFeeF
return request;
}

public static BillerManagementRequest generateAddRequestWithMultiplePayments(){
BillerManagementRequest request = new BillerManagementRequest();
request.setAction(BillerManagementRequest.ActionEnum.ADD); // required field
String effectiveDate = DateUtil.getNextValidDate(); // valid effective date can't be weekends, or BPX Restricted Holidays
request.setEffectiveDate(effectiveDate); // required field


request.setGeneral(generateGeneralModel(GeneralModel.ConvenienceFeeEnum.NO, false));
request.setServiceRelationships(generateServiceRelationshipModelList(false, false));
request.getGeneral().setMultiplePayments(GeneralModel.MultiplePaymentsEnum.YES);

return request;
}

public static BillerManagementRequest generateAddRequestWithPaymentCaps(){
BillerManagementRequest request = new BillerManagementRequest();
request.setAction(BillerManagementRequest.ActionEnum.ADD); // required field
String effectiveDate = DateUtil.getNextValidDate(); // valid effective date can't be weekends, or BPX Restricted Holidays
request.setEffectiveDate(effectiveDate); // required field


request.setGeneral(generateGeneralModel(GeneralModel.ConvenienceFeeEnum.NO, false));
request.setServiceRelationships(generateServiceRelationshipModelList(false, false));
request.getGeneral().setMultiplePayments(GeneralModel.MultiplePaymentsEnum.YES);
request.getGeneral().setPaymentCaps(GeneralModel.PaymentCapsEnum.YES);
request.getGeneral().setPaymentCapAllowance("10");

return request;
}

public static GeneralModel generateGeneralModel(GeneralModel.ConvenienceFeeEnum convenienceFeeFlag, boolean namCorridor){
GeneralModel general = new GeneralModel();
general.setBillerId(String.valueOf(BILLER_ID++)); // required field
Expand All @@ -63,6 +99,13 @@ public static GeneralModel generateGeneralModel(GeneralModel.ConvenienceFeeEnum
general.setEstimatedPostingHour("3");
general.setTermsAndConditions("Terms and Conditions");
general.setConvenienceFee(convenienceFeeFlag);
Random rd = new Random();
boolean isRppsBiller = rd.nextBoolean();
general.setRppsBiller(isRppsBiller ? GeneralModel.RppsBillerEnum.YES : GeneralModel.RppsBillerEnum.NO);
if(!isRppsBiller) {
general.setBillerName("United Power");
general.setBillerClass(GeneralModel.BillerClassEnum.UTL);
}
if(namCorridor) {
general.setCurrencies(Arrays.asList("840"));
} else {
Expand All @@ -86,6 +129,9 @@ public static List<ServiceRelationshipModel> generateServiceRelationshipModelLis
service.setSettlementServices(settlementServices);
service.setCountries(namCorridor ? Arrays.asList("USA") : Arrays.asList("DNK"));
service.setPrimaryCountry(namCorridor ? "USA" : "DNK"); // field only mandatory when multiple countries selected
Random rd = new Random();
boolean hasFullInvoiceDetails = rd.nextBoolean();
service.setFullInvoiceDetails(hasFullInvoiceDetails ? ServiceRelationshipModel.FullInvoiceDetailsEnum.YES : ServiceRelationshipModel.FullInvoiceDetailsEnum.NO);
list.add(service);
return list;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class UpdateRequestGenerator {

Expand All @@ -16,6 +17,12 @@ public static List<BillerManagementRequest> generateRequest() {
// Update fields in general section
requestList.add(generateUpdateGeneralRequest());

// Update Multiple Payments field in general section
requestList.add(generateUpdateGeneralRequestWithMultiplePayments());

// Update Payment Caps and Payment Cap Allowance fields in general section
requestList.add(generateUpdateGeneralRequestWithPaymentCaps());

// Edit existing service relationship
requestList.add(generateUpdateEditServiceRelationshipRequest());

Expand Down Expand Up @@ -56,6 +63,24 @@ public static BillerManagementRequest generateUpdateGeneralRequest(){
return request;
}

public static BillerManagementRequest generateUpdateGeneralRequestWithMultiplePayments(){
BillerManagementRequest request = generateUpdateRequestBasic(); //Only set value for the fields you want to update
request.getGeneral().setBillerLogoUrl("www.updatedURL.com");
request.getGeneral().setBillerShortName("Updated biller name");
request.getGeneral().setMultiplePayments(GeneralModel.MultiplePaymentsEnum.YES);
return request;
}

public static BillerManagementRequest generateUpdateGeneralRequestWithPaymentCaps(){
BillerManagementRequest request = generateUpdateRequestBasic(); //Only set value for the fields you want to update
request.getGeneral().setBillerLogoUrl("www.updatedURL.com");
request.getGeneral().setBillerShortName("Updated biller name");
request.getGeneral().setMultiplePayments(GeneralModel.MultiplePaymentsEnum.YES);
request.getGeneral().setPaymentCaps(GeneralModel.PaymentCapsEnum.YES);
request.getGeneral().setPaymentCapAllowance("10");
return request;
}

public static BillerManagementRequest generateUpdateEditServiceRelationshipRequest(){
BillerManagementRequest request = generateUpdateRequestBasic();
request.setServiceRelationships(generateUpdateServiceRelationshipModelList("Update"));
Expand Down Expand Up @@ -133,6 +158,9 @@ public static List<ServiceRelationshipModel> generateUpdateServiceRelationshipMo
settlementServicesAdd.add(ServiceRelationshipModel.SettlementServicesEnum.RPPS); //mandatory settlement service
serviceAdd.setSettlementServices(settlementServicesAdd);
serviceAdd.setCountries(Arrays.asList("USA")); //mandatory country
Random rd = new Random();
boolean hasFullInvoiceDetails = rd.nextBoolean();
serviceAdd.setFullInvoiceDetails(hasFullInvoiceDetails ? ServiceRelationshipModel.FullInvoiceDetailsEnum.YES : ServiceRelationshipModel.FullInvoiceDetailsEnum.NO);
list.add(serviceAdd);

ServiceRelationshipModel serviceDelete = new ServiceRelationshipModel();
Expand Down
151 changes: 151 additions & 0 deletions src/main/resources/biller-management-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,57 @@ components:
maxLength: 10
description: 'Biller Id, 10 digit numeric value'
example: '0001234567'
rppsBiller:
type: string
maxLength: 3
enum:
- 'Yes'
- 'No'
description: "Indicates if the billerId being sent is intended to match an RPPS Biller or is a Biller only in Mastercard Bill Pay. Default value is ‘Yes’. This field only applies to the NAM region."
example: 'Yes'
billerName:
type: string
maxLength: 70
description: "Biller Name, up to 70 characters, conditional field, field be blank when rppsBiller is ‘Yes’ and populated with a valid value when rppsBiller is ‘No’"
example: 'Wanda Auto Inc'
billerClass:
type: string
maxLength: 3
enum:
- AIR
- AFI
- BCA
- CAB
- CME
- CHU
- CSP
- DSL
- FSE
- GOC
- HSE
- HAS
- INS
- LFI
- MOR
- MUN
- OTH
- PBA
- PHN
- PDC
- RET
- RPR
- SAN
- STV
- SRA
- SSY
- SES
- SUB
- TAX
- TUI
- UTL
- WPH
description: 'Biller Class Code, 3 characters code, conditional field, field be blank when rppsBiller is ‘Yes’ and populated with a valid value when rppsBiller is ‘No’'
example: 'RET'
billerLogoUrl:
type: string
maxLength: 512
Expand Down Expand Up @@ -225,6 +276,35 @@ components:
maxLength: 40
description: 'Account Information'
example: 'SE7280000810340009783242'
multiplePayments:
type: string
maxLength: 3
enum:
- 'Yes'
- 'No'
description: "Multiple Payment Flag, available values are: Yes, No. Default value is ‘No’"
example: 'Yes'
paymentCaps:
type: string
maxLength: 3
enum:
- 'Yes'
- 'No'
description: "Payment Caps Flag, available values are: Yes, No, conditional field, field can only be 'Yes' when multiplePayments is 'Yes'. Default value is ‘No’"
example: 'Yes'
paymentCapAllowance:
type: string
maxLength: 2
description: "Payment Cap Allowance, up to 2 digit numeric value, conditional field, field can only contain value when paymentCaps is 'Yes'."
example: '10'
creditBalance:
type: string
maxLength: 3
enum:
- 'Yes'
- 'No'
description: "Credit Balance Flag, available values are: Yes, No"
example: 'Yes'
CreditorAliasModel:
type: object
title: Credit Alias Model
Expand Down Expand Up @@ -309,6 +389,14 @@ components:
description: "Primary country, value must be one of the values from countries array, will be default to one value if countries array only has one value"
maxLength: 3
example: 'USA'
fullInvoiceDetails:
type: string
maxLength: 3
enum:
- 'Yes'
- 'No'
description: "Full Invoice Details Flag, available values are: Yes, No, conditional field, field can only be 'Yes' when BSE Service Type Group is BPX and External CMS type is BSP or CMS. Default value is ‘No’"
example: 'Yes'
CardPaymentModel:
type: object
title: Card Payment Model
Expand Down Expand Up @@ -530,6 +618,7 @@ components:
effectiveDate: '12/31/2030'
general:
billerId: '0001234567'
rppsBiller: 'Yes'
billerLogoUrl: 'www.wandaauto.com'
billerShortName: 'Wanda Auto'
convenienceFee: 'Yes'
Expand All @@ -539,6 +628,10 @@ components:
- '840'
bankDetail: ''
accountInfo: 'SE7280000810340009783240'
multiplePayments: 'No'
paymentCaps: 'No'
paymentCapAllowance: 'No'
creditBalance: 'No'
creditorAliases:
- aliasName: 'Alias 1'
bankDetail: ''
Expand All @@ -552,6 +645,61 @@ components:
countries:
- 'USA'
primaryCountry: 'USA'
fullInvoiceDetails: 'Yes'
cardPaymentSupport:
cardNetworks:
- 'MAST'
- 'VISA'
cardTypes:
- 'CRDT'
convenienceFees:
- paymentType: 'BANK'
flatFee: '2.0'
percentFee: '0.0'
- paymentType: 'CRDT'
flatFee: '2.0'
percentFee: '0.0'
serviceAreas:
zipCodes: "63301,63302,63303"
consumerAuths:
- category: 'IDEN'
categoryLabel: 'Iden Label'
dataType: 'A'
maxLength: '2'
notes: 'Max length 2 for IDEN category'
- action: 'Add'
effectiveDate: '12/31/2030'
general:
billerId: '0001234567'
rppsBiller: 'No'
billerName: "Wanda Auto Inc"
billerClass: "RET"
billerLogoUrl: 'www.wandaauto.com'
billerShortName: 'Wanda Auto'
convenienceFee: 'Yes'
estimatedPostingHour: '10'
termsAndConditions: 'Terms And Conditions'
currencies:
- '840'
bankDetail: ''
accountInfo: 'SE7280000810340009783240'
multiplePayments: 'Yes'
paymentCaps: 'Yes'
paymentCapAllowance: '10'
creditBalance: 'Yes'
creditorAliases:
- aliasName: 'Alias 1'
bankDetail: ''
accountInfo: 'SE7280000810340009783240'
serviceRelationships:
- bspId: '000123'
serviceType: 'BPX_CL_EB_PAY'
settlementServices:
- 'RPPS'
- 'MPGS'
countries:
- 'USA'
fullInvoiceDetails: 'No'
cardPaymentSupport:
cardNetworks:
- 'MAST'
Expand Down Expand Up @@ -579,6 +727,9 @@ components:
billerId: '0001234568'
billerLogoUrl: 'www.alexauto.com'
termsAndConditions: 'Updated Terms And Conditions'
multiplePayments: 'Yes'
paymentCaps: 'Yes'
paymentCapAllowance: '20'
creditorAliases:
- recordAction: 'Add'
aliasName: 'Alias 2'
Expand Down

0 comments on commit ac713a9

Please sign in to comment.