diff --git a/openapi.json b/openapi.json index 4e287cb..e2bd9d5 100755 --- a/openapi.json +++ b/openapi.json @@ -6474,7 +6474,9 @@ "boleto", "ideal", "blik", - "bancontact" + "bancontact", + "google_pay", + "apple_pay" ] }, "installments": { @@ -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" diff --git a/src/main/java/com/sumup/sdk/models/ProcessCheckout.java b/src/main/java/com/sumup/sdk/models/ProcessCheckout.java index 130a06b..e035fe7 100644 --- a/src/main/java/com/sumup/sdk/models/ProcessCheckout.java +++ b/src/main/java/com/sumup/sdk/models/ProcessCheckout.java @@ -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 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 googlePay, + /** Number of installments for deferred payments. Available only to merchant users in Brazil. */ Long installments, @@ -39,8 +50,10 @@ public static Builder builder() { /** Builder for ProcessCheckout instances. */ public static final class Builder { + private java.util.Map applePay; private com.sumup.sdk.models.Card card; private String customerId; + private java.util.Map googlePay; private Long installments; private com.sumup.sdk.models.MandatePayload mandate; private com.sumup.sdk.models.ProcessCheckoutPaymentType paymentType; @@ -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 applePay) { + this.applePay = applePay; + return this; + } + /** * Sets the value for {@code card}. * @@ -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 googlePay) { + this.googlePay = googlePay; + return this; + } + /** * Sets the value for {@code installments}. * @@ -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"), diff --git a/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java b/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java index dbb8696..b4c17ac 100644 --- a/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java +++ b/src/main/java/com/sumup/sdk/models/ProcessCheckoutPaymentType.java @@ -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;