From 25815cc99897202ec5b90dce7f767b24e89ce2de Mon Sep 17 00:00:00 2001 From: Dirk Ehrhardt Date: Fri, 20 Feb 2026 11:10:11 +0100 Subject: [PATCH 1/4] feat: add changes for api version 1.47.0 --- api-definition.yaml | 197 ++++++++++++++++-- .../models/CapturePaymentRequest.py | 2 + .../models/CapturePaymentResponse.py | 2 + pcp_serversdk_python/models/CartItemInput.py | 2 + pcp_serversdk_python/models/CartItemPatch.py | 2 + pcp_serversdk_python/models/CartItemResult.py | 2 + .../models/CartItemSupplierReferences.py | 13 ++ .../models/CreatePaymentResponse.py | 2 + pcp_serversdk_python/models/DeliverRequest.py | 2 + .../models/DeliverResponse.py | 2 + .../models/FundDistribution.py | 37 ++++ .../models/FundDistributionType.py | 10 + pcp_serversdk_python/models/FundSplit.py | 18 ++ .../MobilePaymentMethodSpecificInput.py | 4 + .../models/MobilePaymentNetwork.py | 10 + pcp_serversdk_python/models/OrderRequest.py | 2 + pcp_serversdk_python/models/OrderResponse.py | 2 + pcp_serversdk_python/models/PaymentEvent.py | 6 + .../models/PaymentExecution.py | 4 + .../models/PaymentExecutionSpecificInput.py | 2 + .../models/PaymentProduct302SpecificInput.py | 4 +- .../models/PaymentProduct5002SpecificInput.py | 18 ++ .../models/RefundPaymentResponse.py | 2 + pcp_serversdk_python/models/RefundRequest.py | 3 + pcp_serversdk_python/models/ReturnRequest.py | 2 + pcp_serversdk_python/models/ReturnResponse.py | 2 + pcp_serversdk_python/models/__init__.py | 12 ++ .../transformer/ApplepayTransformer.py | 8 +- 28 files changed, 346 insertions(+), 26 deletions(-) create mode 100644 pcp_serversdk_python/models/CartItemSupplierReferences.py create mode 100644 pcp_serversdk_python/models/FundDistribution.py create mode 100644 pcp_serversdk_python/models/FundDistributionType.py create mode 100644 pcp_serversdk_python/models/FundSplit.py create mode 100644 pcp_serversdk_python/models/MobilePaymentNetwork.py create mode 100644 pcp_serversdk_python/models/PaymentProduct5002SpecificInput.py diff --git a/api-definition.yaml b/api-definition.yaml index 72f9579..1719f3a 100644 --- a/api-definition.yaml +++ b/api-definition.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.40.0 + version: 1.47.0 title: "Commerce Platform API" description: | RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments. @@ -2214,6 +2214,8 @@ components: $ref: '#/components/schemas/PaymentReferences' delivery: $ref: '#/components/schemas/DeliveryInformation' + fundSplit: + $ref: '#/components/schemas/FundSplit' CapturePaymentResponse: type: object additionalProperties: false @@ -2224,6 +2226,8 @@ components: $ref: '#/components/schemas/StatusValue' statusOutput: $ref: '#/components/schemas/PaymentStatusOutput' + fundSplit: + $ref: '#/components/schemas/FundSplit' id: type: string description: Unique payment transaction identifier of the payment gateway. @@ -2452,6 +2456,8 @@ components: $ref: '#/components/schemas/CartItemInvoiceData' orderLineDetails: $ref: '#/components/schemas/OrderLineDetailsInput' + supplierReferences: + $ref: '#/components/schemas/CartItemSupplierReferences' CartItemInvoiceData: type: object description: Object containing the line items of the invoice or shopping cart. @@ -2473,6 +2479,8 @@ components: $ref: '#/components/schemas/CartItemInvoiceData' orderLineDetails: $ref: '#/components/schemas/OrderLineDetailsPatch' + supplierReferences: + $ref: '#/components/schemas/CartItemSupplierReferences' CartItemResult: type: object description: This object contains information of all items in the cart. @@ -2483,6 +2491,8 @@ components: $ref: '#/components/schemas/CartItemInvoiceData' orderLineDetails: $ref: '#/components/schemas/OrderLineDetailsResult' + supplierReferences: + $ref: '#/components/schemas/CartItemSupplierReferences' CartItemStatus: type: string enum: @@ -2492,6 +2502,23 @@ components: - RETURNED - WAITING_FOR_PAYMENT description: Indicates in which status the line item is + CartItemSupplierReferences: + type: object + description: | + This object contains references of the seller of the cart item. + additionalProperties: false + properties: + supplierId: + type: string + description: Unique identifier for the supplier. + maxLength: 64 + example: "5678" + orderReference: + type: string + description: |- + Reference of the order for the supplier. + maxLength: 64 + example: "Order-5678" CheckoutResponse: type: object xml: @@ -2842,6 +2869,8 @@ components: $ref: '#/components/schemas/MerchantAction' payment: $ref: '#/components/schemas/PaymentResponse' + fundSplit: + $ref: '#/components/schemas/FundSplit' paymentExecutionId: description: reference to the paymentExecution. type: string @@ -2944,7 +2973,7 @@ components: properties: acceptHeader: type: string - description: | + description: | The accept-header of the customer client from the HTTP Headers. This field can be mandatory depending on the selected payment method and routing option. maxLength: 2048 @@ -3016,6 +3045,8 @@ components: type: array items: $ref: '#/components/schemas/DeliverItem' + fundSplit: + $ref: '#/components/schemas/FundSplit' DeliverResponse: type: object properties: @@ -3023,6 +3054,8 @@ components: $ref: '#/components/schemas/CapturePaymentResponse' shoppingCart: $ref: '#/components/schemas/ShoppingCartResult' + fundSplit: + $ref: '#/components/schemas/FundSplit' DeliverType: type: string description: | @@ -3134,6 +3167,75 @@ components: $ref: '#/components/schemas/PaymentProduct3391SpecificOutput' paymentInstructions: $ref: '#/components/schemas/PaymentInstructions' + FundDistribution: + type: object + description: Instructions for distributing funds to multiple sellers or partners in a marketplace context. + additionalProperties: false + properties: + id: + type: string + format: UUID + readOnly: true + accountId: + type: string + description: >- + Unique identifier of the beneficiary (seller/partner/sub-account) to receive funds (e.g., payout account ID). + description: + type: string + description: Human-readable description for reconciliation. Appears on reports. + example: "Commission for order #ORD-2025-0001" + maxLength: 128 + amount: + type: integer + description: Amount in cents and always having 2 decimals, in the currency of the original transaction + format: int64 + maximum: 999999999999 + minimum: 1 + example: 1000 + type: + type: string + format: string + description: Classification or purpose of the fund distribution to the receiving account within a given order. + enum: + - SELLER_REVENUE + - COMMISSION_FEE + - SHIPPING_COSTS + - TAX + - PLATFORM_FEE + - OTHER + merchantReference: + type: string + description: Unique reference of the part of the fund/payment to be distributed that is also returned for reporting and reconciliation purposes. + maxLength: 40 + example: customer-order-1234 + merchantParameters: + type: string + maxLength: 1000 + description: >- + It allows you to store additional parameters for the transaction in JSON format. + This field must not contain any personal data. + example: "{'marketplaceOrderId':'ORD-2025-0001','sellerId':'seller-789'}" + required: + - accountId + - amount + - type + FundSplit: + type: object + description: Instructions for distributing funds to multiple sellers or partners in a marketplace context. + additionalProperties: false + properties: + id: + type: string + format: UUID + readOnly: true + paymentEventId: + type: string + format: UUID + readOnly: true + fundDistributions: + type: array + items: + $ref: '#/components/schemas/FundDistribution' InstallmentOption: type: object properties: @@ -3274,6 +3376,8 @@ components: $ref: '#/components/schemas/MobilePaymentThreeDSecure' paymentProduct302SpecificInput: $ref: '#/components/schemas/PaymentProduct302SpecificInput' + paymentProduct5002SpecificInput: + $ref: '#/components/schemas/PaymentProduct5002SpecificInput' MobilePaymentMethodSpecificOutput: type: object description: Object containing the mobile payment method details. @@ -3297,6 +3401,24 @@ components: network: type: string description: The card network that was used for a mobile payment method operation + MobilePaymentNetwork: + type: string + description: |- + Network/Scheme of the card used for the payment. + * MASTERCARD + * VISA + * AMEX + * GIROCARD + * DISCOVER (not supported yet) + * JCB (not supported yet) + enum: + - MASTERCARD + - VISA + - AMEX + - GIROCARD + - DISCOVER + - JCB + example: MASTERCARD MobilePaymentThreeDSecure: type: object description: |- @@ -3383,7 +3505,7 @@ components: example: 0 taxAmountPerUnit: type: boolean - description: |- + description: |- This field indicates if the `taxAmount` is to be interpreted as the tax amount per unit rather than for the entire line item. This field is included in the response only when `taxAmount` is set; otherwise, it will return as `null`. format: int64 @@ -3481,6 +3603,8 @@ components: $ref: '#/components/schemas/OrderItem' paymentMethodSpecificInput: $ref: '#/components/schemas/PaymentMethodSpecificInput' + fundSplit: + $ref: '#/components/schemas/FundSplit' OrderResponse: type: object description: Object that contains details on the created payment in case one has been created. @@ -3490,6 +3614,8 @@ components: $ref: '#/components/schemas/CreatePaymentResponse' shoppingCart: $ref: '#/components/schemas/ShoppingCartResult' + fundSplit: + $ref: '#/components/schemas/FundSplit' OrderType: type: string description: | @@ -3507,6 +3633,7 @@ components: enum: - FULL - PARTIAL + readOnly: true PatchCheckoutRequest: type: object description: | @@ -3604,6 +3731,22 @@ components: example: Customer complained paymentInstructions: $ref: '#/components/schemas/PaymentInstructions' + paymentEventId: + type: string + format: UUID + readOnly: true + creationDateTime: + type: string + format: date-time + readOnly: true + description: |- + The date and time when the payment event was created. + + Format will be in one of the following formats: + * YYYY-MM-DD'T'HH:mm:ss'Z' + * YYYY-MM-DD'T'HH:mm:ss+XX:XX + * YYYY-MM-DD'T'HH:mm:ss-XX:XX + example: 2022-01-01T00:00:00Z PaymentExecution: type: object description: |- @@ -3664,6 +3807,10 @@ components: type: array items: $ref: '#/components/schemas/PaymentEvent' + fundSplits: + type: array + items: + $ref: '#/components/schemas/FundSplit' PaymentExecutionRequest: type: object description: | @@ -3693,6 +3840,8 @@ components: $ref: '#/components/schemas/ShoppingCartInput' paymentReferences: $ref: '#/components/schemas/References' + fundSplit: + $ref: '#/components/schemas/FundSplit' required: - paymentReferences PaymentInformationRefundRequest: @@ -3920,23 +4069,7 @@ components: - MASS_ENABLEMENT example: MASS_ENABLEMENT network: - type: string - description: |- - Network/Scheme of the card used for the payment. - * MASTERCARD - * VISA - * AMEX - * GIROCARD - * DISCOVER (not supported yet) - * JCB (not supported yet) - enum: - - MASTERCARD - - VISA - - AMEX - - GIROCARD - - DISCOVER - - JCB - example: GIROCARD + $ref: '#/components/schemas/MobilePaymentNetwork' token: $ref: '#/components/schemas/ApplePaymentDataTokenInformation' domainName: @@ -3977,6 +4110,22 @@ components: $ref: '#/components/schemas/BankAccountInformation' required: - bankAccountInformation + PaymentProduct5002SpecificInput: + type: object + description: Object containing additional Information needed for Click To Pay processing. + properties: + network: + $ref: '#/components/schemas/MobilePaymentNetwork' + paymentCheckoutData: + type: string + description: |- + JWS Token Value (checkoutResponseSignature) as received in the Checkout Response on Client Side, Base64URL encoded. + example: rhHAQUrR118u[...]cwDw== + srcDpaId: + type: string + description: |- + DPA Identifier provided by PAYONE during client side initialization for the corresponding card type selected by the end consumer in the Click to Pay flow. + maxLength: 64 PaymentProduct771SpecificOutput: type: object description: Output that is SEPA Direct Debit specific (i.e. the used mandate). @@ -4487,6 +4636,8 @@ components: $ref: '#/components/schemas/StatusValue' statusOutput: $ref: '#/components/schemas/PaymentStatusOutput' + fundSplit: + $ref: '#/components/schemas/FundSplit' id: type: string description: Unique payment transaction identifier of the payment gateway. @@ -4505,6 +4656,8 @@ components: $ref: '#/components/schemas/PaymentReferences' return: $ref: '#/components/schemas/ReturnInformation' + fundSplit: + $ref: '#/components/schemas/FundSplit' ReturnInformation: type: object description: |- @@ -4566,6 +4719,8 @@ components: type: array items: $ref: '#/components/schemas/ReturnItem' + fundSplit: + $ref: '#/components/schemas/FundSplit' ReturnResponse: type: object properties: @@ -4573,6 +4728,8 @@ components: $ref: '#/components/schemas/RefundPaymentResponse' shoppingCart: $ref: '#/components/schemas/ShoppingCartResult' + fundSplit: + $ref: '#/components/schemas/FundSplit' ReturnType: type: string description: | diff --git a/pcp_serversdk_python/models/CapturePaymentRequest.py b/pcp_serversdk_python/models/CapturePaymentRequest.py index ad8f5d5..a043a3a 100644 --- a/pcp_serversdk_python/models/CapturePaymentRequest.py +++ b/pcp_serversdk_python/models/CapturePaymentRequest.py @@ -3,6 +3,7 @@ from .CancellationReason import CancellationReason from .DeliveryInformation import DeliveryInformation +from .FundSplit import FundSplit from .PaymentReferences import PaymentReferences @@ -13,3 +14,4 @@ class CapturePaymentRequest: cancellationReason: Optional[CancellationReason] = None references: Optional[PaymentReferences] = None delivery: Optional[DeliveryInformation] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/CapturePaymentResponse.py b/pcp_serversdk_python/models/CapturePaymentResponse.py index 02f9943..f1b3e7d 100644 --- a/pcp_serversdk_python/models/CapturePaymentResponse.py +++ b/pcp_serversdk_python/models/CapturePaymentResponse.py @@ -2,6 +2,7 @@ from typing import Optional from .CaptureOutput import CaptureOutput +from .FundSplit import FundSplit from .PaymentStatusOutput import PaymentStatusOutput from .StatusValue import StatusValue @@ -12,3 +13,4 @@ class CapturePaymentResponse: status: Optional[StatusValue] = None statusOutput: Optional[PaymentStatusOutput] = None id: Optional[str] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/CartItemInput.py b/pcp_serversdk_python/models/CartItemInput.py index dc656b8..b04a0fa 100644 --- a/pcp_serversdk_python/models/CartItemInput.py +++ b/pcp_serversdk_python/models/CartItemInput.py @@ -2,6 +2,7 @@ from typing import Optional from .CartItemInvoiceData import CartItemInvoiceData +from .CartItemSupplierReferences import CartItemSupplierReferences from .OrderLineDetailsInput import OrderLineDetailsInput @@ -9,3 +10,4 @@ class CartItemInput: invoiceData: Optional[CartItemInvoiceData] = None orderLineDetails: Optional[OrderLineDetailsInput] = None + supplierReferences: Optional[CartItemSupplierReferences] = None diff --git a/pcp_serversdk_python/models/CartItemPatch.py b/pcp_serversdk_python/models/CartItemPatch.py index dac381c..2b05103 100644 --- a/pcp_serversdk_python/models/CartItemPatch.py +++ b/pcp_serversdk_python/models/CartItemPatch.py @@ -2,6 +2,7 @@ from typing import Optional from .CartItemInvoiceData import CartItemInvoiceData +from .CartItemSupplierReferences import CartItemSupplierReferences from .OrderLineDetailsPatch import OrderLineDetailsPatch @@ -9,3 +10,4 @@ class CartItemPatch: invoiceData: Optional[CartItemInvoiceData] = None orderLineDetails: Optional[OrderLineDetailsPatch] = None + supplierReferences: Optional[CartItemSupplierReferences] = None diff --git a/pcp_serversdk_python/models/CartItemResult.py b/pcp_serversdk_python/models/CartItemResult.py index e851629..6f05d6e 100644 --- a/pcp_serversdk_python/models/CartItemResult.py +++ b/pcp_serversdk_python/models/CartItemResult.py @@ -2,6 +2,7 @@ from typing import Optional from .CartItemInvoiceData import CartItemInvoiceData +from .CartItemSupplierReferences import CartItemSupplierReferences from .OrderLineDetailsResult import OrderLineDetailsResult @@ -9,3 +10,4 @@ class CartItemResult: invoiceData: Optional[CartItemInvoiceData] = None orderLineDetails: Optional[OrderLineDetailsResult] = None + supplierReferences: Optional[CartItemSupplierReferences] = None diff --git a/pcp_serversdk_python/models/CartItemSupplierReferences.py b/pcp_serversdk_python/models/CartItemSupplierReferences.py new file mode 100644 index 0000000..a05dd7d --- /dev/null +++ b/pcp_serversdk_python/models/CartItemSupplierReferences.py @@ -0,0 +1,13 @@ +from dataclasses import dataclass +from typing import Optional + + +@dataclass(kw_only=True) +class CartItemSupplierReferences: + """References of the seller of a cart item.""" + + supplierId: Optional[str] = None + """Identifier of the supplier/seller. Maximum length: 64 characters.""" + + orderReference: Optional[str] = None + """Order reference of the supplier/seller. Maximum length: 64 characters.""" diff --git a/pcp_serversdk_python/models/CreatePaymentResponse.py b/pcp_serversdk_python/models/CreatePaymentResponse.py index 24d2892..474dd4a 100644 --- a/pcp_serversdk_python/models/CreatePaymentResponse.py +++ b/pcp_serversdk_python/models/CreatePaymentResponse.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Optional +from .FundSplit import FundSplit from .MerchantAction import MerchantAction from .PaymentCreationOutput import PaymentCreationOutput from .PaymentResponse import PaymentResponse @@ -12,3 +13,4 @@ class CreatePaymentResponse: merchantAction: Optional[MerchantAction] = None payment: Optional[PaymentResponse] = None paymentExecutionId: Optional[str] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/DeliverRequest.py b/pcp_serversdk_python/models/DeliverRequest.py index ebc4966..201ce5a 100644 --- a/pcp_serversdk_python/models/DeliverRequest.py +++ b/pcp_serversdk_python/models/DeliverRequest.py @@ -4,6 +4,7 @@ from .CancellationReason import CancellationReason from .DeliverItem import DeliverItem from .DeliverType import DeliverType +from .FundSplit import FundSplit @dataclass(kw_only=True) @@ -12,3 +13,4 @@ class DeliverRequest: isFinal: bool = False cancellationReason: Optional[CancellationReason] = None deliverItems: Optional[list[DeliverItem]] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/DeliverResponse.py b/pcp_serversdk_python/models/DeliverResponse.py index 8959e6b..2ef5279 100644 --- a/pcp_serversdk_python/models/DeliverResponse.py +++ b/pcp_serversdk_python/models/DeliverResponse.py @@ -2,6 +2,7 @@ from typing import Optional from .CapturePaymentResponse import CapturePaymentResponse +from .FundSplit import FundSplit from .ShoppingCartResult import ShoppingCartResult @@ -9,3 +10,4 @@ class DeliverResponse: capturePaymentResponse: Optional[CapturePaymentResponse] = None shoppingCart: Optional[ShoppingCartResult] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/FundDistribution.py b/pcp_serversdk_python/models/FundDistribution.py new file mode 100644 index 0000000..1b5f6a8 --- /dev/null +++ b/pcp_serversdk_python/models/FundDistribution.py @@ -0,0 +1,37 @@ +from dataclasses import dataclass +from typing import Optional + +from .AmountOfMoney import AmountOfMoney +from .FundDistributionType import FundDistributionType + + +@dataclass(kw_only=True) +class FundDistribution: + """Instructions for distributing funds to multiple sellers/partners in a marketplace context.""" + + accountId: str + """Account ID of the seller/partner to receive the funds.""" + + amount: AmountOfMoney + """Amount of money to distribute.""" + + type: FundDistributionType + """Type of fund distribution. + - `SELLER_REVENUE` + - `COMMISSION_FEE` + - `SHIPPING_COSTS` + - `TAX` + - `PLATFORM_FEE` + - `OTHER`""" + + id: Optional[str] = None + """Unique identifier of the fund distribution entry. Read-only UUID.""" + + description: Optional[str] = None + """Description of the fund distribution entry.""" + + merchantReference: Optional[str] = None + """Merchant reference for the fund distribution.""" + + merchantParameters: Optional[str] = None + """Merchant specific parameters for the fund distribution.""" diff --git a/pcp_serversdk_python/models/FundDistributionType.py b/pcp_serversdk_python/models/FundDistributionType.py new file mode 100644 index 0000000..16b6abb --- /dev/null +++ b/pcp_serversdk_python/models/FundDistributionType.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class FundDistributionType(str, Enum): + SELLER_REVENUE = "SELLER_REVENUE" + COMMISSION_FEE = "COMMISSION_FEE" + SHIPPING_COSTS = "SHIPPING_COSTS" + TAX = "TAX" + PLATFORM_FEE = "PLATFORM_FEE" + OTHER = "OTHER" diff --git a/pcp_serversdk_python/models/FundSplit.py b/pcp_serversdk_python/models/FundSplit.py new file mode 100644 index 0000000..ab8c35b --- /dev/null +++ b/pcp_serversdk_python/models/FundSplit.py @@ -0,0 +1,18 @@ +from dataclasses import dataclass +from typing import Optional + +from .FundDistribution import FundDistribution + + +@dataclass(kw_only=True) +class FundSplit: + """Instructions for distributing funds in a marketplace context.""" + + id: Optional[str] = None + """Unique identifier of the fund split. Read-only UUID.""" + + paymentEventId: Optional[str] = None + """Unique identifier of the payment event. Read-only UUID.""" + + fundDistributions: Optional[list[FundDistribution]] = None + """List of fund distribution instructions.""" diff --git a/pcp_serversdk_python/models/MobilePaymentMethodSpecificInput.py b/pcp_serversdk_python/models/MobilePaymentMethodSpecificInput.py index d375a38..8dff55c 100644 --- a/pcp_serversdk_python/models/MobilePaymentMethodSpecificInput.py +++ b/pcp_serversdk_python/models/MobilePaymentMethodSpecificInput.py @@ -4,6 +4,7 @@ from .AuthorizationMode import AuthorizationMode from .MobilePaymentThreeDSecure import MobilePaymentThreeDSecure from .PaymentProduct302SpecificInput import PaymentProduct302SpecificInput +from .PaymentProduct5002SpecificInput import PaymentProduct5002SpecificInput @dataclass(kw_only=True) @@ -33,3 +34,6 @@ class MobilePaymentMethodSpecificInput: paymentProduct302SpecificInput: Optional[PaymentProduct302SpecificInput] = None """Specific input for payment product 302.""" + + paymentProduct5002SpecificInput: Optional[PaymentProduct5002SpecificInput] = None + """Specific input for payment product 5002 (Click To Pay).""" diff --git a/pcp_serversdk_python/models/MobilePaymentNetwork.py b/pcp_serversdk_python/models/MobilePaymentNetwork.py new file mode 100644 index 0000000..153bfbe --- /dev/null +++ b/pcp_serversdk_python/models/MobilePaymentNetwork.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class MobilePaymentNetwork(str, Enum): + MASTERCARD = "MASTERCARD" + VISA = "VISA" + AMEX = "AMEX" + GIROCARD = "GIROCARD" + DISCOVER = "DISCOVER" + JCB = "JCB" diff --git a/pcp_serversdk_python/models/OrderRequest.py b/pcp_serversdk_python/models/OrderRequest.py index b438562..6333177 100644 --- a/pcp_serversdk_python/models/OrderRequest.py +++ b/pcp_serversdk_python/models/OrderRequest.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Optional +from .FundSplit import FundSplit from .OrderItem import OrderItem from .OrderType import OrderType from .PaymentMethodSpecificInput import PaymentMethodSpecificInput @@ -13,3 +14,4 @@ class OrderRequest: orderReferences: Optional[References] = None items: Optional[list[OrderItem]] = None paymentMethodSpecificInput: Optional[PaymentMethodSpecificInput] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/OrderResponse.py b/pcp_serversdk_python/models/OrderResponse.py index 5e4f8c4..9ebf338 100644 --- a/pcp_serversdk_python/models/OrderResponse.py +++ b/pcp_serversdk_python/models/OrderResponse.py @@ -2,6 +2,7 @@ from typing import Optional from .CreatePaymentResponse import CreatePaymentResponse +from .FundSplit import FundSplit from .ShoppingCartResult import ShoppingCartResult @@ -9,3 +10,4 @@ class OrderResponse: createPaymentResponse: Optional[CreatePaymentResponse] = None shoppingCart: Optional[ShoppingCartResult] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/PaymentEvent.py b/pcp_serversdk_python/models/PaymentEvent.py index 5196e94..4c2770d 100644 --- a/pcp_serversdk_python/models/PaymentEvent.py +++ b/pcp_serversdk_python/models/PaymentEvent.py @@ -12,6 +12,12 @@ class PaymentEvent: """Detailed information regarding an occurred payment event.""" + paymentEventId: Optional[str] = None + """Unique identifier of the payment event. Read-only UUID.""" + + creationDateTime: Optional[str] = None + """The date and time when the payment event was created. Read-only.""" + type: Optional[PaymentType] = None """Type of payment event.""" diff --git a/pcp_serversdk_python/models/PaymentExecution.py b/pcp_serversdk_python/models/PaymentExecution.py index 57ad283..28ec465 100644 --- a/pcp_serversdk_python/models/PaymentExecution.py +++ b/pcp_serversdk_python/models/PaymentExecution.py @@ -4,6 +4,7 @@ from .BankPayoutMethodSpecificInput import BankPayoutMethodSpecificInput from .CardPaymentMethodSpecificInput import CardPaymentMethodSpecificInput from .FinancingPaymentMethodSpecificInput import FinancingPaymentMethodSpecificInput +from .FundSplit import FundSplit from .MobilePaymentMethodSpecificInput import MobilePaymentMethodSpecificInput from .PaymentChannel import PaymentChannel from .PaymentEvent import PaymentEvent @@ -49,3 +50,6 @@ class PaymentExecution: events: Optional[list[PaymentEvent]] = None """List of payment events associated with this payment execution.""" + + fundSplits: Optional[list[FundSplit]] = None + """List of fund splits associated with this payment execution.""" diff --git a/pcp_serversdk_python/models/PaymentExecutionSpecificInput.py b/pcp_serversdk_python/models/PaymentExecutionSpecificInput.py index 4867258..a71b794 100644 --- a/pcp_serversdk_python/models/PaymentExecutionSpecificInput.py +++ b/pcp_serversdk_python/models/PaymentExecutionSpecificInput.py @@ -2,6 +2,7 @@ from typing import Optional from .AmountOfMoney import AmountOfMoney +from .FundSplit import FundSplit from .References import References from .ShoppingCartInput import ShoppingCartInput @@ -11,3 +12,4 @@ class PaymentExecutionSpecificInput: amountOfMoney: Optional[AmountOfMoney] = None shoppingCart: Optional[ShoppingCartInput] = None paymentReferences: References + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py b/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py index e29a16d..09c16a2 100644 --- a/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py +++ b/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py @@ -3,7 +3,7 @@ from typing import Optional from .ApplePaymentDataTokenInformation import ApplePaymentDataTokenInformation -from .Network import Network +from .MobilePaymentNetwork import MobilePaymentNetwork class IntegrationType(Enum): @@ -24,7 +24,7 @@ class PaymentProduct302SpecificInput: - `MERCHANT_CERTIFICATE`: using your own certificate (paid Apple Pay account needed). - `MASS_ENABLEMENT`: using PAYONE certificate.""" - network: Optional[Network] = None + network: Optional[MobilePaymentNetwork] = None """Network/Scheme of the card used for the payment. - `MASTERCARD` - `VISA` diff --git a/pcp_serversdk_python/models/PaymentProduct5002SpecificInput.py b/pcp_serversdk_python/models/PaymentProduct5002SpecificInput.py new file mode 100644 index 0000000..defc077 --- /dev/null +++ b/pcp_serversdk_python/models/PaymentProduct5002SpecificInput.py @@ -0,0 +1,18 @@ +from dataclasses import dataclass +from typing import Optional + +from .MobilePaymentNetwork import MobilePaymentNetwork + + +@dataclass(kw_only=True) +class PaymentProduct5002SpecificInput: + """Object containing specific input details for Click To Pay payment transactions.""" + + network: Optional[MobilePaymentNetwork] = None + """Network/Scheme of the card used for the payment.""" + + paymentCheckoutData: Optional[str] = None + """The payment checkout data for Click To Pay.""" + + srcDpaId: Optional[str] = None + """The SRC DPA ID. Maximum length: 64 characters.""" diff --git a/pcp_serversdk_python/models/RefundPaymentResponse.py b/pcp_serversdk_python/models/RefundPaymentResponse.py index a0275d9..8d62908 100644 --- a/pcp_serversdk_python/models/RefundPaymentResponse.py +++ b/pcp_serversdk_python/models/RefundPaymentResponse.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Optional +from .FundSplit import FundSplit from .PaymentStatusOutput import PaymentStatusOutput from .RefundOutput import RefundOutput from .StatusValue import StatusValue @@ -12,3 +13,4 @@ class RefundPaymentResponse: status: Optional[StatusValue] = None statusOutput: Optional[PaymentStatusOutput] = None id: Optional[str] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/RefundRequest.py b/pcp_serversdk_python/models/RefundRequest.py index 9a3d5be..00de25b 100644 --- a/pcp_serversdk_python/models/RefundRequest.py +++ b/pcp_serversdk_python/models/RefundRequest.py @@ -1,6 +1,7 @@ from dataclasses import dataclass, field from typing import Optional +from .FundSplit import FundSplit from .PaymentReferences import PaymentReferences from .PositiveAmountOfMoney import PositiveAmountOfMoney from .ReturnInformation import ReturnInformation @@ -14,6 +15,7 @@ class RefundRequest: return_info: Optional[ReturnInformation] = field( default=None, metadata={"name": "return"} ) + fundSplit: Optional[FundSplit] = None # To adhere to the PAYONE API Schema, we need to use the name "return" externally. # However, to avoid conflicts with Python's reserved keyword "return", @@ -27,5 +29,6 @@ def to_dict(self): "amountOfMoney": self.amountOfMoney, "references": self.references, "return": self.return_info, + "fundSplit": self.fundSplit, } return result diff --git a/pcp_serversdk_python/models/ReturnRequest.py b/pcp_serversdk_python/models/ReturnRequest.py index a052dfb..81a4913 100644 --- a/pcp_serversdk_python/models/ReturnRequest.py +++ b/pcp_serversdk_python/models/ReturnRequest.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Optional +from .FundSplit import FundSplit from .ReturnItem import ReturnItem from .ReturnType import ReturnType @@ -10,3 +11,4 @@ class ReturnRequest: returnType: Optional[ReturnType] = None returnReason: Optional[str] = None returnItems: Optional[list[ReturnItem]] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/ReturnResponse.py b/pcp_serversdk_python/models/ReturnResponse.py index 96e583d..1aa67d6 100644 --- a/pcp_serversdk_python/models/ReturnResponse.py +++ b/pcp_serversdk_python/models/ReturnResponse.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Optional +from .FundSplit import FundSplit from .RefundPaymentResponse import RefundPaymentResponse from .ShoppingCartResult import ShoppingCartResult @@ -9,3 +10,4 @@ class ReturnResponse: returnPaymentResponse: Optional[RefundPaymentResponse] = None shoppingCart: Optional[ShoppingCartResult] = None + fundSplit: Optional[FundSplit] = None diff --git a/pcp_serversdk_python/models/__init__.py b/pcp_serversdk_python/models/__init__.py index 67eb360..4b3c95e 100644 --- a/pcp_serversdk_python/models/__init__.py +++ b/pcp_serversdk_python/models/__init__.py @@ -36,6 +36,7 @@ from .CartItemPatch import CartItemPatch from .CartItemResult import CartItemResult from .CartItemStatus import CartItemStatus +from .CartItemSupplierReferences import CartItemSupplierReferences from .CheckoutReferences import CheckoutReferences from .CheckoutResponse import CheckoutResponse from .CheckoutsResponse import CheckoutsResponse @@ -72,6 +73,9 @@ from .ExtendedCheckoutStatus import ExtendedCheckoutStatus from .FinancingPaymentMethodSpecificInput import FinancingPaymentMethodSpecificInput from .FinancingPaymentMethodSpecificOutput import FinancingPaymentMethodSpecificOutput +from .FundDistribution import FundDistribution +from .FundDistributionType import FundDistributionType +from .FundSplit import FundSplit from .Gender import Gender from .InstallmentOption import InstallmentOption from .LinkInformation import LinkInformation @@ -79,6 +83,7 @@ from .MerchantAction import MerchantAction from .MobilePaymentMethodSpecificInput import MobilePaymentMethodSpecificInput from .MobilePaymentMethodSpecificOutput import MobilePaymentMethodSpecificOutput +from .MobilePaymentNetwork import MobilePaymentNetwork from .MobilePaymentThreeDSecure import MobilePaymentThreeDSecure from .Network import Network from .Order import Order @@ -114,6 +119,7 @@ from .PaymentProduct3391SpecificInput import PaymentProduct3391SpecificInput from .PaymentProduct3391SpecificOutput import PaymentProduct3391SpecificOutput from .PaymentProduct3392SpecificInput import PaymentProduct3392SpecificInput +from .PaymentProduct5002SpecificInput import PaymentProduct5002SpecificInput from .PaymentReferences import PaymentReferences from .PaymentResponse import PaymentResponse from .PaymentStatus import PaymentStatus @@ -208,6 +214,7 @@ "CartItemPatch", "CartItemResult", "CartItemStatus", + "CartItemSupplierReferences", "CheckoutReferences", "CheckoutResponse", "CheckoutsResponse", @@ -238,6 +245,9 @@ "ExtendedCheckoutStatus", "FinancingPaymentMethodSpecificInput", "FinancingPaymentMethodSpecificOutput", + "FundDistribution", + "FundDistributionType", + "FundSplit", "Gender", "InstallmentOption", "LinkInformation", @@ -245,6 +255,7 @@ "MerchantAction", "MobilePaymentMethodSpecificInput", "MobilePaymentMethodSpecificOutput", + "MobilePaymentNetwork", "MobilePaymentThreeDSecure", "Network", "Order", @@ -278,6 +289,7 @@ "PaymentProduct3391SpecificInput", "PaymentProduct3391SpecificOutput", "PaymentProduct3392SpecificInput", + "PaymentProduct5002SpecificInput", "PaymentReferences", "PaymentResponse", "PaymentStatus", diff --git a/pcp_serversdk_python/transformer/ApplepayTransformer.py b/pcp_serversdk_python/transformer/ApplepayTransformer.py index d6e37d4..ab00eb5 100644 --- a/pcp_serversdk_python/transformer/ApplepayTransformer.py +++ b/pcp_serversdk_python/transformer/ApplepayTransformer.py @@ -4,16 +4,16 @@ ApplePaymentTokenVersion, ApplePayPayment, MobilePaymentMethodSpecificInput, - Network, + MobilePaymentNetwork, PaymentProduct302SpecificInput, ) -def network_from_string(value: str) -> str: - for network in Network: +def network_from_string(value: str) -> MobilePaymentNetwork: + for network in MobilePaymentNetwork: if value.upper() == network.value: return network - raise TypeError(f"'{value}' can't represent a Network") + raise TypeError(f"'{value}' can't represent a MobilePaymentNetwork") def version_from_string(value: str) -> str: From 04917710da8a91c4ad9a10c067b7e7c33ffbd969 Mon Sep 17 00:00:00 2001 From: Dirk Ehrhardt Date: Fri, 20 Feb 2026 11:29:00 +0100 Subject: [PATCH 2/4] feat: update FundDistribution and PausePaymentRequest models --- pcp_serversdk_python/models/FundDistribution.py | 15 +++++++-------- .../models/PausePaymentRequest.py | 7 +------ tests/endpoints/test_PaymentExecutionApiClient.py | 9 +++++---- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/pcp_serversdk_python/models/FundDistribution.py b/pcp_serversdk_python/models/FundDistribution.py index 1b5f6a8..9c4a89b 100644 --- a/pcp_serversdk_python/models/FundDistribution.py +++ b/pcp_serversdk_python/models/FundDistribution.py @@ -1,7 +1,6 @@ from dataclasses import dataclass from typing import Optional -from .AmountOfMoney import AmountOfMoney from .FundDistributionType import FundDistributionType @@ -10,13 +9,13 @@ class FundDistribution: """Instructions for distributing funds to multiple sellers/partners in a marketplace context.""" accountId: str - """Account ID of the seller/partner to receive the funds.""" + """Unique identifier of the beneficiary (seller/partner/sub-account) to receive funds.""" - amount: AmountOfMoney - """Amount of money to distribute.""" + amount: int + """Amount in cents and always having 2 decimals, in the currency of the original transaction.""" type: FundDistributionType - """Type of fund distribution. + """Classification or purpose of the fund distribution to the receiving account within a given order. - `SELLER_REVENUE` - `COMMISSION_FEE` - `SHIPPING_COSTS` @@ -28,10 +27,10 @@ class FundDistribution: """Unique identifier of the fund distribution entry. Read-only UUID.""" description: Optional[str] = None - """Description of the fund distribution entry.""" + """Human-readable description for reconciliation. Appears on reports.""" merchantReference: Optional[str] = None - """Merchant reference for the fund distribution.""" + """Unique reference of the part of the fund/payment to be distributed.""" merchantParameters: Optional[str] = None - """Merchant specific parameters for the fund distribution.""" + """Additional parameters for the transaction in JSON format.""" diff --git a/pcp_serversdk_python/models/PausePaymentRequest.py b/pcp_serversdk_python/models/PausePaymentRequest.py index 2841300..39a278a 100644 --- a/pcp_serversdk_python/models/PausePaymentRequest.py +++ b/pcp_serversdk_python/models/PausePaymentRequest.py @@ -1,11 +1,6 @@ from dataclasses import dataclass -from .RefreshType import RefreshType - @dataclass(kw_only=True) class PausePaymentRequest: - """Request to refresh the payment status of a specific payment.""" - - refreshType: RefreshType - """Type of refresh action to be performed.""" + """Request to pause a payment for a specific payment method.""" diff --git a/tests/endpoints/test_PaymentExecutionApiClient.py b/tests/endpoints/test_PaymentExecutionApiClient.py index 7055384..dae69d7 100644 --- a/tests/endpoints/test_PaymentExecutionApiClient.py +++ b/tests/endpoints/test_PaymentExecutionApiClient.py @@ -23,6 +23,7 @@ PaymentExecution, PaymentExecutionRequest, RefreshPaymentRequest, + RefreshType, RefundPaymentResponse, RefundRequest, ) @@ -176,7 +177,7 @@ async def test_pause_payment(payment_execution_api_client, mock_httpx_client): "commerce_case_id", "checkout_id", "payment_execution_id", - PausePaymentRequest(refreshType=None), + PausePaymentRequest(), ) assert response == expected_response @@ -198,7 +199,7 @@ async def test_refresh_payment(payment_execution_api_client, mock_httpx_client): "commerce_case_id", "checkout_id", "payment_execution_id", - RefreshPaymentRequest(refreshType=None), + RefreshPaymentRequest(refreshType=RefreshType.PAYMENT_EVENTS), ) assert response == expected_response @@ -213,7 +214,7 @@ async def test_pause_payment_with_invalid_payment_execution_id( "commerce_case_id", "checkout_id", "", - PausePaymentRequest(refreshType=None), + PausePaymentRequest(), ) @@ -227,7 +228,7 @@ async def test_refresh_payment_with_invalid_payment_execution_id( "commerce_case_id", "checkout_id", "", - RefreshPaymentRequest(refreshType=None), + RefreshPaymentRequest(refreshType=RefreshType.PAYMENT_EVENTS), ) From 78d8effdaa69e3bb3153b3679d8ddd399b24dbb0 Mon Sep 17 00:00:00 2001 From: Dirk Ehrhardt Date: Fri, 20 Feb 2026 11:29:07 +0100 Subject: [PATCH 3/4] refactor: simplify IntegrationType enum definition in PaymentProduct302SpecificInput --- .../models/PaymentProduct302SpecificInput.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py b/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py index 09c16a2..9de423a 100644 --- a/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py +++ b/pcp_serversdk_python/models/PaymentProduct302SpecificInput.py @@ -1,18 +1,16 @@ from dataclasses import dataclass -from enum import Enum, auto +from enum import Enum from typing import Optional from .ApplePaymentDataTokenInformation import ApplePaymentDataTokenInformation from .MobilePaymentNetwork import MobilePaymentNetwork -class IntegrationType(Enum): +class IntegrationType(str, Enum): """Type of Apple Pay integration.""" - MERCHANT_CERTIFICATE = ( - auto() - ) # using your own certificate (paid Apple Pay account needed) - MASS_ENABLEMENT = auto() # using PAYONE certificate + MERCHANT_CERTIFICATE = "MERCHANT_CERTIFICATE" # using your own certificate (paid Apple Pay account needed) + MASS_ENABLEMENT = "MASS_ENABLEMENT" # using PAYONE certificate @dataclass(kw_only=True) From e6f8404f19864ed9b082b2cac644cc59131c6f78 Mon Sep 17 00:00:00 2001 From: Dirk Ehrhardt Date: Fri, 20 Feb 2026 11:34:07 +0100 Subject: [PATCH 4/4] refactor: remove Network enum and update references to MobilePaymentNetwork --- pcp_serversdk_python/models/Network.py | 10 ---------- pcp_serversdk_python/models/__init__.py | 6 ++---- tests/transformer/test_ApplepayTransformer.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 pcp_serversdk_python/models/Network.py diff --git a/pcp_serversdk_python/models/Network.py b/pcp_serversdk_python/models/Network.py deleted file mode 100644 index bd00fdc..0000000 --- a/pcp_serversdk_python/models/Network.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class Network(str, Enum): - MASTERCARD = "MASTERCARD" - VISA = "VISA" - AMEX = "AMEX" - GIROCARD = "GIROCARD" - DISCOVER = "DISCOVER" - JCB = "JCB" diff --git a/pcp_serversdk_python/models/__init__.py b/pcp_serversdk_python/models/__init__.py index 4b3c95e..3d5aac6 100644 --- a/pcp_serversdk_python/models/__init__.py +++ b/pcp_serversdk_python/models/__init__.py @@ -45,11 +45,11 @@ from .CompleteFinancingPaymentMethodSpecificInput import ( CompleteFinancingPaymentMethodSpecificInput, ) +from .CompleteOrderRequest import CompleteOrderRequest +from .CompletePaymentMethodSpecificInput import CompletePaymentMethodSpecificInput from .CompletePaymentProduct840SpecificInput import ( CompletePaymentProduct840SpecificInput, ) -from .CompleteOrderRequest import CompleteOrderRequest -from .CompletePaymentMethodSpecificInput import CompletePaymentMethodSpecificInput from .CompletePaymentRequest import CompletePaymentRequest from .CompletePaymentResponse import CompletePaymentResponse from .CompleteRedirectPaymentMethodSpecificInput import ( @@ -85,7 +85,6 @@ from .MobilePaymentMethodSpecificOutput import MobilePaymentMethodSpecificOutput from .MobilePaymentNetwork import MobilePaymentNetwork from .MobilePaymentThreeDSecure import MobilePaymentThreeDSecure -from .Network import Network from .Order import Order from .OrderItem import OrderItem from .OrderLineDetailsInput import OrderLineDetailsInput @@ -257,7 +256,6 @@ "MobilePaymentMethodSpecificOutput", "MobilePaymentNetwork", "MobilePaymentThreeDSecure", - "Network", "Order", "OrderItem", "OrderLineDetailsInput", diff --git a/tests/transformer/test_ApplepayTransformer.py b/tests/transformer/test_ApplepayTransformer.py index ca78bb4..a267ade 100644 --- a/tests/transformer/test_ApplepayTransformer.py +++ b/tests/transformer/test_ApplepayTransformer.py @@ -6,7 +6,7 @@ ApplePaymentTokenVersion, ApplePayPayment, MobilePaymentMethodSpecificInput, - Network, + MobilePaymentNetwork, PaymentProduct302SpecificInput, ) from pcp_serversdk_python.transformer.ApplepayTransformer import ( @@ -17,12 +17,12 @@ def test_network_from_string(): - assert network_from_string("mastercard") == Network.MASTERCARD - assert network_from_string("VISA") == Network.VISA - assert network_from_string("AmEx") == Network.AMEX - assert network_from_string("GIROCARD") == Network.GIROCARD - assert network_from_string("discover") == Network.DISCOVER - assert network_from_string("JCB") == Network.JCB + assert network_from_string("mastercard") == MobilePaymentNetwork.MASTERCARD + assert network_from_string("VISA") == MobilePaymentNetwork.VISA + assert network_from_string("AmEx") == MobilePaymentNetwork.AMEX + assert network_from_string("GIROCARD") == MobilePaymentNetwork.GIROCARD + assert network_from_string("discover") == MobilePaymentNetwork.DISCOVER + assert network_from_string("JCB") == MobilePaymentNetwork.JCB with pytest.raises(TypeError): network_from_string("UNKNOWN") @@ -57,7 +57,7 @@ def test_transform_apple_pay_payment_to_mobile_payment_method_specific_input(): publicKeyHash="publicKeyHash123", ephemeralKey="ephemeralPublicKey123", paymentProduct302SpecificInput=PaymentProduct302SpecificInput( - network=Network.VISA, + network=MobilePaymentNetwork.VISA, token=ApplePaymentDataTokenInformation( version=ApplePaymentTokenVersion.EC_V1, signature="signature123",