From 729f5e28b35f14710b911e855bbe1a1034d99a27 Mon Sep 17 00:00:00 2001 From: Victor Hugo Avelar Ossorio Date: Sat, 16 Mar 2024 09:15:55 +0000 Subject: [PATCH 1/2] chore(core): ensure naming consistency across resources --- mollie/balances.go | 34 ++++++++++++++---------------- mollie/balances_test.go | 6 +++--- mollie/chargebacks.go | 8 +++---- mollie/chargebacks_test.go | 8 +++---- mollie/customers.go | 8 +++---- mollie/customers_test.go | 14 ++++++------- mollie/invoices.go | 6 +++--- mollie/invoices_test.go | 6 +++--- mollie/mandates.go | 6 +++--- mollie/mandates_test.go | 4 ++-- mollie/onboarding.go | 38 +++++++++++++++++----------------- mollie/orders.go | 24 ++++++++++----------- mollie/orders_test.go | 12 +++++------ mollie/payment_links.go | 2 +- mollie/payment_methods.go | 8 +++---- mollie/payment_methods_test.go | 8 +++---- mollie/payments.go | 6 +++--- mollie/payments_test.go | 4 ++-- mollie/profiles.go | 12 +++++------ mollie/profiles_test.go | 14 ++++++------- mollie/refunds.go | 10 ++++----- mollie/refunds_test.go | 36 ++++++++++++++++---------------- mollie/settlements.go | 4 ++-- mollie/settlements_test.go | 20 +++++++++--------- 24 files changed, 148 insertions(+), 150 deletions(-) diff --git a/mollie/balances.go b/mollie/balances.go index 01b50498..3338de3e 100644 --- a/mollie/balances.go +++ b/mollie/balances.go @@ -7,16 +7,6 @@ import ( "time" ) -// BalancesService allows you to retrieve real-time as well as historical -// information about your Mollie balance. -// -// Works with Organization access tokens and App access tokens. -// -// The API is in **BETA** so be careful and expect changes. -// -// See: https://docs.mollie.com/reference/v2/balances-api/overview -type BalancesService service - // BalanceStatus reflects whether a balance is operational or not. type BalanceStatus string @@ -83,9 +73,9 @@ type BalancesList struct { Links PaginationLinks `json:"_links,omitempty"` } -// BalanceListOptions contains valid query parameters +// ListBalancesOptions contains valid query parameters // for the list balances endpoint. -type BalanceListOptions struct { +type ListBalancesOptions struct { Currency string `url:"currency,omitempty"` From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` @@ -217,13 +207,21 @@ type BalanceTransactionsList struct { Links PaginationLinks `json:"_links,omitempty"` } -// BalanceTransactionsListOptions are valid query parameters for list +// ListBalanceTransactionsOptions are valid query parameters for list // balance transactions requests. -type BalanceTransactionsListOptions struct { +type ListBalanceTransactionsOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` } +// BalancesService allows you to retrieve real-time as well as historical +// information about your Mollie balance. +// +// Works with Organization access tokens and App access tokens. +// +// See: https://docs.mollie.com/reference/v2/balances-api/overview +type BalancesService service + // GetBalance retrieves a balance by its id. // // See: https://docs.mollie.com/reference/v2/balances-api/get-balance @@ -245,7 +243,7 @@ func (bs *BalancesService) Primary(ctx context.Context) (res *Response, b *Balan // balance, ordered from newest to oldest. // // See: https://docs.mollie.com/reference/v2/balances-api/list-balances -func (bs *BalancesService) List(ctx context.Context, options *BalanceListOptions) ( +func (bs *BalancesService) List(ctx context.Context, options *ListBalancesOptions) ( res *Response, bl *BalancesList, err error, @@ -282,7 +280,7 @@ func (bs *BalancesService) GetPrimaryReport(ctx context.Context, options *Balanc func (bs *BalancesService) GetTransactionsList( ctx context.Context, balance string, - options *BalanceTransactionsListOptions, + options *ListBalanceTransactionsOptions, ) ( res *Response, btl *BalanceTransactionsList, @@ -295,7 +293,7 @@ func (bs *BalancesService) GetTransactionsList( // primary balance of the account. // // See: https://docs.mollie.com/reference/v2/balances-api/list-primary-balance-transactions -func (bs *BalancesService) GetPrimaryTransactionsList(ctx context.Context, options *BalanceTransactionsListOptions) ( +func (bs *BalancesService) GetPrimaryTransactionsList(ctx context.Context, options *ListBalanceTransactionsOptions) ( res *Response, btl *BalanceTransactionsList, err error, @@ -357,7 +355,7 @@ func (bs *BalancesService) getReport( func (bs *BalancesService) listTransactions( ctx context.Context, balance string, - options *BalanceTransactionsListOptions, + options *ListBalanceTransactionsOptions, ) (res *Response, btl *BalanceTransactionsList, err error) { u := fmt.Sprintf("v2/balances/%s/transactions", balance) diff --git a/mollie/balances_test.go b/mollie/balances_test.go index 703bf282..9972b5a4 100644 --- a/mollie/balances_test.go +++ b/mollie/balances_test.go @@ -208,7 +208,7 @@ func TestBalancesService_List(t *testing.T) { type args struct { ctx context.Context - options *BalanceListOptions + options *ListBalancesOptions } cases := []struct { @@ -515,7 +515,7 @@ func TestBalancesService_ListBalanceTransactions(t *testing.T) { type args struct { ctx context.Context balance string - options *BalanceTransactionsListOptions + options *ListBalanceTransactionsOptions } cases := []struct { @@ -619,7 +619,7 @@ func TestBalancesService_ListPrimaryBalanceTransactions(t *testing.T) { type args struct { ctx context.Context - options *BalanceTransactionsListOptions + options *ListBalanceTransactionsOptions } cases := []struct { diff --git a/mollie/chargebacks.go b/mollie/chargebacks.go index 834ac279..23978925 100644 --- a/mollie/chargebacks.go +++ b/mollie/chargebacks.go @@ -48,8 +48,8 @@ type ChargebackOptions struct { Embed []EmbedValue `url:"embed,omitempty"` } -// ChargebacksListOptions describes list chargebacks endpoint valid query string parameters. -type ChargebacksListOptions struct { +// ListChargebacksOptions describes list chargebacks endpoint valid query string parameters. +type ListChargebacksOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` Include []IncludeValue `url:"include,omitempty"` @@ -95,7 +95,7 @@ func (cs *ChargebacksService) Get(ctx context.Context, payment, chargeback strin // List retrieves a list of chargebacks associated with your account/organization. // // See: https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks -func (cs *ChargebacksService) List(ctx context.Context, options *ChargebacksListOptions) ( +func (cs *ChargebacksService) List(ctx context.Context, options *ListChargebacksOptions) ( res *Response, cl *ChargebacksList, err error, @@ -106,7 +106,7 @@ func (cs *ChargebacksService) List(ctx context.Context, options *ChargebacksList // ListForPayment retrieves a list of chargebacks associated with a single payment. // // See: https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks -func (cs *ChargebacksService) ListForPayment(ctx context.Context, payment string, options *ChargebacksListOptions) ( +func (cs *ChargebacksService) ListForPayment(ctx context.Context, payment string, options *ListChargebacksOptions) ( res *Response, cl *ChargebacksList, err error, diff --git a/mollie/chargebacks_test.go b/mollie/chargebacks_test.go index 83999875..1679344e 100644 --- a/mollie/chargebacks_test.go +++ b/mollie/chargebacks_test.go @@ -137,7 +137,7 @@ func TestChargebacksService_List(t *testing.T) { type args struct { ctx context.Context - options *ChargebacksListOptions + options *ListChargebacksOptions } noPre := func() {} @@ -173,7 +173,7 @@ func TestChargebacksService_List(t *testing.T) { "list chargebacks with options", args{ context.Background(), - &ChargebacksListOptions{ + &ListChargebacksOptions{ ProfileID: "pfl_QkEhN94Ba", }, }, @@ -253,7 +253,7 @@ func TestChargebacksService_ListForPayment(t *testing.T) { type args struct { ctx context.Context payment string - options *ChargebacksListOptions + options *ListChargebacksOptions } cases := []struct { @@ -289,7 +289,7 @@ func TestChargebacksService_ListForPayment(t *testing.T) { args{ context.Background(), "tr_WDqYK6vllg", - &ChargebacksListOptions{ + &ListChargebacksOptions{ ProfileID: "pfl_QkEhN94Ba", }, }, diff --git a/mollie/customers.go b/mollie/customers.go index a3e67397..826d15b6 100644 --- a/mollie/customers.go +++ b/mollie/customers.go @@ -46,8 +46,8 @@ type Customer struct { Links CustomerLinks `json:"_links,omitempty"` } -// CustomersListOptions contains valid query parameters for the list customers endpoint. -type CustomersListOptions struct { +// ListCustomersOptions contains valid query parameters for the list customers endpoint. +type ListCustomersOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` ProfileID string `url:"profileId,omitempty"` @@ -144,7 +144,7 @@ func (cs *CustomersService) Delete(ctx context.Context, id string) (res *Respons // List retrieves all customers created. // // See: https://docs.mollie.com/reference/v2/customers-api/list-customers -func (cs *CustomersService) List(ctx context.Context, options *CustomersListOptions) ( +func (cs *CustomersService) List(ctx context.Context, options *ListCustomersOptions) ( res *Response, cl *CustomersList, err error, @@ -164,7 +164,7 @@ func (cs *CustomersService) List(ctx context.Context, options *CustomersListOpti // GetPayments retrieves all payments linked to the customer. // // See: https://docs.mollie.com/reference/v2/customers-api/list-customer-payments -func (cs *CustomersService) GetPayments(ctx context.Context, id string, options *CustomersListOptions) ( +func (cs *CustomersService) GetPayments(ctx context.Context, id string, options *ListCustomersOptions) ( res *Response, pl *PaymentList, err error, diff --git a/mollie/customers_test.go b/mollie/customers_test.go index 86e6b442..411a643c 100644 --- a/mollie/customers_test.go +++ b/mollie/customers_test.go @@ -302,7 +302,7 @@ func TestCustomersService_List(t *testing.T) { defer unsetEnv() type args struct { ctx context.Context - options *CustomersListOptions + options *ListCustomersOptions } cases := []struct { @@ -319,7 +319,7 @@ func TestCustomersService_List(t *testing.T) { http.StatusAccepted, args{ context.Background(), - &CustomersListOptions{ + &ListCustomersOptions{ SequenceType: OneOffSequence, }, }, @@ -373,7 +373,7 @@ func TestCustomersService_List(t *testing.T) { http.StatusInternalServerError, args{ context.Background(), - &CustomersListOptions{ + &ListCustomersOptions{ SequenceType: OneOffSequence, }, }, @@ -387,7 +387,7 @@ func TestCustomersService_List(t *testing.T) { http.StatusInternalServerError, args{ context.Background(), - &CustomersListOptions{ + &ListCustomersOptions{ SequenceType: OneOffSequence, }, }, @@ -506,7 +506,7 @@ func TestCustomerService_GetPayments(t *testing.T) { type args struct { ctx context.Context customer string - options *CustomersListOptions + options *ListCustomersOptions } cases := []struct { @@ -542,7 +542,7 @@ func TestCustomerService_GetPayments(t *testing.T) { args{ context.Background(), "cst_kEn1PlbGa", - &CustomersListOptions{Limit: 100}, + &ListCustomersOptions{Limit: 100}, }, false, nil, @@ -562,7 +562,7 @@ func TestCustomerService_GetPayments(t *testing.T) { args{ context.Background(), "cst_kEn1PlbGa", - &CustomersListOptions{SequenceType: RecurringSequence}, + &ListCustomersOptions{SequenceType: RecurringSequence}, }, true, fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."), diff --git a/mollie/invoices.go b/mollie/invoices.go index c833d4a1..0b0331f8 100644 --- a/mollie/invoices.go +++ b/mollie/invoices.go @@ -50,8 +50,8 @@ type InvoiceLinks struct { Documentation *URL `json:"documentation,omitempty"` } -// InvoicesListOptions describes list invoices endpoint valid query string parameters. -type InvoicesListOptions struct { +// ListInvoicesOptions describes list invoices endpoint valid query string parameters. +type ListInvoicesOptions struct { Limit int64 `url:"limit,omitempty"` Reference string `url:"reference,omitempty"` Year string `url:"year,omitempty"` @@ -87,7 +87,7 @@ func (is *InvoicesService) Get(ctx context.Context, id string) (res *Response, i } // List retrieves a list of invoices associated with your account/organization. -func (is *InvoicesService) List(ctx context.Context, options *InvoicesListOptions) ( +func (is *InvoicesService) List(ctx context.Context, options *ListInvoicesOptions) ( res *Response, il *InvoicesList, err error, diff --git a/mollie/invoices_test.go b/mollie/invoices_test.go index aba93f79..6ab7fcc9 100644 --- a/mollie/invoices_test.go +++ b/mollie/invoices_test.go @@ -19,7 +19,7 @@ func TestInvoicesService_Get(t *testing.T) { type args struct { ctx context.Context invoice string - options *InvoicesListOptions + options *ListInvoicesOptions } cases := []struct { @@ -117,7 +117,7 @@ func TestInvoicesService_List(t *testing.T) { type args struct { ctx context.Context invoice string - options *InvoicesListOptions + options *ListInvoicesOptions } cases := []struct { @@ -154,7 +154,7 @@ func TestInvoicesService_List(t *testing.T) { args{ context.Background(), "inv_xBEbP9rvAq", - &InvoicesListOptions{ + &ListInvoicesOptions{ Year: strconv.Itoa(time.Now().Year()), }, }, diff --git a/mollie/mandates.go b/mollie/mandates.go index b9e7624d..a150cf0d 100644 --- a/mollie/mandates.go +++ b/mollie/mandates.go @@ -94,12 +94,12 @@ type MandateLinks struct { Documentation *URL `json:"documentation,omitempty"` } -// MandatesListOptions contains valid query parameters +// ListMandatesOptions contains valid query parameters // to filter the List mandates actions. // // From is a mandate id to offset from (inclusive) // Limit is the max number of mandates to retrieve. -type MandatesListOptions struct { +type ListMandatesOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` } @@ -182,7 +182,7 @@ func (ms *MandatesService) Revoke(ctx context.Context, customer, mandate string) // ordered from newest to oldest. // // See: https://docs.mollie.com/reference/v2/mandates-api/list-mandates -func (ms *MandatesService) List(ctx context.Context, customer string, options *MandatesListOptions) ( +func (ms *MandatesService) List(ctx context.Context, customer string, options *ListMandatesOptions) ( res *Response, ml *MandatesList, err error, diff --git a/mollie/mandates_test.go b/mollie/mandates_test.go index 3a032103..d4733f6f 100644 --- a/mollie/mandates_test.go +++ b/mollie/mandates_test.go @@ -324,7 +324,7 @@ func TestMandatesService_List(t *testing.T) { type args struct { ctx context.Context - options *MandatesListOptions + options *ListMandatesOptions customer string } @@ -359,7 +359,7 @@ func TestMandatesService_List(t *testing.T) { "list mandates with options works as expected.", args{ context.Background(), - &MandatesListOptions{ + &ListMandatesOptions{ Limit: 10, }, "cst_4qqhO89gsT", diff --git a/mollie/onboarding.go b/mollie/onboarding.go index e8386974..60ff001a 100644 --- a/mollie/onboarding.go +++ b/mollie/onboarding.go @@ -18,9 +18,6 @@ const ( CompletedOnboardingStatus OnboardingStatus = "completed" ) -// OnboardingService operates over the onboarding API. -type OnboardingService service - // OnboardingLinks contains URL objects relevant to the onboarding status. type OnboardingLinks struct { Self *URL `json:"self,omitempty"` @@ -40,22 +37,6 @@ type Onboarding struct { Links OnboardingLinks `json:"_links,omitempty"` } -// GetOnboardingStatus gets the status of onboarding of the authenticated organization. -// -// See: https://docs.mollie.com/reference/v2/onboarding-api/get-onboarding-status -func (os *OnboardingService) GetOnboardingStatus(ctx context.Context) (res *Response, o *Onboarding, err error) { - res, err = os.client.get(ctx, onboardingURLPath, nil) - if err != nil { - return - } - - if err = json.Unmarshal(res.content, &o); err != nil { - return - } - - return -} - // OnboardingData request possible values. // // Please note that even though all parameters are optional, @@ -88,6 +69,25 @@ type OnboardingData struct { Profile OnboardingDataProfile `json:"profile,omitempty"` } +// OnboardingService operates over the onboarding API. +type OnboardingService service + +// GetOnboardingStatus gets the status of onboarding of the authenticated organization. +// +// See: https://docs.mollie.com/reference/v2/onboarding-api/get-onboarding-status +func (os *OnboardingService) GetOnboardingStatus(ctx context.Context) (res *Response, o *Onboarding, err error) { + res, err = os.client.get(ctx, onboardingURLPath, nil) + if err != nil { + return + } + + if err = json.Unmarshal(res.content, &o); err != nil { + return + } + + return +} + // SubmitOnboardingData sends data that will be prefilled in the merchant’s onboarding. // Please note that the data you submit will only be processed when the onboarding status is needs-data. // diff --git a/mollie/orders.go b/mollie/orders.go index 5bdc29fa..aced0a9c 100644 --- a/mollie/orders.go +++ b/mollie/orders.go @@ -86,8 +86,8 @@ type UpdateOrder struct { OrderAccessTokenFields } -// OrderList for containing the response of list orders. -type OrderList struct { +// OrdersList for containing the response of list orders. +type OrdersList struct { Count int `json:"count,omitempty"` Embedded struct { Orders []*Order `json:"orders,omitempty"` @@ -263,8 +263,8 @@ type OrderLineOperations struct { Operations []*OrderLineChangeInstruction `json:"operations,omitempty"` } -// OrderListRefund for containing the response of list orders. -type OrderListRefund struct { +// OrderRefundsList for containing the response of list orders. +type OrderRefundsList struct { Count int `json:"count,omitempty"` Embedded struct { Refunds []*Refund `json:"refund,omitempty"` @@ -305,16 +305,16 @@ type OrderOptions struct { Embed []EmbedValue `url:"embed,omitempty"` } -// OrderListOptions describes order endpoint valid query string parameters. -type OrderListOptions struct { +// ListOrdersOptions describes order endpoint valid query string parameters. +type ListOrdersOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` Sort string `url:"sort,omitempty"` ProfileID string `url:"profileId,omitempty"` } -// OrderListRefundOptions describes order endpoint valid query string parameters. -type OrderListRefundOptions struct { +// ListOrderRefundsOptions describes order endpoint valid query string parameters. +type ListOrderRefundsOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` Embed EmbedValue `url:"embed,omitempty"` @@ -410,9 +410,9 @@ func (ors *OrdersService) Cancel(ctx context.Context, orderID string) (res *Resp // List is to retrieve all orders. // // See https://docs.mollie.com/reference/v2/orders-api/list-orders -func (ors *OrdersService) List(ctx context.Context, opts *OrderListOptions) ( +func (ors *OrdersService) List(ctx context.Context, opts *ListOrdersOptions) ( res *Response, - ordList *OrderList, + ordList *OrdersList, err error, ) { res, err = ors.client.get(ctx, "v2/orders", opts) @@ -524,9 +524,9 @@ func (ors *OrdersService) CreateOrderRefund(ctx context.Context, orderID string, // ListOrderRefunds retrieve all order refunds. // // See https://docs.mollie.com/reference/v2/orders-api/list-order-refunds -func (ors *OrdersService) ListOrderRefunds(ctx context.Context, orderID string, opts *OrderListRefundOptions) ( +func (ors *OrdersService) ListOrderRefunds(ctx context.Context, orderID string, opts *ListOrderRefundsOptions) ( res *Response, - orderListRefund *OrderListRefund, + orderListRefund *OrderRefundsList, err error, ) { u := fmt.Sprintf("v2/orders/%s/refunds", orderID) diff --git a/mollie/orders_test.go b/mollie/orders_test.go index 950642d4..22b53443 100644 --- a/mollie/orders_test.go +++ b/mollie/orders_test.go @@ -116,7 +116,7 @@ func TestOrdersService_List(t *testing.T) { type args struct { ctx context.Context order string - options *OrderListOptions + options *ListOrdersOptions } cases := []struct { name string @@ -131,7 +131,7 @@ func TestOrdersService_List(t *testing.T) { args{ context.Background(), "ord_kEn1PlbGa", - &OrderListOptions{ + &ListOrdersOptions{ ProfileID: "pfl_1236h213bv1", }, }, @@ -201,7 +201,7 @@ func TestOrdersService_List(t *testing.T) { assert.EqualError(t, err, c.err.Error()) } else { assert.Nil(t, err) - assert.IsType(t, &OrderList{}, m) + assert.IsType(t, &OrdersList{}, m) assert.IsType(t, &http.Response{}, res.Response) } }) @@ -1076,7 +1076,7 @@ func TestOrdersService_ListOrderRefund(t *testing.T) { type args struct { ctx context.Context order *Order - options *OrderListRefundOptions + options *ListOrderRefundsOptions } cases := []struct { name string @@ -1091,7 +1091,7 @@ func TestOrdersService_ListOrderRefund(t *testing.T) { args{ context.Background(), &Order{ID: "ord_8wmqcHMN4U"}, - &OrderListRefundOptions{Limit: 100}, + &ListOrderRefundsOptions{Limit: 100}, }, false, nil, @@ -1181,7 +1181,7 @@ func TestOrdersService_ListOrderRefund(t *testing.T) { assert.EqualError(t, err, c.err.Error()) } else { assert.Nil(t, err) - assert.IsType(t, &OrderListRefund{}, m) + assert.IsType(t, &OrderRefundsList{}, m) assert.IsType(t, &http.Response{}, res.Response) } }) diff --git a/mollie/payment_links.go b/mollie/payment_links.go index c8f61020..a8d3891e 100644 --- a/mollie/payment_links.go +++ b/mollie/payment_links.go @@ -43,9 +43,9 @@ type PaymentLinkLinks struct { // PaymentLinkOptions represents query string parameters to modify // the payment links requests. type PaymentLinkOptions struct { + Limit int `url:"limit,omitempty"` ProfileID string `url:"profileId,omitempty"` From string `url:"from,omitempty"` - Limit int `url:"limit,omitempty"` } // PaymentLinksList retrieves a list of payment links for the active diff --git a/mollie/payment_methods.go b/mollie/payment_methods.go index 1c277abb..d8d240df 100644 --- a/mollie/payment_methods.go +++ b/mollie/payment_methods.go @@ -76,11 +76,11 @@ type PaymentMethodOptions struct { Include []IncludeValue `url:"include,omitempty"` } -// PaymentMethodsListOptions are applicable query string parameters to list methods +// ListPaymentMethodsOptions are applicable query string parameters to list methods // from mollie's API. // // It contains list specific options and embeds GetMethodOptions. -type PaymentMethodsListOptions struct { +type ListPaymentMethodsOptions struct { PaymentMethodOptions Resource string `url:"resource,omitempty"` BillingCountry string `url:"billingCountry,omitempty"` @@ -121,7 +121,7 @@ func (ms *PaymentMethodsService) Get(ctx context.Context, id PaymentMethod, opti // All retrieves all the payment methods enabled for your account/organization. // // See: https://docs.mollie.com/reference/v2/methods-api/list-all-methods -func (ms *PaymentMethodsService) All(ctx context.Context, options *PaymentMethodsListOptions) ( +func (ms *PaymentMethodsService) All(ctx context.Context, options *ListPaymentMethodsOptions) ( res *Response, pm *PaymentMethodsList, err error, @@ -134,7 +134,7 @@ func (ms *PaymentMethodsService) All(ctx context.Context, options *PaymentMethod // The results are not paginated. // // See: https://docs.mollie.com/reference/v2/methods-api/list-methods -func (ms *PaymentMethodsService) List(ctx context.Context, options *PaymentMethodsListOptions) ( +func (ms *PaymentMethodsService) List(ctx context.Context, options *ListPaymentMethodsOptions) ( res *Response, pm *PaymentMethodsList, err error, diff --git a/mollie/payment_methods_test.go b/mollie/payment_methods_test.go index 8a0387bd..60878514 100644 --- a/mollie/payment_methods_test.go +++ b/mollie/payment_methods_test.go @@ -16,7 +16,7 @@ func TestMethodsService_List(t *testing.T) { type args struct { ctx context.Context - options *PaymentMethodsListOptions + options *ListPaymentMethodsOptions } cases := []struct { @@ -50,7 +50,7 @@ func TestMethodsService_List(t *testing.T) { "list methods with options works as expected.", args{ context.Background(), - &PaymentMethodsListOptions{ + &ListPaymentMethodsOptions{ Amount: &Amount{ Value: "100.00", Currency: "EUR", @@ -133,7 +133,7 @@ func TestMethodsService_All(t *testing.T) { type args struct { ctx context.Context - options *PaymentMethodsListOptions + options *ListPaymentMethodsOptions } cases := []struct { @@ -167,7 +167,7 @@ func TestMethodsService_All(t *testing.T) { "list methods with options works as expected.", args{ context.Background(), - &PaymentMethodsListOptions{ + &ListPaymentMethodsOptions{ Amount: &Amount{ Value: "100.00", Currency: "EUR", diff --git a/mollie/payments.go b/mollie/payments.go index f0471a61..bf80a467 100644 --- a/mollie/payments.go +++ b/mollie/payments.go @@ -254,8 +254,8 @@ type PaymentOptions struct { Embed []EmbedValue `url:"embed,omitempty"` } -// ListPaymentOptions describes list payments endpoint valid query string parameters. -type ListPaymentOptions struct { +// ListPaymentsOptions describes list payments endpoint valid query string parameters. +type ListPaymentsOptions struct { Limit int `url:"limit,omitempty"` Include []IncludeValue `url:"include,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` @@ -356,7 +356,7 @@ type PaymentList struct { // List retrieves a list of payments associated with your account/organization. // // See: https://docs.mollie.com/reference/v2/payments-api/list-payments -func (ps *PaymentsService) List(ctx context.Context, opts *ListPaymentOptions) ( +func (ps *PaymentsService) List(ctx context.Context, opts *ListPaymentsOptions) ( res *Response, pl *PaymentList, err error, diff --git a/mollie/payments_test.go b/mollie/payments_test.go index 7e911d6a..f29d1f0c 100644 --- a/mollie/payments_test.go +++ b/mollie/payments_test.go @@ -115,7 +115,7 @@ func TestPaymentsService_List(t *testing.T) { type args struct { ctx context.Context - options *ListPaymentOptions + options *ListPaymentsOptions } cases := []struct { name string @@ -129,7 +129,7 @@ func TestPaymentsService_List(t *testing.T) { "get payments works as expected.", args{ context.Background(), - &ListPaymentOptions{ + &ListPaymentsOptions{ From: "tr_12o93213", }, }, diff --git a/mollie/profiles.go b/mollie/profiles.go index 4d624f91..4d670e7a 100644 --- a/mollie/profiles.go +++ b/mollie/profiles.go @@ -77,14 +77,14 @@ type ProfileLinks struct { Documentation *URL `json:"documentation,omitempty"` } -// ProfileListOptions are optional query string parameters for the list profiles request. -type ProfileListOptions struct { +// ListProfilesOptions are optional query string parameters for the list profiles request. +type ListProfilesOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` } -// ProfileList contains a list of profiles for your account. -type ProfileList struct { +// ProfilesList contains a list of profiles for your account. +type ProfilesList struct { Count int `json:"count,omitempty"` Embedded struct { Profiles []*Profile `json:"profiles,omitempty"` @@ -101,9 +101,9 @@ type EnableVoucherIssuer struct { type ProfilesService service // List returns all the profiles for the authenticated account. -func (ps *ProfilesService) List(ctx context.Context, opts *ProfileListOptions) ( +func (ps *ProfilesService) List(ctx context.Context, opts *ListProfilesOptions) ( res *Response, - pl *ProfileList, + pl *ProfilesList, err error, ) { res, err = ps.client.get(ctx, "v2/profiles", opts) diff --git a/mollie/profiles_test.go b/mollie/profiles_test.go index 5abeec09..839e140c 100644 --- a/mollie/profiles_test.go +++ b/mollie/profiles_test.go @@ -183,7 +183,7 @@ func TestProfilesService_List(t *testing.T) { type args struct { ctx context.Context - options *ProfileListOptions + options *ListProfilesOptions } cases := []struct { name string @@ -197,7 +197,7 @@ func TestProfilesService_List(t *testing.T) { "list profiles works as expected.", args{ context.Background(), - &ProfileListOptions{}, + &ListProfilesOptions{}, }, false, nil, @@ -219,7 +219,7 @@ func TestProfilesService_List(t *testing.T) { "list profiles with options, works as expected.", args{ context.Background(), - &ProfileListOptions{ + &ListProfilesOptions{ Limit: 100, }, }, @@ -243,7 +243,7 @@ func TestProfilesService_List(t *testing.T) { "list profiles, an error is returned from the server", args{ context.Background(), - &ProfileListOptions{}, + &ListProfilesOptions{}, }, true, fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."), @@ -254,7 +254,7 @@ func TestProfilesService_List(t *testing.T) { "list profiles, an error occurs when parsing json", args{ context.Background(), - &ProfileListOptions{}, + &ListProfilesOptions{}, }, true, fmt.Errorf("invalid character 'h' looking for beginning of object key string"), @@ -265,7 +265,7 @@ func TestProfilesService_List(t *testing.T) { "list profiles, invalid url when building request", args{ context.Background(), - &ProfileListOptions{}, + &ListProfilesOptions{}, }, true, errBadBaseURL, @@ -288,7 +288,7 @@ func TestProfilesService_List(t *testing.T) { assert.EqualError(t, err, c.err.Error()) } else { assert.Nil(t, err) - assert.IsType(t, &ProfileList{}, m) + assert.IsType(t, &ProfilesList{}, m) assert.IsType(t, &http.Response{}, res.Response) } }) diff --git a/mollie/refunds.go b/mollie/refunds.go index 0c6beea9..9d0d06d2 100644 --- a/mollie/refunds.go +++ b/mollie/refunds.go @@ -109,8 +109,8 @@ type PaymentRefundOptions struct { Embed []EmbedValue `url:"embed,omitempty"` } -// RefundsListOptions describes payment and order refunds list endpoint valid query string parameters. -type RefundsListOptions struct { +// ListRefundsOptions describes payment and order refunds list endpoint valid query string parameters. +type ListRefundsOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` ProfileID string `url:"profileId,omitempty"` @@ -123,7 +123,7 @@ type RefundsService service // List retrieves all refunds. // // See https://docs.mollie.com/reference/v2/refunds-api/list-refunds. -func (rs *RefundsService) List(ctx context.Context, opts *RefundsListOptions) ( +func (rs *RefundsService) List(ctx context.Context, opts *ListRefundsOptions) ( res *Response, rl *RefundsList, err error, @@ -172,7 +172,7 @@ func (rs *RefundsService) GetPaymentRefund( func (rs *RefundsService) ListPaymentRefunds( ctx context.Context, paymentID string, - opts *RefundsListOptions, + opts *ListRefundsOptions, ) ( res *Response, rl *RefundsList, @@ -268,7 +268,7 @@ func (rs *RefundsService) CreateOrderRefund( func (rs *RefundsService) ListOrderRefunds( ctx context.Context, orderID string, - opts *RefundsListOptions, + opts *ListRefundsOptions, ) ( res *Response, rl *RefundsList, diff --git a/mollie/refunds_test.go b/mollie/refunds_test.go index 0e963554..cfa5c3fc 100644 --- a/mollie/refunds_test.go +++ b/mollie/refunds_test.go @@ -255,7 +255,7 @@ func TestRefundsService_ListPaymentRefunds(t *testing.T) { type args struct { ctx context.Context paymentID string - opts *RefundsListOptions + opts *ListRefundsOptions } cases := []struct { @@ -271,7 +271,7 @@ func TestRefundsService_ListPaymentRefunds(t *testing.T) { args{ context.Background(), "tr_7UhSN1zuXS", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, false, nil, @@ -286,7 +286,7 @@ func TestRefundsService_ListPaymentRefunds(t *testing.T) { args{ context.Background(), "tr_7UhSN1zuXS", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, false, nil, @@ -301,7 +301,7 @@ func TestRefundsService_ListPaymentRefunds(t *testing.T) { args{ context.Background(), "tr_7UhSN1zuXS", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."), @@ -313,7 +313,7 @@ func TestRefundsService_ListPaymentRefunds(t *testing.T) { args{ context.Background(), "tr_7UhSN1zuXS", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, fmt.Errorf("invalid character 'h' looking for beginning of object key string"), @@ -325,7 +325,7 @@ func TestRefundsService_ListPaymentRefunds(t *testing.T) { args{ context.Background(), "tr_7UhSN1zuXS", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, errBadBaseURL, @@ -580,7 +580,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { type args struct { ctx context.Context orderID string - opts *RefundsListOptions + opts *ListRefundsOptions } cases := []struct { @@ -596,7 +596,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { args{ context.Background(), "ord_8wmqcHMN4U", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, false, nil, @@ -611,7 +611,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { args{ context.Background(), "ord_8wmqcHMN4U", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, false, nil, @@ -626,7 +626,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { args{ context.Background(), "ord_8wmqcHMN4U", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."), @@ -638,7 +638,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { args{ context.Background(), "ord_8wmqcHMN4U", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, fmt.Errorf("invalid character 'h' looking for beginning of object key string"), @@ -650,7 +650,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { args{ context.Background(), "ord_8wmqcHMN4U", - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, errBadBaseURL, @@ -686,7 +686,7 @@ func TestRefundsService_ListOrderRefunds(t *testing.T) { func TestRefundsService_List(t *testing.T) { type args struct { ctx context.Context - opts *RefundsListOptions + opts *ListRefundsOptions } cases := []struct { @@ -701,7 +701,7 @@ func TestRefundsService_List(t *testing.T) { "list refunds works as expected", args{ context.Background(), - &RefundsListOptions{}, + &ListRefundsOptions{}, }, false, nil, @@ -715,7 +715,7 @@ func TestRefundsService_List(t *testing.T) { "list refunds works as expected with access tokens", args{ context.Background(), - &RefundsListOptions{}, + &ListRefundsOptions{}, }, false, nil, @@ -729,7 +729,7 @@ func TestRefundsService_List(t *testing.T) { "list refunds, an error is returned from the server", args{ context.Background(), - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."), @@ -740,7 +740,7 @@ func TestRefundsService_List(t *testing.T) { "list refunds, an error occurs when parsing json", args{ context.Background(), - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, fmt.Errorf("invalid character 'h' looking for beginning of object key string"), @@ -751,7 +751,7 @@ func TestRefundsService_List(t *testing.T) { "list refunds, invalid url when building request", args{ context.Background(), - &RefundsListOptions{}, + &ListRefundsOptions{}, }, true, errBadBaseURL, diff --git a/mollie/settlements.go b/mollie/settlements.go index 07fe1847..5ddc82ba 100644 --- a/mollie/settlements.go +++ b/mollie/settlements.go @@ -142,7 +142,7 @@ func (ss *SettlementsService) List(ctx context.Context, slo *ListSettlementsOpti // This API is an alias of the List payments. // // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-payments -func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentOptions) ( +func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentsOptions) ( res *Response, pl *PaymentList, err error, @@ -182,7 +182,7 @@ func (ss *SettlementsService) GetRefunds(ctx context.Context, settlement string, // GetChargebacks retrieves all chargebacks included in a settlement. // // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-chargebacks -func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ChargebacksListOptions) ( +func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ListChargebacksOptions) ( res *Response, cl *ChargebacksList, err error, diff --git a/mollie/settlements_test.go b/mollie/settlements_test.go index 5f4fada4..1426c3a0 100644 --- a/mollie/settlements_test.go +++ b/mollie/settlements_test.go @@ -390,7 +390,7 @@ func TestSettlementsService_GetPayments(t *testing.T) { type args struct { ctx context.Context settlement string - options *ListPaymentOptions + options *ListPaymentsOptions } cases := []struct { name string @@ -405,7 +405,7 @@ func TestSettlementsService_GetPayments(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ListPaymentOptions{ + &ListPaymentsOptions{ Limit: 10, }, }, @@ -428,7 +428,7 @@ func TestSettlementsService_GetPayments(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ListPaymentOptions{ + &ListPaymentsOptions{ Limit: 10, }, }, @@ -442,7 +442,7 @@ func TestSettlementsService_GetPayments(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ListPaymentOptions{ + &ListPaymentsOptions{ Limit: 10, }, }, @@ -456,7 +456,7 @@ func TestSettlementsService_GetPayments(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ListPaymentOptions{ + &ListPaymentsOptions{ Limit: 10, }, }, @@ -600,7 +600,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) { type args struct { ctx context.Context settlement string - options *ChargebacksListOptions + options *ListChargebacksOptions } cases := []struct { name string @@ -615,7 +615,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ChargebacksListOptions{ + &ListChargebacksOptions{ Limit: 10, }, }, @@ -638,7 +638,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ChargebacksListOptions{ + &ListChargebacksOptions{ Limit: 10, }, }, @@ -652,7 +652,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ChargebacksListOptions{ + &ListChargebacksOptions{ Limit: 10, }, }, @@ -666,7 +666,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) { args{ context.Background(), "stl_jDk30akdN", - &ChargebacksListOptions{ + &ListChargebacksOptions{ Limit: 10, }, }, From 1a6e703a6ea02bc6b35fd2302dc2c378ef329b06 Mon Sep 17 00:00:00 2001 From: Victor Hugo Avelar Ossorio Date: Sat, 16 Mar 2024 09:16:06 +0000 Subject: [PATCH 2/2] chore(docs): update generated docs --- docs/README.md | 590 ++++++++++++++++++++++++------------------------- 1 file changed, 294 insertions(+), 296 deletions(-) diff --git a/docs/README.md b/docs/README.md index 61e9d491..f68dbcbb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -31,7 +31,6 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type BalanceAmount](<#BalanceAmount>) - [type BalanceGroupingFormat](<#BalanceGroupingFormat>) - [type BalanceLinks](<#BalanceLinks>) -- [type BalanceListOptions](<#BalanceListOptions>) - [type BalanceReport](<#BalanceReport>) - [type BalanceReportDetail](<#BalanceReportDetail>) - [type BalanceReportLinks](<#BalanceReportLinks>) @@ -40,15 +39,14 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type BalanceStatus](<#BalanceStatus>) - [type BalanceTransaction](<#BalanceTransaction>) - [type BalanceTransactionsList](<#BalanceTransactionsList>) -- [type BalanceTransactionsListOptions](<#BalanceTransactionsListOptions>) - [type BalancesList](<#BalancesList>) - [type BalancesService](<#BalancesService>) - [func \(bs \*BalancesService\) Get\(ctx context.Context, balance string\) \(res \*Response, b \*Balance, err error\)](<#BalancesService.Get>) - [func \(bs \*BalancesService\) GetPrimaryReport\(ctx context.Context, options \*BalanceReportOptions\) \(res \*Response, br \*BalanceReport, err error\)](<#BalancesService.GetPrimaryReport>) - - [func \(bs \*BalancesService\) GetPrimaryTransactionsList\(ctx context.Context, options \*BalanceTransactionsListOptions\) \(res \*Response, btl \*BalanceTransactionsList, err error\)](<#BalancesService.GetPrimaryTransactionsList>) + - [func \(bs \*BalancesService\) GetPrimaryTransactionsList\(ctx context.Context, options \*ListBalanceTransactionsOptions\) \(res \*Response, btl \*BalanceTransactionsList, err error\)](<#BalancesService.GetPrimaryTransactionsList>) - [func \(bs \*BalancesService\) GetReport\(ctx context.Context, balance string, options \*BalanceReportOptions\) \(res \*Response, br \*BalanceReport, err error\)](<#BalancesService.GetReport>) - - [func \(bs \*BalancesService\) GetTransactionsList\(ctx context.Context, balance string, options \*BalanceTransactionsListOptions\) \(res \*Response, btl \*BalanceTransactionsList, err error\)](<#BalancesService.GetTransactionsList>) - - [func \(bs \*BalancesService\) List\(ctx context.Context, options \*BalanceListOptions\) \(res \*Response, bl \*BalancesList, err error\)](<#BalancesService.List>) + - [func \(bs \*BalancesService\) GetTransactionsList\(ctx context.Context, balance string, options \*ListBalanceTransactionsOptions\) \(res \*Response, btl \*BalanceTransactionsList, err error\)](<#BalancesService.GetTransactionsList>) + - [func \(bs \*BalancesService\) List\(ctx context.Context, options \*ListBalancesOptions\) \(res \*Response, bl \*BalancesList, err error\)](<#BalancesService.List>) - [func \(bs \*BalancesService\) Primary\(ctx context.Context\) \(res \*Response, b \*Balance, err error\)](<#BalancesService.Primary>) - [type BaseError](<#BaseError>) - [func \(be \*BaseError\) Error\(\) string](<#BaseError.Error>) @@ -72,11 +70,10 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type ChargebackOptions](<#ChargebackOptions>) - [type ChargebackReason](<#ChargebackReason>) - [type ChargebacksList](<#ChargebacksList>) -- [type ChargebacksListOptions](<#ChargebacksListOptions>) - [type ChargebacksService](<#ChargebacksService>) - [func \(cs \*ChargebacksService\) Get\(ctx context.Context, payment, chargeback string, opts \*ChargebackOptions\) \(res \*Response, p \*Chargeback, err error\)](<#ChargebacksService.Get>) - - [func \(cs \*ChargebacksService\) List\(ctx context.Context, options \*ChargebacksListOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#ChargebacksService.List>) - - [func \(cs \*ChargebacksService\) ListForPayment\(ctx context.Context, payment string, options \*ChargebacksListOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#ChargebacksService.ListForPayment>) + - [func \(cs \*ChargebacksService\) List\(ctx context.Context, options \*ListChargebacksOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#ChargebacksService.List>) + - [func \(cs \*ChargebacksService\) ListForPayment\(ctx context.Context, payment string, options \*ListChargebacksOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#ChargebacksService.ListForPayment>) - [type Client](<#Client>) - [func NewClient\(baseClient \*http.Client, conf \*Config\) \(mollie \*Client, err error\)](<#NewClient>) - [func \(c \*Client\) Do\(req \*http.Request\) \(\*Response, error\)](<#Client.Do>) @@ -125,14 +122,13 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type Customer](<#Customer>) - [type CustomerLinks](<#CustomerLinks>) - [type CustomersList](<#CustomersList>) -- [type CustomersListOptions](<#CustomersListOptions>) - [type CustomersService](<#CustomersService>) - [func \(cs \*CustomersService\) Create\(ctx context.Context, c CreateCustomer\) \(res \*Response, cc \*Customer, err error\)](<#CustomersService.Create>) - [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>) - - [func \(cs \*CustomersService\) List\(ctx context.Context, options \*CustomersListOptions\) \(res \*Response, cl \*CustomersList, err error\)](<#CustomersService.List>) + - [func \(cs \*CustomersService\) GetPayments\(ctx context.Context, id string, options \*ListCustomersOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#CustomersService.GetPayments>) + - [func \(cs \*CustomersService\) List\(ctx context.Context, options \*ListCustomersOptions\) \(res \*Response, cl \*CustomersList, err error\)](<#CustomersService.List>) - [func \(cs \*CustomersService\) Update\(ctx context.Context, id string, c UpdateCustomer\) \(res \*Response, cc \*Customer, err error\)](<#CustomersService.Update>) - [type EligibilityReasons](<#EligibilityReasons>) - [type EmbedValue](<#EmbedValue>) @@ -151,17 +147,27 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type InvoiceLinks](<#InvoiceLinks>) - [type InvoiceStatus](<#InvoiceStatus>) - [type InvoicesList](<#InvoicesList>) -- [type InvoicesListOptions](<#InvoicesListOptions>) - [type InvoicesService](<#InvoicesService>) - [func \(is \*InvoicesService\) Get\(ctx context.Context, id string\) \(res \*Response, i \*Invoice, err error\)](<#InvoicesService.Get>) - - [func \(is \*InvoicesService\) List\(ctx context.Context, options \*InvoicesListOptions\) \(res \*Response, il \*InvoicesList, err error\)](<#InvoicesService.List>) + - [func \(is \*InvoicesService\) List\(ctx context.Context, options \*ListInvoicesOptions\) \(res \*Response, il \*InvoicesList, err error\)](<#InvoicesService.List>) - [type IssuerStatus](<#IssuerStatus>) - [type LineItem](<#LineItem>) - [type LinkedClient](<#LinkedClient>) - [type LinkedClientLinks](<#LinkedClientLinks>) - [type LinkedClientList](<#LinkedClientList>) +- [type ListBalanceTransactionsOptions](<#ListBalanceTransactionsOptions>) +- [type ListBalancesOptions](<#ListBalancesOptions>) +- [type ListChargebacksOptions](<#ListChargebacksOptions>) +- [type ListCustomersOptions](<#ListCustomersOptions>) +- [type ListInvoicesOptions](<#ListInvoicesOptions>) - [type ListLinkedClientsOptions](<#ListLinkedClientsOptions>) -- [type ListPaymentOptions](<#ListPaymentOptions>) +- [type ListMandatesOptions](<#ListMandatesOptions>) +- [type ListOrderRefundsOptions](<#ListOrderRefundsOptions>) +- [type ListOrdersOptions](<#ListOrdersOptions>) +- [type ListPaymentMethodsOptions](<#ListPaymentMethodsOptions>) +- [type ListPaymentsOptions](<#ListPaymentsOptions>) +- [type ListProfilesOptions](<#ListProfilesOptions>) +- [type ListRefundsOptions](<#ListRefundsOptions>) - [type ListSettlementsOptions](<#ListSettlementsOptions>) - [type ListSubscriptionsOptions](<#ListSubscriptionsOptions>) - [type ListTerminalsOptions](<#ListTerminalsOptions>) @@ -171,11 +177,10 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type MandateLinks](<#MandateLinks>) - [type MandateStatus](<#MandateStatus>) - [type MandatesList](<#MandatesList>) -- [type MandatesListOptions](<#MandatesListOptions>) - [type MandatesService](<#MandatesService>) - [func \(ms \*MandatesService\) Create\(ctx context.Context, customer string, mandate CreateMandate\) \(res \*Response, mr \*Mandate, err error\)](<#MandatesService.Create>) - [func \(ms \*MandatesService\) Get\(ctx context.Context, customer, mandate string\) \(res \*Response, mr \*Mandate, err error\)](<#MandatesService.Get>) - - [func \(ms \*MandatesService\) List\(ctx context.Context, customer string, options \*MandatesListOptions\) \(res \*Response, ml \*MandatesList, err error\)](<#MandatesService.List>) + - [func \(ms \*MandatesService\) List\(ctx context.Context, customer string, options \*ListMandatesOptions\) \(res \*Response, ml \*MandatesList, err error\)](<#MandatesService.List>) - [func \(ms \*MandatesService\) Revoke\(ctx context.Context, customer, mandate string\) \(res \*Response, err error\)](<#MandatesService.Revoke>) - [type MethodsLinks](<#MethodsLinks>) - [type Mode](<#Mode>) @@ -201,14 +206,12 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type OrderLineOperations](<#OrderLineOperations>) - [type OrderLineStatus](<#OrderLineStatus>) - [type OrderLinks](<#OrderLinks>) -- [type OrderList](<#OrderList>) -- [type OrderListOptions](<#OrderListOptions>) -- [type OrderListRefund](<#OrderListRefund>) -- [type OrderListRefundOptions](<#OrderListRefundOptions>) - [type OrderOptions](<#OrderOptions>) - [type OrderPayment](<#OrderPayment>) - [type OrderRefundLine](<#OrderRefundLine>) +- [type OrderRefundsList](<#OrderRefundsList>) - [type OrderStatus](<#OrderStatus>) +- [type OrdersList](<#OrdersList>) - [type OrdersService](<#OrdersService>) - [func \(ors \*OrdersService\) Cancel\(ctx context.Context, orderID string\) \(res \*Response, order \*Order, err error\)](<#OrdersService.Cancel>) - [func \(ors \*OrdersService\) CancelOrderLines\(ctx context.Context, orderID string, orderLines \[\]OrderLine\) \(res \*Response, err error\)](<#OrdersService.CancelOrderLines>) @@ -216,8 +219,8 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [func \(ors \*OrdersService\) CreateOrderPayment\(ctx context.Context, orderID string, ordPay \*OrderPayment\) \(res \*Response, payment \*Payment, err error\)](<#OrdersService.CreateOrderPayment>) - [func \(ors \*OrdersService\) CreateOrderRefund\(ctx context.Context, orderID string, order \*Order\) \(res \*Response, refund \*Refund, err error\)](<#OrdersService.CreateOrderRefund>) - [func \(ors \*OrdersService\) Get\(ctx context.Context, orID string, opts \*OrderOptions\) \(res \*Response, order \*Order, err error\)](<#OrdersService.Get>) - - [func \(ors \*OrdersService\) List\(ctx context.Context, opts \*OrderListOptions\) \(res \*Response, ordList \*OrderList, err error\)](<#OrdersService.List>) - - [func \(ors \*OrdersService\) ListOrderRefunds\(ctx context.Context, orderID string, opts \*OrderListRefundOptions\) \(res \*Response, orderListRefund \*OrderListRefund, err error\)](<#OrdersService.ListOrderRefunds>) + - [func \(ors \*OrdersService\) List\(ctx context.Context, opts \*ListOrdersOptions\) \(res \*Response, ordList \*OrdersList, err error\)](<#OrdersService.List>) + - [func \(ors \*OrdersService\) ListOrderRefunds\(ctx context.Context, orderID string, opts \*ListOrderRefundsOptions\) \(res \*Response, orderListRefund \*OrderRefundsList, err error\)](<#OrdersService.ListOrderRefunds>) - [func \(ors \*OrdersService\) ManageOrderLines\(ctx context.Context, orderID string, operations \*OrderLineOperations\) \(res \*Response, order \*Order, err error\)](<#OrdersService.ManageOrderLines>) - [func \(ors \*OrdersService\) Update\(ctx context.Context, orderID string, ord UpdateOrder\) \(res \*Response, order \*Order, err error\)](<#OrdersService.Update>) - [func \(ors \*OrdersService\) UpdateOrderLine\(ctx context.Context, orderID string, orderLineID string, orderLine UpdateOrderLine\) \(res \*Response, order \*Order, err error\)](<#OrdersService.UpdateOrderLine>) @@ -253,11 +256,10 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type PaymentMethodPricing](<#PaymentMethodPricing>) - [type PaymentMethodStatus](<#PaymentMethodStatus>) - [type PaymentMethodsList](<#PaymentMethodsList>) -- [type PaymentMethodsListOptions](<#PaymentMethodsListOptions>) - [type PaymentMethodsService](<#PaymentMethodsService>) - - [func \(ms \*PaymentMethodsService\) All\(ctx context.Context, options \*PaymentMethodsListOptions\) \(res \*Response, pm \*PaymentMethodsList, err error\)](<#PaymentMethodsService.All>) + - [func \(ms \*PaymentMethodsService\) All\(ctx context.Context, options \*ListPaymentMethodsOptions\) \(res \*Response, pm \*PaymentMethodsList, err error\)](<#PaymentMethodsService.All>) - [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>) + - [func \(ms \*PaymentMethodsService\) List\(ctx context.Context, options \*ListPaymentMethodsOptions\) \(res \*Response, pm \*PaymentMethodsList, err error\)](<#PaymentMethodsService.List>) - [type PaymentOptions](<#PaymentOptions>) - [type PaymentRefundAccessTokenFields](<#PaymentRefundAccessTokenFields>) - [type PaymentRefundMollieConnectFields](<#PaymentRefundMollieConnectFields>) @@ -267,7 +269,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [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 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\) List\(ctx context.Context, opts \*ListPaymentsOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#PaymentsService.List>) - [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>) @@ -281,11 +283,10 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type ProductKind](<#ProductKind>) - [type Profile](<#Profile>) - [type ProfileLinks](<#ProfileLinks>) -- [type ProfileList](<#ProfileList>) -- [type ProfileListOptions](<#ProfileListOptions>) - [type ProfileReview](<#ProfileReview>) - [type ProfileReviewStatus](<#ProfileReviewStatus>) - [type ProfileStatus](<#ProfileStatus>) +- [type ProfilesList](<#ProfilesList>) - [type ProfilesService](<#ProfilesService>) - [func \(ps \*ProfilesService\) Create\(ctx context.Context, np CreateOrUpdateProfile\) \(res \*Response, p \*Profile, err error\)](<#ProfilesService.Create>) - [func \(ps \*ProfilesService\) Current\(ctx context.Context\) \(res \*Response, p \*Profile, err error\)](<#ProfilesService.Current>) @@ -301,7 +302,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [func \(ps \*ProfilesService\) EnableVoucherIssuer\(ctx context.Context, profileID string, issuer VoucherIssuer, vi \*EnableVoucherIssuer\) \(res \*Response, vc \*VoucherIssuerEnabled, err error\)](<#ProfilesService.EnableVoucherIssuer>) - [func \(ps \*ProfilesService\) EnableVoucherIssuerForCurrent\(ctx context.Context, issuer VoucherIssuer\) \(res \*Response, vc \*VoucherIssuerEnabled, err error\)](<#ProfilesService.EnableVoucherIssuerForCurrent>) - [func \(ps \*ProfilesService\) Get\(ctx context.Context, id string\) \(res \*Response, p \*Profile, err error\)](<#ProfilesService.Get>) - - [func \(ps \*ProfilesService\) List\(ctx context.Context, opts \*ProfileListOptions\) \(res \*Response, pl \*ProfileList, err error\)](<#ProfilesService.List>) + - [func \(ps \*ProfilesService\) List\(ctx context.Context, opts \*ListProfilesOptions\) \(res \*Response, pl \*ProfilesList, err error\)](<#ProfilesService.List>) - [func \(ps \*ProfilesService\) Update\(ctx context.Context, id string, up CreateOrUpdateProfile\) \(res \*Response, p \*Profile, err error\)](<#ProfilesService.Update>) - [type QRCode](<#QRCode>) - [type Rate](<#Rate>) @@ -310,15 +311,14 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type RefundLinks](<#RefundLinks>) - [type RefundStatus](<#RefundStatus>) - [type RefundsList](<#RefundsList>) -- [type RefundsListOptions](<#RefundsListOptions>) - [type RefundsService](<#RefundsService>) - [func \(rs \*RefundsService\) CancelPaymentRefund\(ctx context.Context, paymentID, refundID string\) \(res \*Response, err error\)](<#RefundsService.CancelPaymentRefund>) - [func \(rs \*RefundsService\) CreateOrderRefund\(ctx context.Context, orderID string, r CreateOrderRefund\) \(res \*Response, rf \*Refund, err error\)](<#RefundsService.CreateOrderRefund>) - [func \(rs \*RefundsService\) CreatePaymentRefund\(ctx context.Context, paymentID string, re CreatePaymentRefund, options \*PaymentRefundOptions\) \(res \*Response, rf \*Refund, err error\)](<#RefundsService.CreatePaymentRefund>) - [func \(rs \*RefundsService\) GetPaymentRefund\(ctx context.Context, paymentID, refundID string, opts \*PaymentRefundOptions\) \(res \*Response, refund \*Refund, err error\)](<#RefundsService.GetPaymentRefund>) - - [func \(rs \*RefundsService\) List\(ctx context.Context, opts \*RefundsListOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#RefundsService.List>) - - [func \(rs \*RefundsService\) ListOrderRefunds\(ctx context.Context, orderID string, opts \*RefundsListOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#RefundsService.ListOrderRefunds>) - - [func \(rs \*RefundsService\) ListPaymentRefunds\(ctx context.Context, paymentID string, opts \*RefundsListOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#RefundsService.ListPaymentRefunds>) + - [func \(rs \*RefundsService\) List\(ctx context.Context, opts \*ListRefundsOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#RefundsService.List>) + - [func \(rs \*RefundsService\) ListOrderRefunds\(ctx context.Context, orderID string, opts \*ListRefundsOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#RefundsService.ListOrderRefunds>) + - [func \(rs \*RefundsService\) ListPaymentRefunds\(ctx context.Context, paymentID string, opts \*ListRefundsOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#RefundsService.ListPaymentRefunds>) - [type Response](<#Response>) - [type RoutingReversal](<#RoutingReversal>) - [type RoutingSource](<#RoutingSource>) @@ -334,10 +334,10 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y - [type SettlementsService](<#SettlementsService>) - [func \(ss \*SettlementsService\) Get\(ctx context.Context, settlement string\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Get>) - [func \(ss \*SettlementsService\) GetCaptures\(ctx context.Context, settlement string, slo \*ListSettlementsOptions\) \(res \*Response, cl \*CapturesList, err error\)](<#SettlementsService.GetCaptures>) - - [func \(ss \*SettlementsService\) GetChargebacks\(ctx context.Context, settlement string, slo \*ChargebacksListOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#SettlementsService.GetChargebacks>) + - [func \(ss \*SettlementsService\) GetChargebacks\(ctx context.Context, settlement string, slo \*ListChargebacksOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#SettlementsService.GetChargebacks>) - [func \(ss \*SettlementsService\) GetRefunds\(ctx context.Context, settlement string, slo \*ListSettlementsOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#SettlementsService.GetRefunds>) - [func \(ss \*SettlementsService\) List\(ctx context.Context, slo \*ListSettlementsOptions\) \(res \*Response, sl \*SettlementsList, err error\)](<#SettlementsService.List>) - - [func \(ss \*SettlementsService\) ListPayments\(ctx context.Context, settlement string, options \*ListPaymentOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#SettlementsService.ListPayments>) + - [func \(ss \*SettlementsService\) ListPayments\(ctx context.Context, settlement string, options \*ListPaymentsOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#SettlementsService.ListPayments>) - [func \(ss \*SettlementsService\) Next\(ctx context.Context\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Next>) - [func \(ss \*SettlementsService\) Open\(ctx context.Context\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Open>) - [type Shipment](<#Shipment>) @@ -527,7 +527,7 @@ const ( ``` -## type [Balance]() +## type [Balance]() Balance holds the payments processed with Mollie once fees have been deducted. @@ -549,7 +549,7 @@ type Balance struct { ``` -## type [BalanceAmount]() +## type [BalanceAmount]() BalanceAmount wraps the std Amount type. @@ -560,7 +560,7 @@ type BalanceAmount struct { ``` -## type [BalanceGroupingFormat]() +## type [BalanceGroupingFormat]() BalanceGroupingFormat defines a grouping mechanism for transactions included in a balance report. @@ -578,7 +578,7 @@ const ( ``` -## type [BalanceLinks]() +## type [BalanceLinks]() BalanceLinks holds URL objects relevant to the balance. @@ -589,21 +589,8 @@ type BalanceLinks struct { } ``` - -## type [BalanceListOptions]() - -BalanceListOptions contains valid query parameters for the list balances endpoint. - -```go -type BalanceListOptions struct { - Currency string `url:"currency,omitempty"` - From string `url:"from,omitempty"` - Limit int `url:"limit,omitempty"` -} -``` - -## type [BalanceReport]() +## type [BalanceReport]() BalanceReport contains the common fields between different balance grouping options. @@ -621,7 +608,7 @@ type BalanceReport struct { ``` -## type [BalanceReportDetail]() +## type [BalanceReportDetail]() BalanceReportDetail contains the breakdown categories when grouping balance transactions. @@ -636,7 +623,7 @@ type BalanceReportDetail struct { ``` -## type [BalanceReportLinks]() +## type [BalanceReportLinks]() BalanceReportLinks holds URL objects relevant to the balance report. @@ -648,7 +635,7 @@ type BalanceReportLinks struct { ``` -## type [BalanceReportOptions]() +## type [BalanceReportOptions]() BalanceReportOptions contains valid query parameters for the list balances endpoint. @@ -661,7 +648,7 @@ type BalanceReportOptions struct { ``` -## type [BalanceReportTotalsGrouping]() +## type [BalanceReportTotalsGrouping]() BalanceReportTotalsGrouping contains the per totals grouped balances for the requested period. @@ -682,7 +669,7 @@ type BalanceReportTotalsGrouping struct { ``` -## type [BalanceStatus]() +## type [BalanceStatus]() BalanceStatus reflects whether a balance is operational or not. @@ -700,7 +687,7 @@ const ( ``` -## type [BalanceTransaction]() +## type [BalanceTransaction]() BalanceTransaction represents a the movement on your balance. @@ -718,7 +705,7 @@ type BalanceTransaction struct { ``` -## type [BalanceTransactionsList]() +## type [BalanceTransactionsList]() BalanceTransactionsList contains an array of embedded transactions. @@ -732,20 +719,8 @@ type BalanceTransactionsList struct { } ``` - -## type [BalanceTransactionsListOptions]() - -BalanceTransactionsListOptions are valid query parameters for list balance transactions requests. - -```go -type BalanceTransactionsListOptions struct { - From string `url:"from,omitempty"` - Limit int `url:"limit,omitempty"` -} -``` - -## type [BalancesList]() +## type [BalancesList]() BalancesList describes a list of captures. @@ -760,14 +735,12 @@ type BalancesList struct { ``` -## type [BalancesService]() +## type [BalancesService]() BalancesService allows you to retrieve real\-time as well as historical information about your Mollie balance. Works with Organization access tokens and App access tokens. -The API is in \*\*BETA\*\* so be careful and expect changes. - See: https://docs.mollie.com/reference/v2/balances-api/overview ```go @@ -775,7 +748,7 @@ type BalancesService service ``` -### func \(\*BalancesService\) [Get]() +### func \(\*BalancesService\) [Get]() ```go func (bs *BalancesService) Get(ctx context.Context, balance string) (res *Response, b *Balance, err error) @@ -786,7 +759,7 @@ GetBalance retrieves a balance by its id. See: https://docs.mollie.com/reference/v2/balances-api/get-balance -### func \(\*BalancesService\) [GetPrimaryReport]() +### func \(\*BalancesService\) [GetPrimaryReport]() ```go func (bs *BalancesService) GetPrimaryReport(ctx context.Context, options *BalanceReportOptions) (res *Response, br *BalanceReport, err error) @@ -797,10 +770,10 @@ GetPrimaryReport returns the report for the primary balance. See: https://docs.mollie.com/reference/v2/balances-api/get-primary-balance-report -### func \(\*BalancesService\) [GetPrimaryTransactionsList]() +### func \(\*BalancesService\) [GetPrimaryTransactionsList]() ```go -func (bs *BalancesService) GetPrimaryTransactionsList(ctx context.Context, options *BalanceTransactionsListOptions) (res *Response, btl *BalanceTransactionsList, err error) +func (bs *BalancesService) GetPrimaryTransactionsList(ctx context.Context, options *ListBalanceTransactionsOptions) (res *Response, btl *BalanceTransactionsList, err error) ``` GetPrimaryTransactionsList retrieves the list of movements \(transactions\) for the primary balance of the account. @@ -808,7 +781,7 @@ GetPrimaryTransactionsList retrieves the list of movements \(transactions\) for See: https://docs.mollie.com/reference/v2/balances-api/list-primary-balance-transactions -### func \(\*BalancesService\) [GetReport]() +### func \(\*BalancesService\) [GetReport]() ```go func (bs *BalancesService) GetReport(ctx context.Context, balance string, options *BalanceReportOptions) (res *Response, br *BalanceReport, err error) @@ -819,10 +792,10 @@ GetReport returns the balance report for the specified balance id. See: https://docs.mollie.com/reference/v2/balances-api/get-balance-report -### func \(\*BalancesService\) [GetTransactionsList]() +### func \(\*BalancesService\) [GetTransactionsList]() ```go -func (bs *BalancesService) GetTransactionsList(ctx context.Context, balance string, options *BalanceTransactionsListOptions) (res *Response, btl *BalanceTransactionsList, err error) +func (bs *BalancesService) GetTransactionsList(ctx context.Context, balance string, options *ListBalanceTransactionsOptions) (res *Response, btl *BalanceTransactionsList, err error) ``` GetTransactionsList retrieves a list of movements \(transactions\) for the specified balance. @@ -830,10 +803,10 @@ GetTransactionsList retrieves a list of movements \(transactions\) for the speci See: https://docs.mollie.com/reference/v2/balances-api/list-balance-transactions -### func \(\*BalancesService\) [List]() +### func \(\*BalancesService\) [List]() ```go -func (bs *BalancesService) List(ctx context.Context, options *BalanceListOptions) (res *Response, bl *BalancesList, err error) +func (bs *BalancesService) List(ctx context.Context, options *ListBalancesOptions) (res *Response, bl *BalancesList, err error) ``` List retrieves all the organization’s balances, including the primary balance, ordered from newest to oldest. @@ -841,7 +814,7 @@ List retrieves all the organization’s balances, including the primary balance, See: https://docs.mollie.com/reference/v2/balances-api/list-balances -### func \(\*BalancesService\) [Primary]() +### func \(\*BalancesService\) [Primary]() ```go func (bs *BalancesService) Primary(ctx context.Context) (res *Response, b *Balance, err error) @@ -1334,21 +1307,6 @@ type ChargebacksList struct { } ``` - -## type [ChargebacksListOptions]() - -ChargebacksListOptions describes list chargebacks endpoint valid query string parameters. - -```go -type ChargebacksListOptions struct { - 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"` -} -``` - ## type [ChargebacksService]() @@ -1373,7 +1331,7 @@ See: https://docs.mollie.com/reference/v2/chargebacks-api/get-chargeback ### func \(\*ChargebacksService\) [List]() ```go -func (cs *ChargebacksService) List(ctx context.Context, options *ChargebacksListOptions) (res *Response, cl *ChargebacksList, err error) +func (cs *ChargebacksService) List(ctx context.Context, options *ListChargebacksOptions) (res *Response, cl *ChargebacksList, err error) ``` List retrieves a list of chargebacks associated with your account/organization. @@ -1384,7 +1342,7 @@ See: https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks ### func \(\*ChargebacksService\) [ListForPayment]() ```go -func (cs *ChargebacksService) ListForPayment(ctx context.Context, payment string, options *ChargebacksListOptions) (res *Response, cl *ChargebacksList, err error) +func (cs *ChargebacksService) ListForPayment(ctx context.Context, payment string, options *ListChargebacksOptions) (res *Response, cl *ChargebacksList, err error) ``` ListForPayment retrieves a list of chargebacks associated with a single payment. @@ -1822,7 +1780,7 @@ func (c *Config) ToggleTesting() bool ToggleTesting enables/disables the test\-mode in the current Config. -## type [ContextValue]() +## type [ContextValue]() ContextValue represents a relevant value in the system associated with a BalanceTransaction. @@ -2184,21 +2142,6 @@ type CustomersList struct { } ``` - -## type [CustomersListOptions]() - -CustomersListOptions contains valid query parameters for the list customers endpoint. - -```go -type CustomersListOptions struct { - From string `url:"from,omitempty"` - Limit int `url:"limit,omitempty"` - ProfileID string `url:"profileId,omitempty"` - SequenceType SequenceType `url:"sequenceType,omitempty"` - RedirectURL string `url:"redirectUrl,omitempty"` -} -``` - ## type [CustomersService]() @@ -2258,7 +2201,7 @@ See: https://docs.mollie.com/reference/v2/customers-api/get-customer ### func \(\*CustomersService\) [GetPayments]() ```go -func (cs *CustomersService) GetPayments(ctx context.Context, id string, options *CustomersListOptions) (res *Response, pl *PaymentList, err error) +func (cs *CustomersService) GetPayments(ctx context.Context, id string, options *ListCustomersOptions) (res *Response, pl *PaymentList, err error) ``` GetPayments retrieves all payments linked to the customer. @@ -2269,7 +2212,7 @@ See: https://docs.mollie.com/reference/v2/customers-api/list-customer-payments ### func \(\*CustomersService\) [List]() ```go -func (cs *CustomersService) List(ctx context.Context, options *CustomersListOptions) (res *Response, cl *CustomersList, err error) +func (cs *CustomersService) List(ctx context.Context, options *ListCustomersOptions) (res *Response, cl *CustomersList, err error) ``` List retrieves all customers created. @@ -2629,20 +2572,6 @@ type InvoicesList struct { } ``` - -## type [InvoicesListOptions]() - -InvoicesListOptions describes list invoices endpoint valid query string parameters. - -```go -type InvoicesListOptions struct { - Limit int64 `url:"limit,omitempty"` - Reference string `url:"reference,omitempty"` - Year string `url:"year,omitempty"` - From string `url:"from,omitempty"` -} -``` - ## type [InvoicesService]() @@ -2665,7 +2594,7 @@ Get retrieve details of an invoice, using the invoice’s identifier. ### func \(\*InvoicesService\) [List]() ```go -func (is *InvoicesService) List(ctx context.Context, options *InvoicesListOptions) (res *Response, il *InvoicesList, err error) +func (is *InvoicesService) List(ctx context.Context, options *ListInvoicesOptions) (res *Response, il *InvoicesList, err error) ``` List retrieves a list of invoices associated with your account/organization. @@ -2746,6 +2675,75 @@ type LinkedClientList struct { } ``` + +## type [ListBalanceTransactionsOptions]() + +ListBalanceTransactionsOptions are valid query parameters for list balance transactions requests. + +```go +type ListBalanceTransactionsOptions struct { + From string `url:"from,omitempty"` + Limit int `url:"limit,omitempty"` +} +``` + + +## type [ListBalancesOptions]() + +ListBalancesOptions contains valid query parameters for the list balances endpoint. + +```go +type ListBalancesOptions struct { + Currency string `url:"currency,omitempty"` + From string `url:"from,omitempty"` + Limit int `url:"limit,omitempty"` +} +``` + + +## type [ListChargebacksOptions]() + +ListChargebacksOptions describes list chargebacks endpoint valid query string parameters. + +```go +type ListChargebacksOptions struct { + 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"` +} +``` + + +## type [ListCustomersOptions]() + +ListCustomersOptions contains valid query parameters for the list customers endpoint. + +```go +type ListCustomersOptions struct { + From string `url:"from,omitempty"` + Limit int `url:"limit,omitempty"` + ProfileID string `url:"profileId,omitempty"` + SequenceType SequenceType `url:"sequenceType,omitempty"` + RedirectURL string `url:"redirectUrl,omitempty"` +} +``` + + +## type [ListInvoicesOptions]() + +ListInvoicesOptions describes list invoices endpoint valid query string parameters. + +```go +type ListInvoicesOptions struct { + Limit int64 `url:"limit,omitempty"` + Reference string `url:"reference,omitempty"` + Year string `url:"year,omitempty"` + From string `url:"from,omitempty"` +} +``` + ## type [ListLinkedClientsOptions]() @@ -2759,13 +2757,74 @@ type ListLinkedClientsOptions struct { } ``` - -## type [ListPaymentOptions]() + +## type [ListMandatesOptions]() + +ListMandatesOptions contains valid query parameters to filter the List mandates actions. + +From is a mandate id to offset from \(inclusive\) Limit is the max number of mandates to retrieve. + +```go +type ListMandatesOptions struct { + Limit int `url:"limit,omitempty"` + From string `url:"from,omitempty"` +} +``` + + +## type [ListOrderRefundsOptions]() -ListPaymentOptions describes list payments endpoint valid query string parameters. +ListOrderRefundsOptions describes order endpoint valid query string parameters. ```go -type ListPaymentOptions struct { +type ListOrderRefundsOptions struct { + From string `url:"from,omitempty"` + Limit int `url:"limit,omitempty"` + Embed EmbedValue `url:"embed,omitempty"` +} +``` + + +## type [ListOrdersOptions]() + +ListOrdersOptions describes order endpoint valid query string parameters. + +```go +type ListOrdersOptions struct { + Limit int `url:"limit,omitempty"` + From string `url:"from,omitempty"` + Sort string `url:"sort,omitempty"` + ProfileID string `url:"profileId,omitempty"` +} +``` + + +## type [ListPaymentMethodsOptions]() + +ListPaymentMethodsOptions are applicable query string parameters to list methods from mollie's API. + +It contains list specific options and embeds GetMethodOptions. + +```go +type ListPaymentMethodsOptions struct { + PaymentMethodOptions + Resource string `url:"resource,omitempty"` + BillingCountry string `url:"billingCountry,omitempty"` + Amount *Amount `url:"amount,omitempty"` + IncludeWallets []Wallet `url:"includeWallets,omitempty"` + OrderLineCategories []OrderLineOperationProductCategory `url:"orderLineCategories,omitempty"` + Locale Locale `url:"locale,omitempty"` + SequenceType SequenceType `url:"sequenceType,omitempty"` +} +``` + + +## type [ListPaymentsOptions]() + +ListPaymentsOptions describes list payments endpoint valid query string parameters. + +```go +type ListPaymentsOptions struct { Limit int `url:"limit,omitempty"` Include []IncludeValue `url:"include,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` @@ -2774,6 +2833,32 @@ type ListPaymentOptions struct { } ``` + +## type [ListProfilesOptions]() + +ListProfilesOptions are optional query string parameters for the list profiles request. + +```go +type ListProfilesOptions struct { + Limit int `url:"limit,omitempty"` + From string `url:"from,omitempty"` +} +``` + + +## type [ListRefundsOptions]() + +ListRefundsOptions describes payment and order refunds list endpoint valid query string parameters. + +```go +type ListRefundsOptions struct { + Limit int `url:"limit,omitempty"` + From string `url:"from,omitempty"` + ProfileID string `url:"profileId,omitempty"` + Embed []EmbedValue `url:"embed,omitempty"` +} +``` + ## type [ListSettlementsOptions]() @@ -2943,20 +3028,6 @@ type MandatesList struct { } ``` - -## type [MandatesListOptions]() - -MandatesListOptions contains valid query parameters to filter the List mandates actions. - -From is a mandate id to offset from \(inclusive\) Limit is the max number of mandates to retrieve. - -```go -type MandatesListOptions struct { - Limit int `url:"limit,omitempty"` - From string `url:"from,omitempty"` -} -``` - ## type [MandatesService]() @@ -2994,7 +3065,7 @@ See: https://docs.mollie.com/reference/v2/mandates-api/get-mandate ### func \(\*MandatesService\) [List]() ```go -func (ms *MandatesService) List(ctx context.Context, customer string, options *MandatesListOptions) (res *Response, ml *MandatesList, err error) +func (ms *MandatesService) List(ctx context.Context, customer string, options *ListMandatesOptions) (res *Response, ml *MandatesList, err error) ``` List retrieves all mandates for the given customerId, ordered from newest to oldest. @@ -3056,7 +3127,7 @@ type MollieConnectPaymentFields struct { ``` -## type [Onboarding]() +## type [Onboarding]() Onboarding data for an organization. @@ -3073,7 +3144,7 @@ type Onboarding struct { ``` -## type [OnboardingData]() +## type [OnboardingData]() Full onboarding data to be submitted. @@ -3085,7 +3156,7 @@ type OnboardingData struct { ``` -## type [OnboardingDataOrganization]() +## type [OnboardingDataOrganization]() OnboardingDataOrganization contains data of the organization you want to provide. @@ -3100,7 +3171,7 @@ type OnboardingDataOrganization struct { ``` -## type [OnboardingDataProfile]() +## type [OnboardingDataProfile]() OnboardingDataProfile contains data of the payment profile you want to provide. @@ -3116,7 +3187,7 @@ type OnboardingDataProfile struct { ``` -## type [OnboardingLinks]() +## type [OnboardingLinks]() OnboardingLinks contains URL objects relevant to the onboarding status. @@ -3130,7 +3201,7 @@ type OnboardingLinks struct { ``` -## type [OnboardingService]() +## type [OnboardingService]() OnboardingService operates over the onboarding API. @@ -3139,7 +3210,7 @@ type OnboardingService service ``` -### func \(\*OnboardingService\) [GetOnboardingStatus]() +### func \(\*OnboardingService\) [GetOnboardingStatus]() ```go func (os *OnboardingService) GetOnboardingStatus(ctx context.Context) (res *Response, o *Onboarding, err error) @@ -3428,63 +3499,6 @@ type OrderLinks struct { } ``` - -## type [OrderList]() - -OrderList for containing the response of list orders. - -```go -type OrderList struct { - Count int `json:"count,omitempty"` - Embedded struct { - Orders []*Order `json:"orders,omitempty"` - } `json:"_embedded,omitempty"` - Links PaginationLinks `json:"links,omitempty"` -} -``` - - -## type [OrderListOptions]() - -OrderListOptions describes order endpoint valid query string parameters. - -```go -type OrderListOptions struct { - Limit int `url:"limit,omitempty"` - From string `url:"from,omitempty"` - Sort string `url:"sort,omitempty"` - ProfileID string `url:"profileId,omitempty"` -} -``` - - -## type [OrderListRefund]() - -OrderListRefund for containing the response of list orders. - -```go -type OrderListRefund struct { - Count int `json:"count,omitempty"` - Embedded struct { - Refunds []*Refund `json:"refund,omitempty"` - } `json:"_embedded,omitempty"` - Links PaginationLinks `json:"links,omitempty"` -} -``` - - -## type [OrderListRefundOptions]() - -OrderListRefundOptions describes order endpoint valid query string parameters. - -```go -type OrderListRefundOptions struct { - From string `url:"from,omitempty"` - Limit int `url:"limit,omitempty"` - Embed EmbedValue `url:"embed,omitempty"` -} -``` - ## type [OrderOptions]() @@ -3542,6 +3556,21 @@ type OrderRefundLine struct { } ``` + +## type [OrderRefundsList]() + +OrderRefundsList for containing the response of list orders. + +```go +type OrderRefundsList struct { + Count int `json:"count,omitempty"` + Embedded struct { + Refunds []*Refund `json:"refund,omitempty"` + } `json:"_embedded,omitempty"` + Links PaginationLinks `json:"links,omitempty"` +} +``` + ## type [OrderStatus]() @@ -3565,6 +3594,21 @@ const ( ) ``` + +## type [OrdersList]() + +OrdersList for containing the response of list orders. + +```go +type OrdersList struct { + Count int `json:"count,omitempty"` + Embedded struct { + Orders []*Order `json:"orders,omitempty"` + } `json:"_embedded,omitempty"` + Links PaginationLinks `json:"links,omitempty"` +} +``` + ## type [OrdersService]() @@ -3644,7 +3688,7 @@ See https://docs.mollie.com/reference/v2/orders-api/get-order ### func \(\*OrdersService\) [List]() ```go -func (ors *OrdersService) List(ctx context.Context, opts *OrderListOptions) (res *Response, ordList *OrderList, err error) +func (ors *OrdersService) List(ctx context.Context, opts *ListOrdersOptions) (res *Response, ordList *OrdersList, err error) ``` List is to retrieve all orders. @@ -3655,7 +3699,7 @@ See https://docs.mollie.com/reference/v2/orders-api/list-orders ### func \(\*OrdersService\) [ListOrderRefunds]() ```go -func (ors *OrdersService) ListOrderRefunds(ctx context.Context, orderID string, opts *OrderListRefundOptions) (res *Response, orderListRefund *OrderListRefund, err error) +func (ors *OrdersService) ListOrderRefunds(ctx context.Context, orderID string, opts *ListOrderRefundsOptions) (res *Response, orderListRefund *OrderRefundsList, err error) ``` ListOrderRefunds retrieve all order refunds. @@ -4034,9 +4078,9 @@ PaymentLinkOptions represents query string parameters to modify the payment link ```go type PaymentLinkOptions struct { + Limit int `url:"limit,omitempty"` ProfileID string `url:"profileId,omitempty"` From string `url:"from,omitempty"` - Limit int `url:"limit,omitempty"` } ``` @@ -4270,26 +4314,6 @@ type PaymentMethodsList struct { } ``` - -## type [PaymentMethodsListOptions]() - -PaymentMethodsListOptions are applicable query string parameters to list methods from mollie's API. - -It contains list specific options and embeds GetMethodOptions. - -```go -type PaymentMethodsListOptions struct { - PaymentMethodOptions - Resource string `url:"resource,omitempty"` - BillingCountry string `url:"billingCountry,omitempty"` - Amount *Amount `url:"amount,omitempty"` - IncludeWallets []Wallet `url:"includeWallets,omitempty"` - OrderLineCategories []OrderLineOperationProductCategory `url:"orderLineCategories,omitempty"` - Locale Locale `url:"locale,omitempty"` - SequenceType SequenceType `url:"sequenceType,omitempty"` -} -``` - ## type [PaymentMethodsService]() @@ -4303,7 +4327,7 @@ type PaymentMethodsService service ### func \(\*PaymentMethodsService\) [All]() ```go -func (ms *PaymentMethodsService) All(ctx context.Context, options *PaymentMethodsListOptions) (res *Response, pm *PaymentMethodsList, err error) +func (ms *PaymentMethodsService) All(ctx context.Context, options *ListPaymentMethodsOptions) (res *Response, pm *PaymentMethodsList, err error) ``` All retrieves all the payment methods enabled for your account/organization. @@ -4325,7 +4349,7 @@ See: https://docs.mollie.com/reference/v2/methods-api/get-method ### func \(\*PaymentMethodsService\) [List]() ```go -func (ms *PaymentMethodsService) List(ctx context.Context, options *PaymentMethodsListOptions) (res *Response, pm *PaymentMethodsList, err error) +func (ms *PaymentMethodsService) List(ctx context.Context, options *ListPaymentMethodsOptions) (res *Response, pm *PaymentMethodsList, err error) ``` List retrieves all enabled payment methods. @@ -4439,7 +4463,7 @@ Get retrieves a single payment object by its payment token. ### func \(\*PaymentsService\) [List]() ```go -func (ps *PaymentsService) List(ctx context.Context, opts *ListPaymentOptions) (res *Response, pl *PaymentList, err error) +func (ps *PaymentsService) List(ctx context.Context, opts *ListPaymentsOptions) (res *Response, pl *PaymentList, err error) ``` List retrieves a list of payments associated with your account/organization. @@ -4661,33 +4685,6 @@ type ProfileLinks struct { } ``` - -## type [ProfileList]() - -ProfileList contains a list of profiles for your account. - -```go -type ProfileList struct { - Count int `json:"count,omitempty"` - Embedded struct { - Profiles []*Profile `json:"profiles,omitempty"` - } `json:"_embedded,omitempty"` - Links PaginationLinks `json:"_links,omitempty"` -} -``` - - -## type [ProfileListOptions]() - -ProfileListOptions are optional query string parameters for the list profiles request. - -```go -type ProfileListOptions struct { - Limit int `url:"limit,omitempty"` - From string `url:"from,omitempty"` -} -``` - ## type [ProfileReview]() @@ -4736,6 +4733,21 @@ const ( ) ``` + +## type [ProfilesList]() + +ProfilesList contains a list of profiles for your account. + +```go +type ProfilesList struct { + Count int `json:"count,omitempty"` + Embedded struct { + Profiles []*Profile `json:"profiles,omitempty"` + } `json:"_embedded,omitempty"` + Links PaginationLinks `json:"_links,omitempty"` +} +``` + ## type [ProfilesService]() @@ -4887,7 +4899,7 @@ Get retrieves the a profile by ID. ### func \(\*ProfilesService\) [List]() ```go -func (ps *ProfilesService) List(ctx context.Context, opts *ProfileListOptions) (res *Response, pl *ProfileList, err error) +func (ps *ProfilesService) List(ctx context.Context, opts *ListProfilesOptions) (res *Response, pl *ProfilesList, err error) ``` List returns all the profiles for the authenticated account. @@ -5016,20 +5028,6 @@ type RefundsList struct { } ``` - -## type [RefundsListOptions]() - -RefundsListOptions describes payment and order refunds list endpoint valid query string parameters. - -```go -type RefundsListOptions struct { - Limit int `url:"limit,omitempty"` - From string `url:"from,omitempty"` - ProfileID string `url:"profileId,omitempty"` - Embed []EmbedValue `url:"embed,omitempty"` -} -``` - ## type [RefundsService]() @@ -5087,7 +5085,7 @@ See: https://docs.mollie.com/reference/v2/refunds-api/get-payment-refund ### func \(\*RefundsService\) [List]() ```go -func (rs *RefundsService) List(ctx context.Context, opts *RefundsListOptions) (res *Response, rl *RefundsList, err error) +func (rs *RefundsService) List(ctx context.Context, opts *ListRefundsOptions) (res *Response, rl *RefundsList, err error) ``` List retrieves all refunds. @@ -5098,7 +5096,7 @@ See https://docs.mollie.com/reference/v2/refunds-api/list-refunds. ### func \(\*RefundsService\) [ListOrderRefunds]() ```go -func (rs *RefundsService) ListOrderRefunds(ctx context.Context, orderID string, opts *RefundsListOptions) (res *Response, rl *RefundsList, err error) +func (rs *RefundsService) ListOrderRefunds(ctx context.Context, orderID string, opts *ListRefundsOptions) (res *Response, rl *RefundsList, err error) ``` ListOrderRefunds retrieves all refunds for a specific order. @@ -5109,7 +5107,7 @@ See https://docs.mollie.com/reference/v2/refunds-api/list-order-refunds ### func \(\*RefundsService\) [ListPaymentRefunds]() ```go -func (rs *RefundsService) ListPaymentRefunds(ctx context.Context, paymentID string, opts *RefundsListOptions) (res *Response, rl *RefundsList, err error) +func (rs *RefundsService) ListPaymentRefunds(ctx context.Context, paymentID string, opts *ListRefundsOptions) (res *Response, rl *RefundsList, err error) ``` ListPaymentRefunds retrieves all refunds for a specific payment. @@ -5335,7 +5333,7 @@ See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-captur ### func \(\*SettlementsService\) [GetChargebacks]() ```go -func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ChargebacksListOptions) (res *Response, cl *ChargebacksList, err error) +func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ListChargebacksOptions) (res *Response, cl *ChargebacksList, err error) ``` GetChargebacks retrieves all chargebacks included in a settlement. @@ -5368,7 +5366,7 @@ See: https://docs.mollie.com/reference/v2/settlements-api/list-settlements ### func \(\*SettlementsService\) [ListPayments]() ```go -func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentOptions) (res *Response, pl *PaymentList, err error) +func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentsOptions) (res *Response, pl *PaymentList, err error) ``` ListPayments retrieves all payments included in a settlement. This API is an alias of the List payments. @@ -5729,7 +5727,7 @@ Update changes fields on a subscription object See: https://docs.mollie.com/reference/v2/subscriptions-api/update-subscription -## type [Subtotal]() +## type [Subtotal]() Subtotal balance descriptor. @@ -5826,7 +5824,7 @@ func (ts *TerminalsService) List(ctx context.Context, options *ListTerminalsOpti List retrieves a list of terminals symbolizing the physical devices to receive payments. -## type [TransactionType]() +## type [TransactionType]() TransactionType specifies the reason for the movement. @@ -5859,7 +5857,7 @@ const ( ``` -## type [TransferDestination]() +## type [TransferDestination]() TransferDestination where the available amount will be automatically transferred. @@ -5872,7 +5870,7 @@ type TransferDestination struct { ``` -## type [TransferFrequency]() +## type [TransferFrequency]() TransferFrequency reflects the frequency at which the available amount on the balance will be settled to the configured transfer destination.