Skip to content

Commit

Permalink
Merge pull request #146 from VictorAvelar/feature/add-new-gift-card-i…
Browse files Browse the repository at this point in the history
…ssuers

add new gift card issuers
  • Loading branch information
VictorAvelar authored Aug 14, 2021
2 parents 4dd6fa7 + 6b8c3a2 commit e30847d
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 1 deletion.
110 changes: 110 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ type Client struct {
Mandates *MandatesService
Permissions *PermissionsService
Onboarding *OnboardingService
PaymentLinks *PaymentLinksService
}
```

Expand Down Expand Up @@ -738,6 +739,7 @@ GiftCardIssuer type describes issuers supported by mollie.
```go
const (
BloemenCadeuKaart GiftCardIssuer = "bloemencadeaukaart"
BloemPlantGiftCard GiftCardIssuer = "bloemplantgiftcard"
Boekenbon GiftCardIssuer = "boekenbon"
DecaudeuKaart GiftCardIssuer = "decadeaukaart"
DelokaleDecauKaart GiftCardIssuer = "delokalecadeaukaart"
Expand All @@ -754,6 +756,7 @@ const (
Podiumcadeaukaart GiftCardIssuer = "podiumcadeaukaart"
Reiscadeau GiftCardIssuer = "reiscadeau"
Restaurantcadeau GiftCardIssuer = "restaurantcadeau"
SodexoSportCulturePass GiftCardIssuer = "sodexosportculturepass"
Sportenfitcadeau GiftCardIssuer = "sportenfitcadeau"
Sustainablefashion GiftCardIssuer = "sustainablefashion"
Travelcheq GiftCardIssuer = "travelcheq"
Expand Down Expand Up @@ -1977,6 +1980,61 @@ type PaymentDetailsAddress struct {
PaymentDetailsAddress identify both the address and the person the payment is
shipped to.

#### type PaymentLink

```go
type PaymentLink struct {
ID string `json:"id,omitempty"`
Resource string `json:"resource,omitempty"`
Description string `json:"description,omitempty"`
ProfileID string `json:"profileId,omitempty"`
RedirectURL string `json:"redirectUrl,omitempty"`
WebhookURL string `json:"webhookUrl,omitempty"`
Mode Mode `json:"mode,omitempty"`
Amount Amount `json:"amount,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
PaidAt *time.Time `json:"paidAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
Links PaymentLinkLinks `json:"_links,omitempty"`
}
```

PaymentLink is a resource that can be shared with your customers and will
redirect them to them the payment page where they can complete the payment.

See: https://docs.mollie.com/reference/v2/payment-links-api/get-payment-link

#### type PaymentLinkLinks

```go
type PaymentLinkLinks struct {
Self *URL `json:"self,omitempty"`
Documentation *URL `json:"documentation,omitempty"`
PaymentLink *URL `json:"paymentLink,omitempty"`
Next *URL `json:"next,omitempty"`
Previous *URL `json:"previous,omitempty"`
}
```

PaymentLinkLinks describes all the possible links returned with a payment link
struct.

See: https://docs.mollie.com/reference/v2/payment-links-api/get-payment-link

#### type PaymentLinkOptions

```go
type PaymentLinkOptions struct {
ProfileID string `url:"profileId,omitempty"`
From string `url:"from,omitemtpy"`
Limit int `url:"limit,omitempty"`
}
```

PaymentLinkOptions represents query string parameters to modify the payment
links requests.

#### type PaymentLinks

```go
Expand All @@ -2000,6 +2058,58 @@ type PaymentLinks struct {
PaymentLinks describes all the possible links to be returned with a payment
object.

#### type PaymentLinksList

```go
type PaymentLinksList struct {
Count int `json:"count,omitempty"`
Links PaymentLinkLinks `json:"_links,omitempty"`
Embedded struct {
PaymentLinks []*PaymentLink `json:"payment_links,omitempty"`
} `json:"_embedded,omitempty"`
}
```

#### type PaymentLinksService

```go
type PaymentLinksService service
```

PaymentLinksService operates over the payment link resource.

#### func (\*PaymentLinksService) Create

```go
func (pls *PaymentLinksService) Create(p PaymentLink, opts *PaymentLinkOptions) (np *PaymentLink, err error)
```

Create generates payment links that by default, unlike regular payments, do not
expire.

See: https://docs.mollie.com/reference/v2/payment-links-api/create-payment-link

#### func (\*PaymentLinksService) Get

```go
func (pls *PaymentLinksService) Get(id string) (pl *PaymentLink, err error)
```

Get retrieves a single payment link object by its id/token.

See: https://docs.mollie.com/reference/v2/payment-links-api/get-payment-link

#### func (\*PaymentLinksService) List

```go
func (pls *PaymentLinksService) List(opts *PaymentLinkOptions) (pl *PaymentLinksList, err error)
```

List retrieves all payments links created with the current website profile,
ordered from newest to oldest.

See: https://docs.mollie.com/reference/v2/payment-links-api/list-payment-links

#### type PaymentList

```go
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.15

require (
github.com/google/go-querystring v1.1.0
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
2 changes: 2 additions & 0 deletions mollie/gift_cards.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type GiftCardIssuer string
// Supported gift card issuers
const (
BloemenCadeuKaart GiftCardIssuer = "bloemencadeaukaart"
BloemPlantGiftCard GiftCardIssuer = "bloemplantgiftcard"
Boekenbon GiftCardIssuer = "boekenbon"
DecaudeuKaart GiftCardIssuer = "decadeaukaart"
DelokaleDecauKaart GiftCardIssuer = "delokalecadeaukaart"
Expand All @@ -26,6 +27,7 @@ const (
Podiumcadeaukaart GiftCardIssuer = "podiumcadeaukaart"
Reiscadeau GiftCardIssuer = "reiscadeau"
Restaurantcadeau GiftCardIssuer = "restaurantcadeau"
SodexoSportCulturePass GiftCardIssuer = "sodexosportculturepass"
Sportenfitcadeau GiftCardIssuer = "sportenfitcadeau"
Sustainablefashion GiftCardIssuer = "sustainablefashion"
Travelcheq GiftCardIssuer = "travelcheq"
Expand Down

0 comments on commit e30847d

Please sign in to comment.