Skip to content

chore(ad-hoc): move models to top-level folder and decouple repository requests - #553

Merged
andrii-vysotskyi-cko merged 5 commits into
masterfrom
refactor/models-structure
Nov 24, 2026
Merged

andrii-vysotskyi-cko merged 5 commits into
masterfrom
refactor/models-structure

Conversation

@andrii-vysotskyi-cko

Copy link
Copy Markdown
Collaborator

Summary

  • Models folder: public PO* models moved from Repositories/* and Services/* into Models/<Concept>/. NativeAlternativePayments is split into Requests/, Responses/ and Legacy/. Internal wire types stay next to their repository. File moves only.
  • Repository requests: authorizeInvoice and assignCustomerToken now take internal InvoiceAuthorizationRequest / AssignCustomerTokenRequest, so web authentication properties no longer reach repositories. Public types, service logic and encoded request bodies are unchanged.
  • Fix: POAssignCustomerTokenRequest.localeIdentifier is no longer encoded into the JSON body; it's still sent as a header, like the other requests.

Public PO* models now live in Models/<Concept>/ instead of being split
between Repositories and Services depending on who uses them. Internal
wire types stay next to the repository or service that uses them.

File moves only, no code changes.
…uest body

The locale is already sent as a header; it was also being encoded into the JSON body as locale_identifier.
… and token assignment

Invoices and customer tokens repositories now take internal InvoiceAuthorizationRequest
and AssignCustomerTokenRequest instead of the public PO* requests, so web authentication
properties no longer reach the repository layer. Public request types are unchanged and
encoded request bodies are identical.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the model reorganization and separation of service requests from repository payloads.

No open issues 🎉

What changed in this PR

This PR reorganizes the ProcessOut SDK’s public models by concept and separates service-facing requests from repository payloads, keeping web authentication settings out of repositories.

Changes:

  • Moves public models into Models/, with native alternative payments grouped into requests, responses, and legacy types.
  • Adds internal invoice authorization and customer token assignment requests, service mappings, and generated coding keys.
  • Excludes customer token assignment locale information from JSON while preserving header-based delivery.

Paths below are relative to Sources/ProcessOut/Sources/.

File Description
Services/​Invoices/​DefaultInvoicesService.swift Maps public authorization requests to internal requests.
Services/​CustomerTokens/​DefaultCustomerTokensService.swift Maps public token assignment requests to internal requests.
Repositories/​Shared/​Extensions/​POPaginationOptions+QueryItems.swift Keeps pagination query conversion in the repository layer.
Repositories/​Invoices/​Requests/​InvoiceAuthorizationRequest.swift Adds the internal authorization payload.
Repositories/​Invoices/​InvoicesRepository.swift Accepts the internal authorization request.
Repositories/​Invoices/​HttpInvoicesRepository.swift Uses the internal authorization request for HTTP calls.
Repositories/​CustomerTokens/​Requests/​AssignCustomerTokenRequest.swift Adds the internal token assignment payload.
Repositories/​CustomerTokens/​HttpCustomerTokensRepository.swift Uses the internal token assignment request.
Repositories/​CustomerTokens/​CustomerTokensRepository.swift Updates the token assignment contract.
Models/​Transactions/​POTransactionStatus.swift Relocates transaction status definitions.
Models/​Transactions/​POTransaction.swift Relocates transaction details.
Models/​Shared/​POPaginationOptions.swift Relocates public pagination options.
Models/​Shared/​POImageRemoteResource.swift Relocates shared image resource models.
Models/​Shared/​POBillingAddressCollectionMode.swift Relocates billing address collection modes.
Models/​Shared/​POBarcode.swift Relocates the shared barcode model.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentUrlResolutionResponseV2.swift Groups URL resolution responses under models.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentTokenizationResponseV2.swift Groups tokenization responses under models.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentStateV2.swift Relocates payment state definitions.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentRedirectV2.swift Relocates redirect response details.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentMethodV2.swift Relocates payment method details.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentInvoiceV2.swift Relocates payment invoice details.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentInstructionsGroupV2.swift Relocates grouped customer instructions.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentFormV2.swift Relocates payment forms and parameter definitions.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentElementV2.swift Relocates payment display elements.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentCustomerInstructionV2.swift Relocates customer instruction models.
Models/​NativeAlternativePayments/​Responses/​PONativeAlternativePaymentAuthorizationResponseV2.swift Groups authorization responses under models.
Models/​NativeAlternativePayments/​Requests/​PONativeAlternativePaymentUrlResolutionRequestV2.swift Groups URL resolution requests under models.
Models/​NativeAlternativePayments/​Requests/​PONativeAlternativePaymentTokenizationRequestV2.swift Groups tokenization requests under models.
Models/​NativeAlternativePayments/​Requests/​PONativeAlternativePaymentSubmitDataV2.swift Relocates submitted payment parameter models.
Models/​NativeAlternativePayments/​Requests/​PONativeAlternativePaymentRedirectResultV2.swift Relocates redirect result payloads.
Models/​NativeAlternativePayments/​Requests/​PONativeAlternativePaymentConfigurationV2.swift Relocates payment configuration models.
Models/​NativeAlternativePayments/​Requests/​PONativeAlternativePaymentAuthorizationRequestV2.swift Groups authorization requests under models.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodTransactionDetailsRequest.swift Groups legacy transaction detail requests.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodTransactionDetails.swift Groups legacy transaction details.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodState.swift Groups legacy payment states.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodResponse.swift Groups legacy payment responses.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodRequest.swift Groups legacy payment requests.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodParameterValues.swift Groups legacy payment parameter values.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentMethodParameter.swift Groups legacy payment parameter definitions.
Models/​NativeAlternativePayments/​Legacy/​PONativeAlternativePaymentCaptureRequest.swift Groups legacy capture requests.
Models/​Invoices/​POInvoiceRequest.swift Relocates invoice retrieval requests.
Models/​Invoices/​POInvoiceCreationRequest.swift Relocates invoice creation requests.
Models/​Invoices/​POInvoiceAuthorizationResponse.swift Relocates public authorization responses.
Models/​Invoices/​POInvoiceAuthorizationRequest.swift Relocates public authorization requests.
Models/​Invoices/​POInvoiceAuthorizationOutcome.swift Relocates authorization outcomes.
Models/​Invoices/​POInvoice.swift Relocates the invoice model.
Models/​GatewayConfigurations/​POGatewayConfiguration.swift Relocates gateway configuration details.
Models/​GatewayConfigurations/​POFindGatewayConfigurationRequest.swift Relocates gateway lookup requests.
Models/​GatewayConfigurations/​POAllGatewayConfigurationsResponse.swift Relocates gateway listing responses.
Models/​GatewayConfigurations/​POAllGatewayConfigurationsRequest.swift Relocates gateway listing requests.
Models/​Failure/​POFailureCode+Namespace.swift Relocates failure code namespaces.
Models/​Failure/​POFailureCode.swift Relocates failure code definitions.
Models/​Failure/​POFailure+Legacy.swift Relocates legacy failure compatibility types.
Models/​Failure/​POFailure.swift Relocates the public failure model.
Models/​DynamicCheckout/​POStringDecodableMerchantCapability.swift Relocates merchant capability serialization.
Models/​DynamicCheckout/​PODynamicCheckoutPaymentMethod.swift Relocates checkout payment method models.
Models/​DynamicCheckout/​POCodablePassKitPaymentNetworks.swift Relocates payment network serialization.
Models/​DeepLinking/​PODeepLinkReceivedEvent.swift Relocates the deep-link event model.
Models/​CustomerTokens/​PODeleteCustomerTokenRequest.swift Relocates token deletion requests.
Models/​CustomerTokens/​POCustomerTokenType.swift Relocates customer token types.
Models/​CustomerTokens/​POCustomerTokenDeletedEvent.swift Relocates token deletion events.
Models/​CustomerTokens/​POCustomerToken.swift Relocates customer token details.
Models/​CustomerTokens/​POCreateCustomerTokenRequest.swift Relocates token creation requests.
Models/​CustomerTokens/​POAssignCustomerTokenRequest.swift Excludes locale information from JSON encoding.
Models/​Customers/​POCustomerCreationRequest.swift Relocates customer creation requests.
Models/​Customers/​POCustomer.swift Relocates the customer model.
Models/​CustomerActions/​PO3DSRedirect.swift Relocates legacy 3DS redirect details.
Models/​CustomerActions/​PO3DS2ConfigurationCardScheme.swift Relocates legacy 3DS2 card scheme definitions.
Models/​CustomerActions/​PO3DS2Configuration.swift Relocates 3DS2 configuration models.
Models/​CustomerActions/​PO3DS2ChallengeResult.swift Relocates 3DS2 challenge results.
Models/​CustomerActions/​PO3DS2ChallengeParameters.swift Relocates 3DS2 challenge parameters.
Models/​CustomerActions/​PO3DS2AuthenticationRequestParameters.swift Relocates 3DS2 authentication parameters.
Models/​Cards/​POContact.swift Relocates cardholder contact details.
Models/​Cards/​POCardUpdateRequest.swift Relocates card update requests.
Models/​Cards/​POCardTokenizationRequest.swift Relocates card tokenization requests.
Models/​Cards/​POCardScheme.swift Relocates card scheme definitions.
Models/​Cards/​POCardIssuerInformation.swift Relocates card issuer details.
Models/​Cards/​POCardCvcCheck.swift Relocates CVC verification statuses.
Models/​Cards/​POCard.swift Relocates the card model.
Models/​Cards/​POApplePayTokenizationRequest.swift Relocates Apple Pay tokenization requests.
Models/​Cards/​POApplePayCardTokenizationRequest.swift Relocates Apple Pay payment tokenization models.
Models/​AlternativePayments/​POAlternativePaymentTokenizationRequest.swift Relocates alternative payment tokenization requests.
Models/​AlternativePayments/​POAlternativePaymentResponse.swift Relocates alternative payment responses.
Models/​AlternativePayments/​POAlternativePaymentMethodResponse.swift Relocates legacy alternative payment responses.
Models/​AlternativePayments/​POAlternativePaymentMethodRequest.swift Relocates legacy alternative payment requests.
Models/​AlternativePayments/​POAlternativePaymentAuthorizationRequest.swift Relocates alternative payment authorization requests.
Models/​AlternativePayments/​POAlternativePaymentAuthenticationRequest.swift Relocates alternative payment authentication requests.
Generated/​Sourcery+Generated.swift Adds coding keys for both internal request types.

Review effort: Balanced

@andrii-vysotskyi-cko
andrii-vysotskyi-cko merged commit b7ddaa4 into master Nov 24, 2026
5 checks passed
@andrii-vysotskyi-cko
andrii-vysotskyi-cko deleted the refactor/models-structure branch November 25, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants