Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added CardHolderName param #334

Merged
merged 1 commit into from
May 24, 2024
Merged
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
10 changes: 10 additions & 0 deletions src/main/java/com/mangopay/entities/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ public class Card extends EntityBase {
@SerializedName("Shipping")
private Shipping shipping;

/**
* The cardholder’s name shown on the payment card.
*/
@SerializedName("CardHolderName")
private String cardHolderName;

public String getUserId() {
return userId;
}
Expand Down Expand Up @@ -185,6 +191,10 @@ public String getFingerprint() {

public void setShipping(Shipping shipping) { this.shipping = shipping; }

public String getCardHolderName() {
return cardHolderName;
}

/**
* Gets the collection of read-only fields names.
*
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/mangopay/entities/CardRegistration.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public class CardRegistration extends EntityBase {
@SerializedName("CardType")
private CardType cardType;

/**
* The cardholder’s name shown on the payment card.
*/
@SerializedName("CardHolderName")
private String cardHolderName;

public CardRegistration() {
this.cardType = CardType.CB_VISA_MASTERCARD;
}
Expand Down Expand Up @@ -160,6 +166,11 @@ public void setCardType(CardType cardType) {
this.cardType = cardType;
}

public CardRegistration setCardHolderName(String cardHolderName) {
this.cardHolderName = cardHolderName;
return this;
}

/**
* Gets the collection of read-only fields names.
*
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/mangopay/core/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ private PayIn getPayInCardDirect(String userId) throws Exception {
cardRegistration.setCurrency(CurrencyIso.EUR);
cardRegistration = this.api.getCardRegistrationApi().create(cardRegistration);
cardRegistration.setRegistrationData(this.getPaylineCorrectRegistartionData(cardRegistration));
cardRegistration.setCardHolderName("John Silver");
cardRegistration = this.api.getCardRegistrationApi().update(cardRegistration);

Card card = this.api.getCardApi().get(cardRegistration.getCardId());
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/mangopay/core/CardApiImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void getCardsByFingerprint() throws Exception {

for (Card byFingerprint : cardsByFingerprint) {
assertEquals(card.getFingerprint(), byFingerprint.getFingerprint());
assertNotNull(card.getCardHolderName());
}
}

Expand Down
Loading