Skip to content
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
48 changes: 47 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6474,7 +6474,9 @@
"boleto",
"ideal",
"blik",
"bancontact"
"bancontact",
"google_pay",
"apple_pay"
]
},
"installments": {
Expand All @@ -6489,6 +6491,50 @@
"card": {
"$ref": "#/components/schemas/Card"
},
"google_pay": {
"description": "Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is.",
"type": "object",
"example": {
"apiVersionMinor": 0,
"apiVersion": 2,
"paymentMethodData": {
"description": "Visa •••• 1111",
"tokenizationData": {
"type": "PAYMENT_GATEWAY",
"token": "token-data"
},
"type": "CARD",
"info": {
"cardNetwork": "VISA",
"cardDetails": "1111"
}
}
}
},
"apple_pay": {
"description": "Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is.",
"type": "object",
"example": {
"token": {
"paymentData": {
"data": "si2xuT2ArQo689SfE-long-token",
"signature": "MIAGCSqGSIb3DQEHA-long-signature",
"header": {
"publicKeyHash": "PWfjDi3TSwgZ20TY/A7f3V6J/1rhHyRDCspbeljM0io=",
"ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaBtz7UN2MNV0qInJVEEhXy10PU0KfO6KxFjXm93oKWL6lCsxZZGDl/EKioUHVSlKgpsKGin0xvgldfxeJVgy0g==",
"transactionId": "62e0568bc9258e9d0e059d745650fc8211d05ef7a7a1589a6411bf9b12cdfd04"
},
"version": "EC_v1"
},
"paymentMethod": {
"displayName": "MasterCard 8837",
"network": "MasterCard",
"type": "debit"
},
"transactionIdentifier": "62E0568BC9258E9D0E059D745650FC8211D05EF7A7A1589A6411BF9B12CDFD04"
}
}
},
"token": {
"description": "__Required when using a tokenized card to process a checkout.__ Unique token identifying the saved payment card for a customer.",
"type": "string"
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/com/sumup/sdk/models/ProcessCheckout.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@

/** Details of the payment instrument for processing the checkout. */
public record ProcessCheckout(
/**
* Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is.
*/
java.util.Map<String, Object> applePay,

/** __Required when payment type is `card`.__ Details of the payment card. */
com.sumup.sdk.models.Card card,

/** __Required when `token` is provided.__ Unique ID of the customer. */
String customerId,

/**
* Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload
* as-is.
*/
java.util.Map<String, Object> googlePay,

/** Number of installments for deferred payments. Available only to merchant users in Brazil. */
Long installments,

Expand Down Expand Up @@ -39,8 +50,10 @@ public static Builder builder() {

/** Builder for ProcessCheckout instances. */
public static final class Builder {
private java.util.Map<String, Object> applePay;
private com.sumup.sdk.models.Card card;
private String customerId;
private java.util.Map<String, Object> googlePay;
private Long installments;
private com.sumup.sdk.models.MandatePayload mandate;
private com.sumup.sdk.models.ProcessCheckoutPaymentType paymentType;
Expand All @@ -49,6 +62,18 @@ public static final class Builder {

private Builder() {}

/**
* Sets the value for {@code applePay}.
*
* @param applePay Raw payment token object received from Apple Pay. Send the Apple Pay response
* payload as-is.
* @return This builder instance.
*/
public Builder applePay(java.util.Map<String, Object> applePay) {
this.applePay = applePay;
return this;
}

/**
* Sets the value for {@code card}.
*
Expand All @@ -71,6 +96,18 @@ public Builder customerId(String customerId) {
return this;
}

/**
* Sets the value for {@code googlePay}.
*
* @param googlePay Raw `PaymentData` object received from Google Pay. Send the Google Pay
* response payload as-is.
* @return This builder instance.
*/
public Builder googlePay(java.util.Map<String, Object> googlePay) {
this.googlePay = googlePay;
return this;
}

/**
* Sets the value for {@code installments}.
*
Expand Down Expand Up @@ -135,8 +172,10 @@ public Builder token(String token) {
*/
public ProcessCheckout build() {
return new ProcessCheckout(
applePay,
card,
customerId,
googlePay,
installments,
mandate,
Objects.requireNonNull(paymentType, "paymentType"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ public enum ProcessCheckoutPaymentType {
BOLETO("boleto"),
IDEAL("ideal"),
BLIK("blik"),
BANCONTACT("bancontact");
BANCONTACT("bancontact"),
GOOGLE_PAY("google_pay"),
APPLE_PAY("apple_pay");

private final String value;

Expand Down
Loading