From ac713a9b9a564ddddece6783c5d15a4d1a0e2b10 Mon Sep 17 00:00:00 2001 From: e046383 Date: Tue, 1 Feb 2022 16:11:44 -0600 Subject: [PATCH] Q2 updates --- pom.xml | 2 +- .../developer/util/AddRequestGenerator.java | 46 ++++++ .../util/UpdateRequestGenerator.java | 28 ++++ .../resources/biller-management-service.yaml | 151 ++++++++++++++++++ 4 files changed, 226 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2290dbd..0006dd8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ biller-management-client jar biller-management-client - 1.10.0 + 1.12.0 Reference Application for Biller Mangement API diff --git a/src/main/java/com/mastercard/developer/util/AddRequestGenerator.java b/src/main/java/com/mastercard/developer/util/AddRequestGenerator.java index cca75d0..e62e2df 100644 --- a/src/main/java/com/mastercard/developer/util/AddRequestGenerator.java +++ b/src/main/java/com/mastercard/developer/util/AddRequestGenerator.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Random; public class AddRequestGenerator { @@ -24,6 +25,11 @@ public static List 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; } @@ -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 @@ -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 { @@ -86,6 +129,9 @@ public static List 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; } diff --git a/src/main/java/com/mastercard/developer/util/UpdateRequestGenerator.java b/src/main/java/com/mastercard/developer/util/UpdateRequestGenerator.java index 8c4df31..ee65952 100644 --- a/src/main/java/com/mastercard/developer/util/UpdateRequestGenerator.java +++ b/src/main/java/com/mastercard/developer/util/UpdateRequestGenerator.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Random; public class UpdateRequestGenerator { @@ -16,6 +17,12 @@ public static List 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()); @@ -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")); @@ -133,6 +158,9 @@ public static List 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(); diff --git a/src/main/resources/biller-management-service.yaml b/src/main/resources/biller-management-service.yaml index d33b112..70e317f 100644 --- a/src/main/resources/biller-management-service.yaml +++ b/src/main/resources/biller-management-service.yaml @@ -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 @@ -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 @@ -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 @@ -530,6 +618,7 @@ components: effectiveDate: '12/31/2030' general: billerId: '0001234567' + rppsBiller: 'Yes' billerLogoUrl: 'www.wandaauto.com' billerShortName: 'Wanda Auto' convenienceFee: 'Yes' @@ -539,6 +628,10 @@ components: - '840' bankDetail: '' accountInfo: 'SE7280000810340009783240' + multiplePayments: 'No' + paymentCaps: 'No' + paymentCapAllowance: 'No' + creditBalance: 'No' creditorAliases: - aliasName: 'Alias 1' bankDetail: '' @@ -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' @@ -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'