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

Add StatementDescriptor #335

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 14 additions & 0 deletions src/main/java/com/mangopay/entities/Refund.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public class Refund extends Transaction {
@SerializedName("Reference")
private String reference;

/**
* An optional value to be specified on the user's bank statement
*/
@SerializedName("StatementDescriptor")
private String statementDescriptor;

public String getInitialTransactionId() {
return initialTransactionId;
}
Expand Down Expand Up @@ -94,6 +100,14 @@ public void setReference(String reference) {
this.reference = reference;
}

public String getStatementDescriptor() {
return statementDescriptor;
}

public void setStatementDescriptor(String statementDescriptor) {
this.statementDescriptor = statementDescriptor;
}

/**
* Gets map which property is an object and what type of object.
*
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 @@ -1052,6 +1052,7 @@ protected Refund getNewRefundForTransfer(Transfer transfer) throws Exception {
refund.setFees(new Money());
refund.getFees().setAmount(transfer.getFees().getAmount());
refund.getFees().setCurrency(transfer.getFees().getCurrency());
refund.setStatementDescriptor("MGP");

return this.api.getTransferApi().createRefund(transfer.getId(), refund);
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/mangopay/core/RefundApiImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void getRefundForPayIn() throws Exception {
assertTrue(getRefund.getType() == TransactionType.PAYOUT);
assertTrue(getRefund.getInitialTransactionType() == InitialTransactionType.PAYIN);
assertNotNull(getRefund.getRefundReason());
assertNotNull(getRefund.getStatementDescriptor());
assertTrue(getRefund.getRefundReason().getRefundReasonType() == RefundReasonType.INITIALIZED_BY_CLIENT);
}
}
Loading