Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,19 @@ L] [Bank Info Lookup API](https://developer.mastercard.com/send-cross-border/doc
- OI calls the service to retrieve Bank Information but there are no matching records for the input criteria, use case 10
- The above use cases just shows two the examples of error handling

M] [Validate IBAN API](https://developer.mastercard.com/send-cross-border/documentation/api-ref/validate-iban-apis#account-validation-api):
M] [Validate Account API](https://developer.mastercard.com/cross-border-services/documentation/api-ref/bank-account-validation-api/#account-validation-api):

> Case 1: **VALIDATE ACCOUNT WITH ACCOUNT TYPE AND VALUE**
> Case 1: **VALIDATE IBAN WITH ACCOUNT TYPE AND VALUE**
- OI can call this method to validate the IBAN account
- In this use case, we need to pass partner ID and populate all the account type and value. The service provides a successful or rejection response.
- Use case link

> Case 2: **ERROR HANDLING**
> Case 2: **VALIDATE PAN WITH ACCOUNT TYPE AND VALUE**
- OI can call this method to validate the Card Eligibility for cross-border transaction
- In this use case, we need to pass partner ID and populate all the account type and card number. The service provides eligibility of a card for cross-border transaction.
- Use case link

> Case 3: **ERROR HANDLING**
- OI calls the service to Validate the account but the value field is null, use case 14
- OI calls the service to Validate the account but the account number contains invalid check digit,
- The above use cases just shows two of the examples of error handling
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class AccountDetails {
private AccountHolder accountHolder;
private String accountCurrency;
private Bic bic;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class AccountHolder {

private Name name;
private String governmentId;

}
Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@ToString
@NoArgsConstructor
@AllArgsConstructor
@Data
public class AccountUri {
@JsonProperty(value = "type")
private String type;

@JsonProperty(value = "value")
private String value;

public String getType() {
return type;
}

public AccountUri() {
}

public AccountUri(String type, String value) {
this.type = type;
this.value = value;
}

public void setType(String type) {
this.type = type;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

@Override
public String toString() {
return "{" +
"type='" + type + '\'' +
", value='" + value + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Bic {
private String value;
private String type;

}
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.mastercard.crossborder.api.rest.vas.bav.api.request.ValidateReq.ValidateRequestType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@ToString
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IBanValidationRequest {

@JsonInclude(Include.NON_NULL)
private ValidateRequestType requestType;

private AccountUri accountUri;

public IBanValidationRequest() {
}
@JsonInclude(Include.NON_NULL)
private AccountDetails accountDetails;

public IBanValidationRequest(AccountUri accountUri) {
this.accountUri = accountUri;
}

public AccountUri getAccountUri() {
return accountUri;
}

public void setAccountUri(AccountUri accountUri) {
this.accountUri = accountUri;
}

@Override
public String toString() {
return "IBanValidationRequest{" +
"accountUri=" + accountUri +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Name {

private String firstName;
private String middleName;
private String lastName;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.request.ValidateReq;

public enum ValidateRequestType {
IVS,
CES,
ASV;
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.response;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString
public class Bic {
String type;
String value;

public Bic(String type, String value) {
this.type = type;
this.value = value;
}

public Bic() {
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

@Override
public String toString() {
return "Bic{" +
"type='" + type + '\'' +
", value='" + value + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.response;

import com.mastercard.crossborder.api.rest.vas.bav.api.response.validateRes.ReceivingEligibility;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString
public class ValidateAccountResponse {
private String refId;
private String status;
private String message;
private AccountMatch accountMatch;

public ValidateAccountResponse() {
}

public ValidateAccountResponse(String status, String message, AccountMatch accountMatch, Bank bank) {
this.status = status;
this.message = message;
this.accountMatch = accountMatch;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public AccountMatch getAccountMatch() {
return accountMatch;
}

public void setAccountMatch(AccountMatch accountMatch) {
this.accountMatch = accountMatch;
}

private ReceivingEligibility receivingEligibility;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.response.validateRes;

public enum AccountStatus {
ELIGIBLE,
INELIGIBLE,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.response.validateRes;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@ToString
@Getter
@Setter
public class CrossBorder {

private YesNo eligible;
private YesNo fasterFunds;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.response.validateRes;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class ReceivingEligibility {

private CrossBorder crossBorder;
private String paymentSystem;
private String product;
private AccountStatus status;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.mastercard.crossborder.api.rest.vas.bav.api.response.validateRes;

public enum YesNo {
Y,
N,
U
}

Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private List<Object> mapAccountValues(String response,Class<T> listElementClass
CollectionType listType =
mapper.getTypeFactory().constructCollectionType(ArrayList.class,listElementClass);
return mapper.readValue(response, listType);
}catch(JsonProcessingException e){
}catch(IOException e){
logger.warn("Error while processing response");
}
}
Expand Down
Loading