Repository: VictorAvelar/mollie-api-go
Pull request #326 (2024-03-01 17:54:20)

check payments resources against api reference.
<!--- Provide a general summary of your changes in the Title above -->

# Description

Ensures resources for payments are accurate representations of the API definition. 

A notable difference from `v3` is that now separate types exist for operations that are considered actions (create, update) and read operations (get, list).

It also includes a new `IncludeValue` common type to refer to query values that affect the content of the response, similar to the existing `EmbedValue`.

## Motivation and context

Ensures we keep accurate compatibility between the library and the api reference.

## How has this been tested?

Please describe in detail how you tested your changes.

Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

- [x] Unit tests added / updated
- [x] The tests run on docker (using `make test`)
- [ ] The required `test data` has been added / updated

If you are running the tests locally, please specify:

- OS: macos
- Go version 1.22.x

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] This change requires a documentation update

## Checklist

Go over all the following points, and put an `x` in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your [tests and code style pass](https://help.github.com/articles/about-required-status-checks/).

- [x] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [x] My pull request addresses exactly one patch/feature.
- [x] I have created a branch for this patch/feature.
- [x] Each individual commit in the pull request is meaningful.
- [x] If my change requires a change to the documentation, I have updated it accordingly.

<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->



Patch:
diff --git a/docs/README.md b/docs/README.md
index 6ae5cf9..748164c 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -20,6 +20,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 
 - [Constants](<#constants>)
 - [func CheckResponse\(r \*Response\) error](<#CheckResponse>)
+- [type AccessTokenPaymentFields](<#AccessTokenPaymentFields>)
 - [type Address](<#Address>)
 - [type Amount](<#Amount>)
 - [type ApplePaymentSession](<#ApplePaymentSession>)
@@ -54,6 +55,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type BusinessCategory](<#BusinessCategory>)
 - [type Capture](<#Capture>)
 - [type CaptureLinks](<#CaptureLinks>)
+- [type CaptureMode](<#CaptureMode>)
 - [type CapturesList](<#CapturesList>)
 - [type CapturesService](<#CapturesService>)
   - [func \(cs \*CapturesService\) Get\(ctx context.Context, payment, capture string\) \(res \*Response, c \*Capture, err error\)](<#CapturesService.Get>)
@@ -96,6 +98,11 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
   - [func \(c \*Config\) ToggleTesting\(\) bool](<#Config.ToggleTesting>)
 - [type ContextValue](<#ContextValue>)
 - [type ContextValues](<#ContextValues>)
+- [type CreateMollieConnectPaymentFields](<#CreateMollieConnectPaymentFields>)
+- [type CreatePayment](<#CreatePayment>)
+- [type CreatePaymentAccessTokenFields](<#CreatePaymentAccessTokenFields>)
+- [type CreatePreAuthorizedPaymentFields](<#CreatePreAuthorizedPaymentFields>)
+- [type CreateRecurrentPaymentFields](<#CreateRecurrentPaymentFields>)
 - [type CreateShipmentRequest](<#CreateShipmentRequest>)
 - [type Customer](<#Customer>)
 - [type CustomerLinks](<#CustomerLinks>)
@@ -103,7 +110,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type CustomersListOptions](<#CustomersListOptions>)
 - [type CustomersService](<#CustomersService>)
   - [func \(cs \*CustomersService\) Create\(ctx context.Context, c Customer\) \(res \*Response, cc \*Customer, err error\)](<#CustomersService.Create>)
-  - [func \(cs \*CustomersService\) CreatePayment\(ctx context.Context, id string, p Payment\) \(res \*Response, pp \*Payment, err error\)](<#CustomersService.CreatePayment>)
+  - [func \(cs \*CustomersService\) CreatePayment\(ctx context.Context, id string, p CreatePayment\) \(res \*Response, pp \*Payment, err error\)](<#CustomersService.CreatePayment>)
   - [func \(cs \*CustomersService\) Delete\(ctx context.Context, id string\) \(res \*Response, err error\)](<#CustomersService.Delete>)
   - [func \(cs \*CustomersService\) Get\(ctx context.Context, id string\) \(res \*Response, c \*Customer, err error\)](<#CustomersService.Get>)
   - [func \(cs \*CustomersService\) GetPayments\(ctx context.Context, id string, options \*CustomersListOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#CustomersService.GetPayments>)
@@ -121,6 +128,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type GiftCardIssuerStatus](<#GiftCardIssuerStatus>)
 - [type GiftCardLinks](<#GiftCardLinks>)
 - [type Image](<#Image>)
+- [type IncludeValue](<#IncludeValue>)
 - [type Invoice](<#Invoice>)
 - [type InvoiceLinks](<#InvoiceLinks>)
 - [type InvoiceStatus](<#InvoiceStatus>)
@@ -149,6 +157,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type MiscellaneousService](<#MiscellaneousService>)
   - [func \(ms \*MiscellaneousService\) ApplePaymentSession\(ctx context.Context, asr \*ApplePaymentSessionRequest\) \(res \*Response, aps \*ApplePaymentSession, err error\)](<#MiscellaneousService.ApplePaymentSession>)
 - [type Mode](<#Mode>)
+- [type MollieConnectPaymentFields](<#MollieConnectPaymentFields>)
 - [type Onboarding](<#Onboarding>)
 - [type OnboardingData](<#OnboardingData>)
 - [type OnboardingDataOrganization](<#OnboardingDataOrganization>)
@@ -206,6 +215,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
   - [func \(ps \*PartnerService\) List\(ctx context.Context, opts \*ListPartnerClientsOptions\) \(res \*Response, pc \*PartnerClientList, err error\)](<#PartnerService.List>)
 - [type PartnerType](<#PartnerType>)
 - [type Payment](<#Payment>)
+- [type PaymentDestination](<#PaymentDestination>)
 - [type PaymentDetails](<#PaymentDetails>)
 - [type PaymentDetailsAddress](<#PaymentDetailsAddress>)
 - [type PaymentLink](<#PaymentLink>)
@@ -231,12 +241,13 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
   - [func \(ms \*PaymentMethodsService\) Get\(ctx context.Context, id PaymentMethod, options \*PaymentMethodOptions\) \(res \*Response, pmd \*PaymentMethodDetails, err error\)](<#PaymentMethodsService.Get>)
   - [func \(ms \*PaymentMethodsService\) List\(ctx context.Context, options \*PaymentMethodsListOptions\) \(res \*Response, pm \*PaymentMethodsList, err error\)](<#PaymentMethodsService.List>)
 - [type PaymentOptions](<#PaymentOptions>)
+- [type PaymentRouting](<#PaymentRouting>)
 - [type PaymentsService](<#PaymentsService>)
   - [func \(ps \*PaymentsService\) Cancel\(ctx context.Context, id string\) \(res \*Response, p \*Payment, err error\)](<#PaymentsService.Cancel>)
-  - [func \(ps \*PaymentsService\) Create\(ctx context.Context, p Payment, opts \*PaymentOptions\) \(res \*Response, np \*Payment, err error\)](<#PaymentsService.Create>)
+  - [func \(ps \*PaymentsService\) Create\(ctx context.Context, p CreatePayment, opts \*PaymentOptions\) \(res \*Response, np \*Payment, err error\)](<#PaymentsService.Create>)
   - [func \(ps \*PaymentsService\) Get\(ctx context.Context, id string, opts \*PaymentOptions\) \(res \*Response, p \*Payment, err error\)](<#PaymentsService.Get>)
   - [func \(ps \*PaymentsService\) List\(ctx context.Context, opts \*ListPaymentOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#PaymentsService.List>)
-  - [func \(ps \*PaymentsService\) Update\(ctx context.Context, id string, up Payment\) \(res \*Response, p \*Payment, err error\)](<#PaymentsService.Update>)
+  - [func \(ps \*PaymentsService\) Update\(ctx context.Context, id string, up UpdatePayment\) \(res \*Response, p \*Payment, err error\)](<#PaymentsService.Update>)
 - [type Permission](<#Permission>)
 - [type PermissionGrant](<#PermissionGrant>)
 - [type PermissionLinks](<#PermissionLinks>)
@@ -245,6 +256,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
   - [func \(ps \*PermissionsService\) Get\(ctx context.Context, id PermissionGrant\) \(res \*Response, p \*Permission, err error\)](<#PermissionsService.Get>)
   - [func \(ps \*PermissionsService\) List\(ctx context.Context\) \(res \*Response, pl \*PermissionsList, err error\)](<#PermissionsService.List>)
 - [type PhoneNumber](<#PhoneNumber>)
+- [type PreAuthorizedPaymentFields](<#PreAuthorizedPaymentFields>)
 - [type ProductType](<#ProductType>)
 - [type Profile](<#Profile>)
 - [type ProfileLinks](<#ProfileLinks>)
@@ -266,6 +278,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
   - [func \(ps \*ProfilesService\) Update\(ctx context.Context, id string, up \*Profile\) \(res \*Response, p \*Profile, err error\)](<#ProfilesService.Update>)
 - [type QRCode](<#QRCode>)
 - [type Rate](<#Rate>)
+- [type RecurrentPaymentFields](<#RecurrentPaymentFields>)
 - [type Refund](<#Refund>)
 - [type RefundLinks](<#RefundLinks>)
 - [type RefundList](<#RefundList>)
@@ -334,6 +347,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type TransferDestination](<#TransferDestination>)
 - [type TransferFrequency](<#TransferFrequency>)
 - [type URL](<#URL>)
+- [type UpdatePayment](<#UpdatePayment>)
 - [type UsedGiftCard](<#UsedGiftCard>)
 - [type UserAgentToken](<#UserAgentToken>)
 
@@ -365,6 +379,17 @@ func CheckResponse(r *Response) error
 
 CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body.
 
+<a name="AccessTokenPaymentFields"></a>
+## type [AccessTokenPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L224-L226>)
+
+AccessTokenPaymentFields describes the fields specific to payments created using an access token.
+
+```go
+type AccessTokenPaymentFields struct {
+    Testmode bool `json:"testmode,omitempty"`
+}
+```
+
 <a name="Address"></a>
 ## type [Address](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L23-L32>)
 
@@ -961,7 +986,7 @@ const (
 ```
 
 <a name="Capture"></a>
-## type [Capture](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L24-L35>)
+## type [Capture](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L33-L44>)
 
 Capture describes a single capture. Captures are used for payments that have the authorize\-then\-capture flow.
 
@@ -981,7 +1006,7 @@ type Capture struct {
 ```
 
 <a name="CaptureLinks"></a>
-## type [CaptureLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L14-L20>)
+## type [CaptureLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L23-L29>)
 
 CaptureLinks contains relevant links for a capture object.
 
@@ -995,8 +1020,26 @@ type CaptureLinks struct {
 }
 ```
 
+<a name="CaptureMode"></a>
+## type [CaptureMode](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L11>)
+
+CaptureMode describes the mode of a capture.
+
+```go
+type CaptureMode string
+```
+
+<a name="AutomaticCapture"></a>CaptureMode possible values.
+
+```go
+const (
+    AutomaticCapture CaptureMode = "automatic"
+    ManualCapture    CaptureMode = "manual"
+)
+```
+
 <a name="CapturesList"></a>
-## type [CapturesList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L38-L44>)
+## type [CapturesList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L47-L53>)
 
 CapturesList describes a list of captures.
 
@@ -1011,7 +1054,7 @@ type CapturesList struct {
 ```
 
 <a name="CapturesService"></a>
-## type [CapturesService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L11>)
+## type [CapturesService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L20>)
 
 CapturesService operates over captures resource.
 
@@ -1020,7 +1063,7 @@ type CapturesService service
 ```
 
 <a name="CapturesService.Get"></a>
-### func \(\*CapturesService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L50>)
+### func \(\*CapturesService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L59>)
 
 ```go
 func (cs *CapturesService) Get(ctx context.Context, payment, capture string) (res *Response, c *Capture, err error)
@@ -1031,7 +1074,7 @@ Get retrieves a single capture by its ID. Note the original payment’s ID is ne
 See: https://docs.mollie.com/reference/v2/captures-api/get-capture
 
 <a name="CapturesService.List"></a>
-### func \(\*CapturesService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L68>)
+### func \(\*CapturesService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/captures.go#L77>)
 
 ```go
 func (cs *CapturesService) List(ctx context.Context, payment string) (res *Response, cl *CapturesList, err error)
@@ -1667,6 +1710,111 @@ ContextValues is a map of TransactionType to ContextValue.
 type ContextValues map[TransactionType]ContextValue
 ```
 
+<a name="CreateMollieConnectPaymentFields"></a>
+## type [CreateMollieConnectPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L134-L137>)
+
+CreateMollieConnectPaymentFields describes the fields to be sent to the Mollie API when creating a new payment using Mollie Connect.
+
+See: https://docs.mollie.com/reference/v2/payments-api/create-payment#mollie-connect-parameters
+
+```go
+type CreateMollieConnectPaymentFields struct {
+    ApplicationFee *ApplicationFee   `json:"applicationFee,omitempty"`
+    Routing        []*PaymentRouting `json:"routing,omitempty"`
+}
+```
+
+<a name="CreatePayment"></a>
+## type [CreatePayment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L65-L100>)
+
+CreatePayment describes the payload to be sent to the Mollie API when creating or updating a new payment.
+
+Some fields are only valid for specific payment methods, and are documented in the Mollie API reference.
+
+See: https://docs.mollie.com/reference/v2/payments-api/create-payment#payment-method-specific-parameters
+
+```go
+type CreatePayment struct {
+    Description                     string          `json:"description,omitempty"`
+    RedirectURL                     string          `json:"redirectUrl,omitempty"`
+    CancelURL                       string          `json:"cancelUrl,omitempty"`
+    WebhookURL                      string          `json:"webhookUrl,omitempty"`
+    RestrictPaymentMethodsToCountry string          `json:"restrictPaymentMethodsToCountry,omitempty"`
+    Amount                          *Amount         `json:"amount,omitempty"`
+    Locale                          Locale          `json:"locale,omitempty"`
+    Method                          []PaymentMethod `json:"method,omitempty"`
+    Metadata                        any             `json:"metadata,omitempty"`
+
+    // PaymentMethods specific fields
+    DigitalGoods         bool       `json:"digitalGoods,omitempty"`
+    ApplePayPaymentToken string     `json:"applePayPaymentToken,omitempty"`
+    BillingEmail         string     `json:"billingEmail,omitempty"`
+    CardToken            string     `json:"cardToken,omitempty"`
+    VoucherNumber        string     `json:"voucherNumber,omitempty"`
+    VoucherPin           string     `json:"voucherPin,omitempty"`
+    Issuer               string     `json:"issuer,omitempty"`
+    ExtraMerchantData    string     `json:"extraMerchantData,omitempty"`
+    SessionID            string     `json:"sessionId,omitempty"`
+    CustomerReference    string     `json:"customerReference,omitempty"`
+    TerminalID           string     `json:"terminalId,omitempty"`
+    ConsumerName         string     `json:"consumerName,omitempty"`
+    ConsumerAccount      string     `json:"consumerAccount,omitempty"`
+    DueDate              *ShortDate `json:"dueDate,omitempty"`
+    ShippingAddress      *Address   `json:"shippingAddress,omitempty"`
+    BillingAddress       *Address   `json:"billingAddress,omitempty"`
+    Company              *Company   `json:"company,omitempty"`
+
+    // Other case specific fields
+    CreateRecurrentPaymentFields
+    CreatePreAuthorizedPaymentFields
+    CreatePaymentAccessTokenFields
+    CreateMollieConnectPaymentFields
+}
+```
+
+<a name="CreatePaymentAccessTokenFields"></a>
+## type [CreatePaymentAccessTokenFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L125-L128>)
+
+CreatePaymentAccessTokenFields describes the fields to be sent to the Mollie API when creating a new payment using an access token.
+
+See: https://docs.mollie.com/reference/v2/payments-api/create-payment#access-token-parameters
+
+```go
+type CreatePaymentAccessTokenFields struct {
+    ProfileID string `json:"profileId,omitempty"`
+    Testmode  bool   `json:"testmode,omitempty"`
+}
+```
+
+<a name="CreatePreAuthorizedPaymentFields"></a>
+## type [CreatePreAuthorizedPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L116-L119>)
+
+CreatePreAuthorizedPaymentFields describes the fields to be sent to the Mollie API when creating a new pre\-authorized payment.
+
+See: https://docs.mollie.com/reference/v2/payments-api/create-payment#parameters-for-pre-authorized-payments
+
+```go
+type CreatePreAuthorizedPaymentFields struct {
+    CaptureDelay string      `json:"captureDelay,omitempty"`
+    CaptureMode  CaptureMode `json:"captureMode,omitempty"`
+}
+```
+
+<a name="CreateRecurrentPaymentFields"></a>
+## type [CreateRecurrentPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L106-L110>)
+
+CreateRecurrentPaymentFields describes the fields to be sent to the Mollie API when creating a new recurrent payment.
+
+See: https://docs.mollie.com/reference/v2/payments-api/create-payment#parameters-for-recurring-payments
+
+```go
+type CreateRecurrentPaymentFields struct {
+    CustomerID   string       `json:"customerId,omitempty"`
+    MandateID    string       `json:"mandateId,omitempty"`
+    SequenceType SequenceType `json:"sequenceType,omitempty"`
+}
+```
+
 <a name="CreateShipmentRequest"></a>
 ## type [CreateShipmentRequest](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L61-L65>)
 
@@ -1769,7 +1917,7 @@ See: https://docs.mollie.com/reference/v2/customers-api/create-customer
 ### func \(\*CustomersService\) [CreatePayment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/customers.go#L173-L177>)
 
 ```go
-func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p Payment) (res *Response, pp *Payment, err error)
+func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p CreatePayment) (res *Response, pp *Payment, err error)
 ```
 
 CreatePayment creates a payment for the customer.
@@ -1857,7 +2005,7 @@ const (
 ```
 
 <a name="EmbedValue"></a>
-## type [EmbedValue](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L325>)
+## type [EmbedValue](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L334>)
 
 EmbedValue describes the valid value of embed query string.
 
@@ -1873,6 +2021,7 @@ const (
     EmbedRefund      EmbedValue = "refunds"
     EmbedShipments   EmbedValue = "shipments"
     EmbedChargebacks EmbedValue = "chargebacks"
+    EmbedCaptures    EmbedValue = "captures"
 )
 ```
 
@@ -2069,7 +2218,7 @@ type GiftCardLinks struct {
 ```
 
 <a name="Image"></a>
-## type [Image](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L342-L346>)
+## type [Image](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L352-L356>)
 
 Image describes a generic image resource retrieved by Mollie.
 
@@ -2081,6 +2230,24 @@ type Image struct {
 }
 ```
 
+<a name="IncludeValue"></a>
+## type [IncludeValue](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L325>)
+
+IncludeValue is a valid value for the Include query string parameter.
+
+```go
+type IncludeValue string
+```
+
+<a name="IncludeQrCode"></a>Supported Include values.
+
+```go
+const (
+    IncludeQrCode           IncludeValue = "details.qrCode"
+    IncludeRemainderDetails IncludeValue = "details.remainderDetails"
+)
+```
+
 <a name="Invoice"></a>
 ## type [Invoice](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/invoices.go#L20-L34>)
 
@@ -2222,17 +2389,17 @@ type ListPartnerClientsOptions struct {
 ```
 
 <a name="ListPaymentOptions"></a>
-## type [ListPaymentOptions](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L129-L135>)
+## type [ListPaymentOptions](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L257-L263>)
 
 ListPaymentOptions describes list payments endpoint valid query string parameters.
 
 ```go
 type ListPaymentOptions struct {
-    Limit     int    `url:"limit,omitempty"`
-    Include   string `url:"include,omitempty"`
-    Embed     string `url:"embed,omitempty"`
-    ProfileID string `url:"profileId,omitempty"`
-    From      string `url:"from,omitempty"`
+    Limit     int            `url:"limit,omitempty"`
+    Include   []IncludeValue `url:"include,omitempty"`
+    Embed     []EmbedValue   `url:"embed,omitempty"`
+    ProfileID string         `url:"profileId,omitempty"`
+    From      string         `url:"from,omitempty"`
 }
 ```
 
@@ -2499,6 +2666,17 @@ const (
 )
 ```
 
+<a name="MollieConnectPaymentFields"></a>
+## type [MollieConnectPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L219-L221>)
+
+MollieConnectPaymentFields describes the fields specific to Mollie Connect payments.
+
+```go
+type MollieConnectPaymentFields struct {
+    ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"`
+}
+```
+
 <a name="Onboarding"></a>
 ## type [Onboarding](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/onboarding.go#L33-L41>)
 
@@ -3218,7 +3396,7 @@ GetPartnerStatus retrieves details about the partner status of the currently aut
 See: https://docs.mollie.com/reference/v2/organizations-api/get-partner
 
 <a name="Owner"></a>
-## type [Owner](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L349-L354>)
+## type [Owner](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L359-L364>)
 
 Personal data of your customer.
 
@@ -3340,66 +3518,63 @@ const (
 ```
 
 <a name="Payment"></a>
-## type [Payment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L45-L100>)
+## type [Payment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L161-L201>)
 
 Payment describes a transaction between a customer and a merchant.
 
 ```go
 type Payment struct {
-    IsCancellable                   bool                   `json:"isCancellable,omitempty"`
-    TestMode                        bool                   `json:"testmode,omitempty"`
-    DigitalGoods                    bool                   `json:"digitalGoods,omitempty"`
-    ApplePayPaymentToken            string                 `json:"applePayPaymentToken,omitempty"`
-    BillingEmail                    string                 `json:"billingEmail,omitempty"`
-    CardToken                       string                 `json:"cardToken,omitempty"`
-    Issuer                          string                 `json:"issuer,omitempty"`
-    VoucherNumber                   string                 `json:"voucherNumber,omitempty"`
-    VoucherPin                      string                 `json:"voucherPin,omitempty"`
-    ExtraMerchantData               string                 `json:"extraMerchantData,omitempty"`
-    SessionID                       string                 `json:"sessionId,omitempty"`
-    CustomerReference               string                 `json:"customerReference,omitempty"`
-    ConsumerName                    string                 `json:"consumerName,omitempty"`
-    ConsumerAccount                 string                 `json:"consumerAccount,omitempty"`
-    WebhookURL                      string                 `json:"webhookUrl,omitempty"`
-    Resource                        string                 `json:"resource,omitempty"`
-    ID                              string                 `json:"id,omitempty"`
-    MandateID                       string                 `json:"mandateId,omitempty"`
-    OrderID                         string                 `json:"orderId,omitempty"`
-    ProfileID                       string                 `json:"profileId,omitempty"`
-    SettlementID                    string                 `json:"settlementId,omitempty"`
-    CustomerID                      string                 `json:"customerId,omitempty"`
-    Status                          string                 `json:"status,omitempty"`
-    Description                     string                 `json:"description,omitempty"`
-    RedirectURL                     string                 `json:"redirectUrl,omitempty"`
-    CountryCode                     string                 `json:"countryCode,omitempty"`
-    SubscriptionID                  string                 `json:"subscriptionId,omitempty"`
-    CancelURL                       string                 `json:"cancelUrl,omitempty"`
-    Metadata                        interface{}            `json:"metadata,omitempty"`
-    Amount                          *Amount                `json:"amount,omitempty"`
-    AmountRefunded                  *Amount                `json:"amountRefunded,omitempty"`
-    AmountRemaining                 *Amount                `json:"amountRemaining,omitempty"`
-    AmountCaptured                  *Amount                `json:"amountCaptured,omitempty"`
-    AmountChargedBack               *Amount                `json:"amountChargedBack,omitempty"`
-    SettlementAmount                *Amount                `json:"settlementAmount,omitempty"`
-    ApplicationFee                  *ApplicationFee        `json:"applicationFee,omitempty"`
-    Details                         *PaymentDetails        `json:"details,omitempty"`
-    CreatedAt                       *time.Time             `json:"createdAt,omitempty"`
-    AuthorizedAt                    *time.Time             `json:"authorizedAt,omitempty"`
-    PaidAt                          *time.Time             `json:"paidAt,omitempty"`
-    CanceledAt                      *time.Time             `json:"canceledAt,omitempty"`
-    ExpiresAt                       *time.Time             `json:"expiresAt,omitempty"`
-    ExpiredAt                       *time.Time             `json:"expiredAt,omitempty"`
-    FailedAt                        *time.Time             `json:"failedAt,omitempty"`
-    DueDate                         *ShortDate             `json:"dueDate,omitempty"`
-    BillingAddress                  *Address               `json:"billingAddress,omitempty"`
-    ShippingAddress                 *PaymentDetailsAddress `json:"shippingAddress,omitempty"`
-    Mode                            Mode                   `json:"mode,omitempty"`
-    Locale                          Locale                 `json:"locale,omitempty"`
-    RestrictPaymentMethodsToCountry Locale                 `json:"restrictPaymentMethodsToCountry,omitempty"`
-    Method                          PaymentMethod          `json:"method,omitempty"`
-    Links                           PaymentLinks           `json:"_links,omitempty"`
-    SequenceType                    SequenceType           `json:"sequenceType,omitempty"`
-    Company                         Company                `json:"company,omitempty"`
+    Resource                        string        `json:"resource,omitempty"`
+    ID                              string        `json:"id,omitempty"`
+    Status                          string        `json:"status,omitempty"`
+    Description                     string        `json:"description,omitempty"`
+    CancelURL                       string        `json:"cancelUrl,omitempty"`
+    WebhookURL                      string        `json:"webhookUrl,omitempty"`
+    CountryCode                     string        `json:"countryCode,omitempty"`
+    RestrictPaymentMethodsToCountry string        `json:"restrictPaymentMethodsToCountry,omitempty"`
+    ProfileID                       string        `json:"profileId,omitempty"`
+    SettlementID                    string        `json:"settlementId,omitempty"`
+    OrderID                         string        `json:"orderId,omitempty"`
+    IsCancelable                    bool          `json:"isCancelable,omitempty"`
+    Mode                            Mode          `json:"mode,omitempty"`
+    Locale                          Locale        `json:"locale,omitempty"`
+    Method                          PaymentMethod `json:"method,omitempty"`
+    Metadata                        any           `json:"metadata,omitempty"`
+    Links                           PaymentLinks  `json:"_links,omitempty"`
+    CreatedAt                       *time.Time    `json:"createdAt,omitempty"`
+    AuthorizedAt                    *time.Time    `json:"authorizedAt,omitempty"`
+    PaidAt                          *time.Time    `json:"paidAt,omitempty"`
+    CanceledAt                      *time.Time    `json:"canceledAt,omitempty"`
+    ExpiresAt                       *time.Time    `json:"expiresAt,omitempty"`
+    ExpiredAt                       *time.Time    `json:"expiredAt,omitempty"`
+    FailedAt                        *time.Time    `json:"failedAt,omitempty"`
+    Amount                          *Amount       `json:"amount,omitempty"`
+    AmountRefunded                  *Amount       `json:"amountRefunded,omitempty"`
+    AmountRemaining                 *Amount       `json:"amountRemaining,omitempty"`
+    AmountCaptured                  *Amount       `json:"amountCaptured,omitempty"`
+    AmountChargedBack               *Amount       `json:"amountChargeback,omitempty"`
+    SettlementAmount                *Amount       `json:"settlementAmount,omitempty"`
+
+    // PaymentMethods specific fields
+    Details PaymentDetails `json:"details,omitempty"`
+
+    // Other case specific fields
+    RecurrentPaymentFields
+    PreAuthorizedPaymentFields
+    MollieConnectPaymentFields
+    AccessTokenPaymentFields
+}
+```
+
+<a name="PaymentDestination"></a>
+## type [PaymentDestination](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L53-L56>)
+
+PaymentDestination describes the destination of a payment.
+
+```go
+type PaymentDestination struct {
+    Kind           string `json:"type,omitempty"`
+    OrganizationID string `json:"organizationId,omitempty"`
 }
 ```
 
@@ -3533,7 +3708,7 @@ type PaymentLinkOptions struct {
 ```
 
 <a name="PaymentLinks"></a>
-## type [PaymentLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L104-L118>)
+## type [PaymentLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L230-L246>)
 
 PaymentLinks describes all the possible links to be returned with a payment object.
 
@@ -3552,6 +3727,8 @@ type PaymentLinks struct {
     Customer           *URL `json:"customer,omitempty"`
     Order              *URL `json:"order,omitempty"`
     Dashboard          *URL `json:"dashboard,omitempty"`
+    MobileAppCheckout  *URL `json:"mobileAppCheckout,omitempty"`
+    Terminal           *URL `json:"terminal,omitempty"`
 }
 ```
 
@@ -3613,7 +3790,7 @@ List retrieves all payments links created with the current website profile, orde
 See: https://docs.mollie.com/reference/v2/payment-links-api/list-payment-links
 
 <a name="PaymentList"></a>
-## type [PaymentList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L215-L221>)
+## type [PaymentList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L347-L353>)
 
 PaymentList describes how a list of payments will be retrieved by Mollie.
 
@@ -3643,6 +3820,7 @@ const (
     Bancontact     PaymentMethod = "bancontact"
     BankTransfer   PaymentMethod = "banktransfer"
     Belfius        PaymentMethod = "belfius"
+    CBC            PaymentMethod = "cbc"
     CreditCard     PaymentMethod = "creditcard"
     DirectDebit    PaymentMethod = "directdebit"
     EPS            PaymentMethod = "eps"
@@ -3822,7 +4000,7 @@ The results are not paginated.
 See: https://docs.mollie.com/reference/v2/methods-api/list-methods
 
 <a name="PaymentOptions"></a>
-## type [PaymentOptions](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L123-L126>)
+## type [PaymentOptions](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L251-L254>)
 
 PaymentOptions describes payments endpoint valid query string parameters.
 
@@ -3830,13 +4008,26 @@ See: https://docs.mollie.com/reference/v2/payments-api/get-payment
 
 ```go
 type PaymentOptions struct {
-    Include string `url:"include,omitempty"`
-    Embed   string `url:"embed,omitempty"`
+    Include []IncludeValue `url:"include,omitempty"`
+    Embed   []EmbedValue   `url:"embed,omitempty"`
+}
+```
+
+<a name="PaymentRouting"></a>
+## type [PaymentRouting](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L46-L50>)
+
+PaymentRouting describes the routing of a payment.
+
+```go
+type PaymentRouting struct {
+    Destination PaymentDestination `json:"destination,omitempty"`
+    Amount      *Amount            `json:"amount,omitempty"`
+    ReleaseDate *ShortDate         `json:"releaseDate,omitempty"`
 }
 ```
 
 <a name="PaymentsService"></a>
-## type [PaymentsService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L138>)
+## type [PaymentsService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L266>)
 
 PaymentsService instance operates over payment resources.
 
@@ -3845,7 +4036,7 @@ type PaymentsService service
 ```
 
 <a name="PaymentsService.Cancel"></a>
-### func \(\*PaymentsService\) [Cancel](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L185>)
+### func \(\*PaymentsService\) [Cancel](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L313>)
 
 ```go
 func (ps *PaymentsService) Cancel(ctx context.Context, id string) (res *Response, p *Payment, err error)
@@ -3856,10 +4047,10 @@ Cancel removes a payment \(if possible\) from your Mollie account.
 See: https://docs.mollie.com/reference/v2/payments-api/cancel-payment
 
 <a name="PaymentsService.Create"></a>
-### func \(\*PaymentsService\) [Create](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L161-L165>)
+### func \(\*PaymentsService\) [Create](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L289-L293>)
 
 ```go
-func (ps *PaymentsService) Create(ctx context.Context, p Payment, opts *PaymentOptions) (res *Response, np *Payment, err error)
+func (ps *PaymentsService) Create(ctx context.Context, p CreatePayment, opts *PaymentOptions) (res *Response, np *Payment, err error)
 ```
 
 Create stores a new payment object attached to your Mollie account.
@@ -3867,7 +4058,7 @@ Create stores a new payment object attached to your Mollie account.
 See: https://docs.mollie.com/reference/v2/payments-api/create-payment#
 
 <a name="PaymentsService.Get"></a>
-### func \(\*PaymentsService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L141-L145>)
+### func \(\*PaymentsService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L269-L273>)
 
 ```go
 func (ps *PaymentsService) Get(ctx context.Context, id string, opts *PaymentOptions) (res *Response, p *Payment, err error)
@@ -3876,7 +4067,7 @@ func (ps *PaymentsService) Get(ctx context.Context, id string, opts *PaymentOpti
 Get retrieves a single payment object by its payment token.
 
 <a name="PaymentsService.List"></a>
-### func \(\*PaymentsService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L226-L230>)
+### func \(\*PaymentsService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L358-L362>)
 
 ```go
 func (ps *PaymentsService) List(ctx context.Context, opts *ListPaymentOptions) (res *Response, pl *PaymentList, err error)
@@ -3887,15 +4078,15 @@ List retrieves a list of payments associated with your account/organization.
 See: https://docs.mollie.com/reference/v2/payments-api/list-payments
 
 <a name="PaymentsService.Update"></a>
-### func \(\*PaymentsService\) [Update](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L201>)
+### func \(\*PaymentsService\) [Update](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L329-L333>)
 
 ```go
-func (ps *PaymentsService) Update(ctx context.Context, id string, up Payment) (res *Response, p *Payment, err error)
+func (ps *PaymentsService) Update(ctx context.Context, id string, up UpdatePayment) (res *Response, p *Payment, err error)
 ```
 
 Update can be used to update some details of a created payment.
 
-See: https://docs.mollie.com/reference/v2/payments-api/update-payment#
+See: https://docs.mollie.com/reference/v2/payments-api/update-payment
 
 <a name="Permission"></a>
 ## type [Permission](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/permissions.go#L39-L45>)
@@ -4016,6 +4207,19 @@ PhoneNumber represents a phone number in the E.164 format.
 type PhoneNumber string
 ```
 
+<a name="PreAuthorizedPaymentFields"></a>
+## type [PreAuthorizedPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L212-L216>)
+
+PreAuthorizedPaymentFields describes the fields specific to pre\-authorized payments.
+
+```go
+type PreAuthorizedPaymentFields struct {
+    CaptureDelay  string      `json:"captureDelay,omitempty"`
+    CaptureMode   CaptureMode `json:"captureMode,omitempty"`
+    CaptureBefore *time.Time  `json:"captureBefore,omitempty"`
+}
+```
+
 <a name="ProductType"></a>
 ## type [ProductType](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/orders.go#L208>)
 
@@ -4265,7 +4469,7 @@ type QRCode struct {
 ```
 
 <a name="Rate"></a>
-## type [Rate](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L336-L339>)
+## type [Rate](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L346-L349>)
 
 Rate describes service rates, further divided into fixed and percentage costs.
 
@@ -4276,6 +4480,20 @@ type Rate struct {
 }
 ```
 
+<a name="RecurrentPaymentFields"></a>
+## type [RecurrentPaymentFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L204-L209>)
+
+RecurrentPaymentFields describes the fields specific to recurrent payments.
+
+```go
+type RecurrentPaymentFields struct {
+    SequenceType   SequenceType `json:"sequenceType,omitempty"`
+    CustomerID     string       `json:"customerId,omitempty"`
+    MandateID      string       `json:"mandateId,omitempty"`
+    SubscriptionID string       `json:"subscriptionId,omitempty"`
+}
+```
+
 <a name="Refund"></a>
 ## type [Refund](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/refunds.go#L11-L26>)
 
@@ -4439,7 +4657,7 @@ type Response struct {
 ```
 
 <a name="SequenceType"></a>
-## type [SequenceType](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L35>)
+## type [SequenceType](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L36>)
 
 SequenceType indicates which type of payment this is in a recurring sequence.
 
@@ -5212,6 +5430,31 @@ type URL struct {
 }
 ```
 
+<a name="UpdatePayment"></a>
+## type [UpdatePayment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payments.go#L144-L158>)
+
+UpdatePayment describes the payload to be sent to the Mollie API when updating a payment.
+
+See: https://docs.mollie.com/reference/v2/payments-api/update-payment See: https://docs.mollie.com/reference/v2/payments-api/update-payment#payment-method-specific-parameters
+
+```go
+type UpdatePayment struct {
+    Description                     string        `json:"description,omitempty"`
+    RedirectURL                     string        `json:"redirectUrl,omitempty"`
+    CancelURL                       string        `json:"cancelUrl,omitempty"`
+    WebhookURL                      string        `json:"webhookUrl,omitempty"`
+    Metadata                        any           `json:"metadata,omitempty"`
+    Method                          PaymentMethod `json:"method,omitempty"`
+    Locale                          Locale        `json:"locale,omitempty"`
+    RestrictPaymentMethodsToCountry string        `json:"restrictPaymentMethodsToCountry,omitempty"`
+
+    // PaymentMethods specific fields
+    BillingEmail string     `json:"billingEmail,omitempty"`
+    DueDate      *ShortDate `json:"dueDate,omitempty"`
+    Issuer       string     `json:"issuer,omitempty"`
+}
+```
+
 <a name="UsedGiftCard"></a>
 ## type [UsedGiftCard](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/payment_details.go#L49-L53>)
 
diff --git a/docs/v4-upgrade.md b/docs/v4-upgrade.md
new file mode 100644
index 0000000..72153fe
--- /dev/null
+++ b/docs/v4-upgrade.md
@@ -0,0 +1,21 @@
+# Notable changes included in v4
+
+## Breaking changes
+
+- `idempotency` package has moved from the `mollie` directory to the `pkg` directory.
+- `pagination` package has moved from the`mollie` directory to the `pkg` directory.
+- `connect` package has moved from the `mollie` directory to the `pkg` directory.
+- root namespace is not `github.com/VictorAvelar/mollie-api-go/v4/`.
+- Changes for payments resource
+  - Added `CreatePayment` type to use when creating a payment.
+  - Added `UpdatePayment` type to use when updating a payment.
+  - Ensured `Payment` object (used for read operations) contains all the available fields.
+  - Created types specific for fields that are conditional given the payment values, both to create new payments and to list existing payments.
+
+## Other changes
+
+- `testify.Suite` was removed from all testing.
+- Improvements for devcontainer files
+- Major versions of multiple github actions updated
+- Base `Dockerfile` using Go 1.22.x
+- Tests related to payments were update to use the new types.
diff --git a/mollie/captures.go b/mollie/captures.go
index d069c45..ea690e5 100644
--- a/mollie/captures.go
+++ b/mollie/captures.go
@@ -7,6 +7,15 @@ import (
 	"time"
 )
 
+// CaptureMode describes the mode of a capture.
+type CaptureMode string
+
+// CaptureMode possible values.
+const (
+	AutomaticCapture CaptureMode = "automatic"
+	ManualCapture    CaptureMode = "manual"
+)
+
 // CapturesService operates over captures resource.
 type CapturesService service
 
diff --git a/mollie/common_types.go b/mollie/common_types.go
index e990df6..9d797ca 100644
--- a/mollie/common_types.go
+++ b/mollie/common_types.go
@@ -321,6 +321,15 @@ const (
 	TestMode Mode = "test"
 )
 
+// IncludeValue is a valid value for the Include query string parameter.
+type IncludeValue string
+
+// Supported Include values.
+const (
+	IncludeQrCode           IncludeValue = "details.qrCode"
+	IncludeRemainderDetails IncludeValue = "details.remainderDetails"
+)
+
 // EmbedValue describes the valid value of embed query string.
 type EmbedValue string
 
@@ -330,6 +339,7 @@ const (
 	EmbedRefund      EmbedValue = "refunds"
 	EmbedShipments   EmbedValue = "shipments"
 	EmbedChargebacks EmbedValue = "chargebacks"
+	EmbedCaptures    EmbedValue = "captures"
 )
 
 // Rate describes service rates, further divided into fixed and percentage costs.
diff --git a/mollie/customers.go b/mollie/customers.go
index 72fae6c..486aa37 100644
--- a/mollie/customers.go
+++ b/mollie/customers.go
@@ -170,7 +170,7 @@ func (cs *CustomersService) GetPayments(ctx context.Context, id string, options
 // CreatePayment creates a payment for the customer.
 //
 // See: https://docs.mollie.com/reference/v2/customers-api/create-customer-payment
-func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p Payment) (
+func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p CreatePayment) (
 	res *Response,
 	pp *Payment,
 	err error,
diff --git a/mollie/payments.go b/mollie/payments.go
index 7ca57ff..67af858 100644
--- a/mollie/payments.go
+++ b/mollie/payments.go
@@ -15,6 +15,7 @@ const (
 	Bancontact     PaymentMethod = "bancontact"
 	BankTransfer   PaymentMethod = "banktransfer"
 	Belfius        PaymentMethod = "belfius"
+	CBC            PaymentMethod = "cbc"
 	CreditCard     PaymentMethod = "creditcard"
 	DirectDebit    PaymentMethod = "directdebit"
 	EPS            PaymentMethod = "eps"
@@ -41,62 +42,187 @@ const (
 	RecurringSequence SequenceType = "recurring"
 )
 
+// PaymentRouting describes the routing of a payment.
+type PaymentRouting struct {
+	Destination PaymentDestination `json:"destination,omitempty"`
+	Amount      *Amount            `json:"amount,omitempty"`
+	ReleaseDate *ShortDate         `json:"releaseDate,omitempty"`
+}
+
+// PaymentDestination describes the destination of a payment.
+type PaymentDestination struct {
+	Kind           string `json:"type,omitempty"`
+	OrganizationID string `json:"organizationId,omitempty"`
+}
+
+// CreatePayment describes the payload to be sent to the Mollie API when
+// creating or updating a new payment.
+//
+// Some fields are only valid for specific payment methods, and are
+// documented in the Mollie API reference.
+//
+// See: https://docs.mollie.com/reference/v2/payments-api/create-payment#payment-method-specific-parameters
+type CreatePayment struct {
+	Description                     string          `json:"description,omitempty"`
+	RedirectURL                     string          `json:"redirectUrl,omitempty"`
+	CancelURL                       string          `json:"cancelUrl,omitempty"`
+	WebhookURL                      string          `json:"webhookUrl,omitempty"`
+	RestrictPaymentMethodsToCountry string          `json:"restrictPaymentMethodsToCountry,omitempty"`
+	Amount                          *Amount         `json:"amount,omitempty"`
+	Locale                          Locale          `json:"locale,omitempty"`
+	Method                          []PaymentMethod `json:"method,omitempty"`
+	Metadata                        any             `json:"metadata,omitempty"`
+
+	// PaymentMethods specific fields
+	DigitalGoods         bool       `json:"digitalGoods,omitempty"`
+	ApplePayPaymentToken string     `json:"applePayPaymentToken,omitempty"`
+	BillingEmail         string     `json:"billingEmail,omitempty"`
+	CardToken            string     `json:"cardToken,omitempty"`
+	VoucherNumber        string     `json:"voucherNumber,omitempty"`
+	VoucherPin           string     `json:"voucherPin,omitempty"`
+	Issuer               string     `json:"issuer,omitempty"`
+	ExtraMerchantData    string     `json:"extraMerchantData,omitempty"`
+	SessionID            string     `json:"sessionId,omitempty"`
+	CustomerReference    string     `json:"customerReference,omitempty"`
+	TerminalID           string     `json:"terminalId,omitempty"`
+	ConsumerName         string     `json:"consumerName,omitempty"`
+	ConsumerAccount      string     `json:"consumerAccount,omitempty"`
+	DueDate              *ShortDate `json:"dueDate,omitempty"`
+	ShippingAddress      *Address   `json:"shippingAddress,omitempty"`
+	BillingAddress       *Address   `json:"billingAddress,omitempty"`
+	Company              *Company   `json:"company,omitempty"`
+
+	// Other case specific fields
+	CreateRecurrentPaymentFields
+	CreatePreAuthorizedPaymentFields
+	CreatePaymentAccessTokenFields
+	CreateMollieConnectPaymentFields
+}
+
+// CreateRecurrentPaymentFields describes the fields to be sent to the Mollie API when
+// creating a new recurrent payment.
+//
+// See: https://docs.mollie.com/reference/v2/payments-api/create-payment#parameters-for-recurring-payments
+type CreateRecurrentPaymentFields struct {
+	CustomerID   string       `json:"customerId,omitempty"`
+	MandateID    string       `json:"mandateId,omitempty"`
+	SequenceType SequenceType `json:"sequenceType,omitempty"`
+}
+
+// CreatePreAuthorizedPaymentFields describes the fields to be sent to the Mollie API when
+// creating a new pre-authorized payment.
+//
+// See: https://docs.mollie.com/reference/v2/payments-api/create-payment#parameters-for-pre-authorized-payments
+type CreatePreAuthorizedPaymentFields struct {
+	CaptureDelay string      `json:"captureDelay,omitempty"`
+	CaptureMode  CaptureMode `json:"captureMode,omitempty"`
+}
+
+// CreatePaymentAccessTokenFields describes the fields to be sent to the Mollie API when
+// creating a new payment using an access token.
+//
+// See: https://docs.mollie.com/reference/v2/payments-api/create-payment#access-token-parameters
+type CreatePaymentAccessTokenFields struct {
+	ProfileID string `json:"profileId,omitempty"`
+	Testmode  bool   `json:"testmode,omitempty"`
+}
+
+// CreateMollieConnectPaymentFields describes the fields to be sent to the Mollie API when
+// creating a new payment using Mollie Connect.
+//
+// See: https://docs.mollie.com/reference/v2/payments-api/create-payment#mollie-connect-parameters
+type CreateMollieConnectPaymentFields struct {
+	ApplicationFee *ApplicationFee   `json:"applicationFee,omitempty"`
+	Routing        []*PaymentRouting `json:"routing,omitempty"`
+}
+
+// UpdatePayment describes the payload to be sent to the Mollie API when
+// updating a payment.
+//
+// See: https://docs.mollie.com/reference/v2/payments-api/update-payment
+// See: https://docs.mollie.com/reference/v2/payments-api/update-payment#payment-method-specific-parameters
+type UpdatePayment struct {
+	Description                     string        `json:"description,omitempty"`
+	RedirectURL                     string        `json:"redirectUrl,omitempty"`
+	CancelURL                       string        `json:"cancelUrl,omitempty"`
+	WebhookURL                      string        `json:"webhookUrl,omitempty"`
+	Metadata                        any           `json:"metadata,omitempty"`
+	Method                          PaymentMethod `json:"method,omitempty"`
+	Locale                          Locale        `json:"locale,omitempty"`
+	RestrictPaymentMethodsToCountry string        `json:"restrictPaymentMethodsToCountry,omitempty"`
+
+	// PaymentMethods specific fields
+	BillingEmail string     `json:"billingEmail,omitempty"`
+	DueDate      *ShortDate `json:"dueDate,omitempty"`
+	Issuer       string     `json:"issuer,omitempty"`
+}
+
 // Payment describes a transaction between a customer and a merchant.
 type Payment struct {
-	IsCancellable                   bool                   `json:"isCancellable,omitempty"`
-	TestMode                        bool                   `json:"testmode,omitempty"`
-	DigitalGoods                    bool                   `json:"digitalGoods,omitempty"`
-	ApplePayPaymentToken            string                 `json:"applePayPaymentToken,omitempty"`
-	BillingEmail                    string                 `json:"billingEmail,omitempty"`
-	CardToken                       string                 `json:"cardToken,omitempty"`
-	Issuer                          string                 `json:"issuer,omitempty"`
-	VoucherNumber                   string                 `json:"voucherNumber,omitempty"`
-	VoucherPin                      string                 `json:"voucherPin,omitempty"`
-	ExtraMerchantData               string                 `json:"extraMerchantData,omitempty"`
-	SessionID                       string                 `json:"sessionId,omitempty"`
-	CustomerReference               string                 `json:"customerReference,omitempty"`
-	ConsumerName                    string                 `json:"consumerName,omitempty"`
-	ConsumerAccount                 string                 `json:"consumerAccount,omitempty"`
-	WebhookURL                      string                 `json:"webhookUrl,omitempty"`
-	Resource                        string                 `json:"resource,omitempty"`
-	ID                              string                 `json:"id,omitempty"`
-	MandateID                       string                 `json:"mandateId,omitempty"`
-	OrderID                         string                 `json:"orderId,omitempty"`
-	ProfileID                       string                 `json:"profileId,omitempty"`
-	SettlementID                    string                 `json:"settlementId,omitempty"`
-	CustomerID                      string                 `json:"customerId,omitempty"`
-	Status                          string                 `json:"status,omitempty"`
-	Description                     string                 `json:"description,omitempty"`
-	RedirectURL                     string                 `json:"redirectUrl,omitempty"`
-	CountryCode                     string                 `json:"countryCode,omitempty"`
-	SubscriptionID                  string                 `json:"subscriptionId,omitempty"`
-	CancelURL                       string                 `json:"cancelUrl,omitempty"`
-	Metadata                        interface{}            `json:"metadata,omitempty"`
-	Amount                          *Amount                `json:"amount,omitempty"`
-	AmountRefunded                  *Amount                `json:"amountRefunded,omitempty"`
-	AmountRemaining                 *Amount                `json:"amountRemaining,omitempty"`
-	AmountCaptured                  *Amount                `json:"amountCaptured,omitempty"`
-	AmountChargedBack               *Amount                `json:"amountChargedBack,omitempty"`
-	SettlementAmount                *Amount                `json:"settlementAmount,omitempty"`
-	ApplicationFee                  *ApplicationFee        `json:"applicationFee,omitempty"`
-	Details                         *PaymentDetails        `json:"details,omitempty"`
-	CreatedAt                       *time.Time             `json:"createdAt,omitempty"`
-	AuthorizedAt                    *time.Time             `json:"authorizedAt,omitempty"`
-	PaidAt                          *time.Time             `json:"paidAt,omitempty"`
-	CanceledAt                      *time.Time             `json:"canceledAt,omitempty"`
-	ExpiresAt                       *time.Time             `json:"expiresAt,omitempty"`
-	ExpiredAt                       *time.Time             `json:"expiredAt,omitempty"`
-	FailedAt                        *time.Time             `json:"failedAt,omitempty"`
-	DueDate                         *ShortDate             `json:"dueDate,omitempty"`
-	BillingAddress                  *Address               `json:"billingAddress,omitempty"`
-	ShippingAddress                 *PaymentDetailsAddress `json:"shippingAddress,omitempty"`
-	Mode                            Mode                   `json:"mode,omitempty"`
-	Locale                          Locale                 `json:"locale,omitempty"`
-	RestrictPaymentMethodsToCountry Locale                 `json:"restrictPaymentMethodsToCountry,omitempty"`
-	Method                          PaymentMethod          `json:"method,omitempty"`
-	Links                           PaymentLinks           `json:"_links,omitempty"`
-	SequenceType                    SequenceType           `json:"sequenceType,omitempty"`
-	Company                         Company                `json:"company,omitempty"`
+	Resource                        string        `json:"resource,omitempty"`
+	ID                              string        `json:"id,omitempty"`
+	Status                          string        `json:"status,omitempty"`
+	Description                     string        `json:"description,omitempty"`
+	CancelURL                       string        `json:"cancelUrl,omitempty"`
+	WebhookURL                      string        `json:"webhookUrl,omitempty"`
+	CountryCode                     string        `json:"countryCode,omitempty"`
+	RestrictPaymentMethodsToCountry string        `json:"restrictPaymentMethodsToCountry,omitempty"`
+	ProfileID                       string        `json:"profileId,omitempty"`
+	SettlementID                    string        `json:"settlementId,omitempty"`
+	OrderID                         string        `json:"orderId,omitempty"`
+	IsCancelable                    bool          `json:"isCancelable,omitempty"`
+	Mode                            Mode          `json:"mode,omitempty"`
+	Locale                          Locale        `json:"locale,omitempty"`
+	Method                          PaymentMethod `json:"method,omitempty"`
+	Metadata                        any           `json:"metadata,omitempty"`
+	Links                           PaymentLinks  `json:"_links,omitempty"`
+	CreatedAt                       *time.Time    `json:"createdAt,omitempty"`
+	AuthorizedAt                    *time.Time    `json:"authorizedAt,omitempty"`
+	PaidAt                          *time.Time    `json:"paidAt,omitempty"`
+	CanceledAt                      *time.Time    `json:"canceledAt,omitempty"`
+	ExpiresAt                       *time.Time    `json:"expiresAt,omitempty"`
+	ExpiredAt                       *time.Time    `json:"expiredAt,omitempty"`
+	FailedAt                        *time.Time    `json:"failedAt,omitempty"`
+	Amount                          *Amount       `json:"amount,omitempty"`
+	AmountRefunded                  *Amount       `json:"amountRefunded,omitempty"`
+	AmountRemaining                 *Amount       `json:"amountRemaining,omitempty"`
+	AmountCaptured                  *Amount       `json:"amountCaptured,omitempty"`
+	AmountChargedBack               *Amount       `json:"amountChargeback,omitempty"`
+	SettlementAmount                *Amount       `json:"settlementAmount,omitempty"`
+
+	// PaymentMethods specific fields
+	Details PaymentDetails `json:"details,omitempty"`
+
+	// Other case specific fields
+	RecurrentPaymentFields
+	PreAuthorizedPaymentFields
+	MollieConnectPaymentFields
+	AccessTokenPaymentFields
+}
+
+// RecurrentPaymentFields describes the fields specific to recurrent payments.
+type RecurrentPaymentFields struct {
+	SequenceType   SequenceType `json:"sequenceType,omitempty"`
+	CustomerID     string       `json:"customerId,omitempty"`
+	MandateID      string       `json:"mandateId,omitempty"`
+	SubscriptionID string       `json:"subscriptionId,omitempty"`
+}
+
+// PreAuthorizedPaymentFields describes the fields specific to pre-authorized payments.
+type PreAuthorizedPaymentFields struct {
+	CaptureDelay  string      `json:"captureDelay,omitempty"`
+	CaptureMode   CaptureMode `json:"captureMode,omitempty"`
+	CaptureBefore *time.Time  `json:"captureBefore,omitempty"`
+}
+
+// MollieConnectPaymentFields describes the fields specific to Mollie Connect payments.
+type MollieConnectPaymentFields struct {
+	ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"`
+}
+
+// AccessTokenPaymentFields describes the fields specific to payments created using an access token.
+type AccessTokenPaymentFields struct {
+	Testmode bool `json:"testmode,omitempty"`
 }
 
 // PaymentLinks describes all the possible links to be returned with
@@ -115,23 +241,25 @@ type PaymentLinks struct {
 	Customer           *URL `json:"customer,omitempty"`
 	Order              *URL `json:"order,omitempty"`
 	Dashboard          *URL `json:"dashboard,omitempty"`
+	MobileAppCheckout  *URL `json:"mobileAppCheckout,omitempty"`
+	Terminal           *URL `json:"terminal,omitempty"`
 }
 
 // PaymentOptions describes payments endpoint valid query string parameters.
 //
 // See: https://docs.mollie.com/reference/v2/payments-api/get-payment
 type PaymentOptions struct {
-	Include string `url:"include,omitempty"`
-	Embed   string `url:"embed,omitempty"`
+	Include []IncludeValue `url:"include,omitempty"`
+	Embed   []EmbedValue   `url:"embed,omitempty"`
 }
 
 // ListPaymentOptions describes list payments endpoint valid query string parameters.
 type ListPaymentOptions struct {
-	Limit     int    `url:"limit,omitempty"`
-	Include   string `url:"include,omitempty"`
-	Embed     string `url:"embed,omitempty"`
-	ProfileID string `url:"profileId,omitempty"`
-	From      string `url:"from,omitempty"`
+	Limit     int            `url:"limit,omitempty"`
+	Include   []IncludeValue `url:"include,omitempty"`
+	Embed     []EmbedValue   `url:"embed,omitempty"`
+	ProfileID string         `url:"profileId,omitempty"`
+	From      string         `url:"from,omitempty"`
 }
 
 // PaymentsService instance operates over payment resources.
@@ -158,13 +286,13 @@ func (ps *PaymentsService) Get(ctx context.Context, id string, opts *PaymentOpti
 // Create stores a new payment object attached to your Mollie account.
 //
 // See: https://docs.mollie.com/reference/v2/payments-api/create-payment#
-func (ps *PaymentsService) Create(ctx context.Context, p Payment, opts *PaymentOptions) (
+func (ps *PaymentsService) Create(ctx context.Context, p CreatePayment, opts *PaymentOptions) (
 	res *Response,
 	np *Payment,
 	err error,
 ) {
 	if ps.client.HasAccessToken() && ps.client.config.testing {
-		p.TestMode = true
+		p.Testmode = true
 	}
 
 	res, err = ps.client.post(ctx, "v2/payments", p, opts)
@@ -197,8 +325,12 @@ func (ps *PaymentsService) Cancel(ctx context.Context, id string) (res *Response
 
 // Update can be used to update some details of a created payment.
 //
-// See: https://docs.mollie.com/reference/v2/payments-api/update-payment#
-func (ps *PaymentsService) Update(ctx context.Context, id string, up Payment) (res *Response, p *Payment, err error) {
+// See: https://docs.mollie.com/reference/v2/payments-api/update-payment
+func (ps *PaymentsService) Update(ctx context.Context, id string, up UpdatePayment) (
+	res *Response,
+	p *Payment,
+	err error,
+) {
 	res, err = ps.client.patch(ctx, fmt.Sprintf("v2/payments/%s", id), up, nil)
 	if err != nil {
 		return


Test patch:
diff --git a/mollie/customers_test.go b/mollie/customers_test.go
index e97a647..9863ab2 100644
--- a/mollie/customers_test.go
+++ b/mollie/customers_test.go
@@ -621,7 +621,7 @@ func TestCustomerService_CreatePayment(t *testing.T) {
 	type args struct {
 		ctx      context.Context
 		customer string
-		payment  Payment
+		payment  CreatePayment
 	}
 
 	cases := []struct {
@@ -637,7 +637,11 @@ func TestCustomerService_CreatePayment(t *testing.T) {
 			args{
 				context.Background(),
 				"cst_kEn1PlbGa",
-				Payment{TestMode: true},
+				CreatePayment{
+					CreatePaymentAccessTokenFields: CreatePaymentAccessTokenFields{
+						Testmode: true,
+					},
+				},
 			},
 			false,
 			nil,
@@ -657,7 +661,11 @@ func TestCustomerService_CreatePayment(t *testing.T) {
 			args{
 				context.Background(),
 				"cst_kEn1PlbGa",
-				Payment{TestMode: true},
+				CreatePayment{
+					CreatePaymentAccessTokenFields: CreatePaymentAccessTokenFields{
+						Testmode: true,
+					},
+				},
 			},
 			true,
 			fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."),
@@ -669,7 +677,11 @@ func TestCustomerService_CreatePayment(t *testing.T) {
 			args{
 				context.Background(),
 				"cst_kEn1PlbGa",
-				Payment{TestMode: true},
+				CreatePayment{
+					CreatePaymentAccessTokenFields: CreatePaymentAccessTokenFields{
+						Testmode: true,
+					},
+				},
 			},
 			true,
 			fmt.Errorf("invalid character 'h' looking for beginning of object key string"),
@@ -681,7 +693,11 @@ func TestCustomerService_CreatePayment(t *testing.T) {
 			args{
 				context.Background(),
 				"cst_kEn1PlbGa",
-				Payment{TestMode: true},
+				CreatePayment{
+					CreatePaymentAccessTokenFields: CreatePaymentAccessTokenFields{
+						Testmode: true,
+					},
+				},
 			},
 			true,
 			errBadBaseURL,
diff --git a/mollie/payments_test.go b/mollie/payments_test.go
index 6c8a77c..7e911d6 100644
--- a/mollie/payments_test.go
+++ b/mollie/payments_test.go
@@ -33,7 +33,7 @@ func TestPaymentsService_Get(t *testing.T) {
 				context.Background(),
 				"tr_WDqYK6vllg",
 				&PaymentOptions{
-					Include: "settlements",
+					Include: []IncludeValue{IncludeQrCode},
 				},
 			},
 			false,
@@ -42,7 +42,7 @@ func TestPaymentsService_Get(t *testing.T) {
 			func(w http.ResponseWriter, r *http.Request) {
 				testHeader(t, r, AuthHeader, "Bearer token_X12b31ggg23")
 				testMethod(t, r, "GET")
-				testQuery(t, r, "include=settlements")
+				testQuery(t, r, "include=details.qrCode")
 
 				if _, ok := r.Header[AuthHeader]; !ok {
 					w.WriteHeader(http.StatusUnauthorized)
@@ -209,7 +209,7 @@ func TestPaymentsService_Create(t *testing.T) {
 
 	type args struct {
 		ctx     context.Context
-		payment Payment
+		payment CreatePayment
 		options *PaymentOptions
 	}
 	cases := []struct {
@@ -224,11 +224,11 @@ func TestPaymentsService_Create(t *testing.T) {
 			"create payments works as expected.",
 			args{
 				context.Background(),
-				Payment{
+				CreatePayment{
 					BillingEmail: "test@example.com",
 				},
 				&PaymentOptions{
-					Include: "settlements",
+					Include: []IncludeValue{},
 				},
 			},
 			false,
@@ -237,7 +237,6 @@ func TestPaymentsService_Create(t *testing.T) {
 			func(w http.ResponseWriter, r *http.Request) {
 				testHeader(t, r, AuthHeader, "Bearer token_X12b31ggg23")
 				testMethod(t, r, "POST")
-				testQuery(t, r, "include=settlements")
 
 				if _, ok := r.Header[AuthHeader]; !ok {
 					w.WriteHeader(http.StatusUnauthorized)
@@ -249,11 +248,11 @@ func TestPaymentsService_Create(t *testing.T) {
 			"create payments with access token works as expected.",
 			args{
 				context.Background(),
-				Payment{
+				CreatePayment{
 					BillingEmail: "test@example.com",
 				},
 				&PaymentOptions{
-					Include: "settlements",
+					Include: []IncludeValue{},
 				},
 			},
 			false,
@@ -262,7 +261,7 @@ func TestPaymentsService_Create(t *testing.T) {
 			func(w http.ResponseWriter, r *http.Request) {
 				testHeader(t, r, AuthHeader, "Bearer access_token_test")
 				testMethod(t, r, "POST")
-				testQuery(t, r, "include=settlements&testmode=true")
+				testQuery(t, r, "testmode=true")
 
 				if _, ok := r.Header[AuthHeader]; !ok {
 					w.WriteHeader(http.StatusUnauthorized)
@@ -274,7 +273,7 @@ func TestPaymentsService_Create(t *testing.T) {
 			"create payments, an error is returned from the server",
 			args{
 				context.Background(),
-				Payment{},
+				CreatePayment{},
 				nil,
 			},
 			true,
@@ -286,7 +285,7 @@ func TestPaymentsService_Create(t *testing.T) {
 			"create payments, an error occurs when parsing json",
 			args{
 				context.Background(),
-				Payment{},
+				CreatePayment{},
 				nil,
 			},
 			true,
@@ -298,7 +297,7 @@ func TestPaymentsService_Create(t *testing.T) {
 			"create payments, invalid url when building request",
 			args{
 				context.Background(),
-				Payment{},
+				CreatePayment{},
 				nil,
 			},
 			true,
@@ -336,7 +335,7 @@ func TestPaymentsService_Update(t *testing.T) {
 	type args struct {
 		ctx     context.Context
 		id      string
-		payment Payment
+		payment UpdatePayment
 	}
 	cases := []struct {
 		name    string
@@ -351,7 +350,7 @@ func TestPaymentsService_Update(t *testing.T) {
 			args{
 				context.Background(),
 				"tr_WDqYK6vllg",
-				Payment{
+				UpdatePayment{
 					BillingEmail: "test@example.com",
 				},
 			},
@@ -373,7 +372,7 @@ func TestPaymentsService_Update(t *testing.T) {
 			args{
 				context.Background(),
 				"tr_WDqYK6vllg",
-				Payment{
+				UpdatePayment{
 					BillingEmail: "test@example.com",
 				},
 			},
@@ -398,7 +397,7 @@ func TestPaymentsService_Update(t *testing.T) {
 			args{
 				context.Background(),
 				"tr_WDqYK6vllg",
-				Payment{},
+				UpdatePayment{},
 			},
 			true,
 			fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."),
@@ -410,7 +409,7 @@ func TestPaymentsService_Update(t *testing.T) {
 			args{
 				context.Background(),
 				"tr_WDqYK6vllg",
-				Payment{},
+				UpdatePayment{},
 			},
 			true,
 			fmt.Errorf("invalid character 'h' looking for beginning of object key string"),
@@ -422,7 +421,7 @@ func TestPaymentsService_Update(t *testing.T) {
 			args{
 				context.Background(),
 				"tr_WDqYK6vllg",
-				Payment{},
+				UpdatePayment{},
 			},
 			true,
 			errBadBaseURL,