Skip to content

Commit 595a998

Browse files
authored
Merge pull request #162 from gocardless/template-changes
Changes from gocardless/gocardless-pro-java-template
2 parents 3b46694 + 91ae8fe commit 595a998

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/main/java/com/gocardless/services/PaymentService.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public static final class PaymentCreateRequest extends IdempotentPostRequest<Pay
112112
private Boolean fasterAch;
113113
private Links links;
114114
private Map<String, String> metadata;
115+
private PsuInteractionType psuInteractionType;
115116
private String reference;
116117
private Boolean retryIfPossible;
117118

@@ -210,6 +211,22 @@ public PaymentCreateRequest withMetadata(String key, String value) {
210211
return this;
211212
}
212213

214+
/**
215+
* Indicates how a Variable Recurring Payment (VRP) is initiated, by or on behalf of the
216+
* payer.
217+
* <ul>
218+
* <li>`in_session`: The payer is actively participating in the payment creation
219+
* session.</li>
220+
* <li>`off_session`: The payer is not present during the transaction, and the payment is
221+
* initiated by the merchant based on an established consent (e.g., a recurring subscription
222+
* payment).</li>
223+
* </ul>
224+
*/
225+
public PaymentCreateRequest withPsuInteractionType(PsuInteractionType psuInteractionType) {
226+
this.psuInteractionType = psuInteractionType;
227+
return this;
228+
}
229+
213230
/**
214231
* An optional reference that will appear on your customer's bank statement. The character
215232
* limit for this reference is dependent on the scheme.<br />
@@ -313,6 +330,18 @@ public String toString() {
313330
}
314331
}
315332

333+
public enum PsuInteractionType {
334+
@SerializedName("in_session")
335+
IN_SESSION, @SerializedName("off_session")
336+
OFF_SESSION, @SerializedName("unknown")
337+
UNKNOWN;
338+
339+
@Override
340+
public String toString() {
341+
return name().toLowerCase();
342+
}
343+
}
344+
316345
public static class Links {
317346
private String mandate;
318347

0 commit comments

Comments
 (0)