From c91e54538c3d0665bee96bad5706ee56e706794d Mon Sep 17 00:00:00 2001 From: Victor Hugo Avelar Ossorio Date: Tue, 8 Aug 2023 17:04:37 +0000 Subject: [PATCH] chore(docs): update generated docs --- Makefile | 1 + docs/README.md | 45 +++++++++++++++++++++++++++++++++ docs/tools/pagination/README.md | 24 ++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 docs/tools/pagination/README.md diff --git a/Makefile b/Makefile index 9e82e275..bfb6ec5c 100644 --- a/Makefile +++ b/Makefile @@ -58,4 +58,5 @@ sub-pkg-docs: @godocdown ./mollie/connect > docs/connect/README.md @godocdown ./mollie/tools > docs/tools/README.md @godocdown ./mollie/tools/idempotency > docs/tools/idempotency/README.md + @godocdown ./mollie/tools/pagination > docs/tools/pagination/README.md .PHONY: sub-pkg-docs diff --git a/docs/README.md b/docs/README.md index 035082a7..1574727f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -48,6 +48,8 @@ response body. ```go type Address struct { + GivenName string `json:"givenName,omitempty"` + FamilyName string `json:"familyName,omitempty"` StreetAndNumber string `json:"streetAndNumber,omitempty"` StreetAdditional string `json:"streetAdditional,omitempty"` PostalCode string `json:"postalCode,omitempty"` @@ -1013,6 +1015,19 @@ type Commission struct { Commission describes a partner take from any operation on Mollie's API. +#### type Company + +```go +type Company struct { + RegistrationNumber string `json:"registrationNumber,omitempty"` + VATNumber string `json:"vatNumber,omitempty"` + EntityType EntityType `json:"entityType,omitempty"` +} +``` + +Company information that allows to identify the business that is interacting +with Mollie. + #### type Config ```go @@ -1336,6 +1351,31 @@ const ( Valid Embed query string value. +#### type EntityType + +```go +type EntityType string +``` + +EntityType for an organization. + +```go +const ( + LimitedCompany EntityType = "limited-company" + PublicLimitedCompany EntityType = "public-limited-company" + EntrepreneurialCompany EntityType = "entrepreneurial-company" + LimitedPartnershipLimitedCompany EntityType = "limited-partnership-limited-company" + LimitedPartnership EntityType = "limited-partnership" + GeneralPartnership EntityType = "general-partnership" + RegisteredSoleTrader EntityType = "registered-sole-trader" + SoleTrader EntityType = "sole-trader" + CivilLawPartnership EntityType = "civil-law-partnership" + PublicInstitution EntityType = "public-institution" +) +``` + +Supported entity types. + #### type ErrorLinks ```go @@ -2027,6 +2067,10 @@ 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. +This endpoint has been deprecated. It will be supported for the foreseeable +future, but new implementations should use the Create client link endpoint to +create new clients and submit their organization’s details in one go. + See: #### type OnboardingStatus @@ -2829,6 +2873,7 @@ type Payment struct { Method PaymentMethod `json:"method,omitempty"` Links PaymentLinks `json:"_links,omitempty"` SequenceType SequenceType `json:"sequenceType,omitempty"` + Company Company `json:"company,omitempty"` } ``` diff --git a/docs/tools/pagination/README.md b/docs/tools/pagination/README.md new file mode 100644 index 00000000..d730f5e6 --- /dev/null +++ b/docs/tools/pagination/README.md @@ -0,0 +1,24 @@ +# pagination + +-- + import "github.com/VictorAvelar/mollie-api-go/v3/mollie/tools/pagination" + +Package pagination provides utilities to handle pagination in API responses. + +Pagination is a common feature in APIs that allows retrieval of large datasets +in smaller chunks, enhancing performance and resource usage. This package aims +to simplify pagination-related tasks by providing helpful functions. + +## Usage + +#### func ExtractFromQueryParam + +```go +func ExtractFromQueryParam(uri string) (lastID string, err error) +``` + +ExtractFromQueryParam extracts the lastID from the given URI, which is assumed +to be a URL with query parameters. It specifically looks for a query parameter +named 'from' and returns its value as a string. If the URI cannot be parsed or +the query parameter is not found, it returns an empty string and the encountered +error.