client

package module
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2025 License: BSD-2-Clause Imports: 13 Imported by: 0

README

client

Developer-friendly & type-safe Go SDK specifically catered to leverage client API.

Summary

Table of Contents

SDK Installation

To add the SDK as a dependency to your project:

go get github.com/mollie/mollie-api-golang

SDK Example Usage

Example
package main

import (
	"context"
	client "github.com/mollie/mollie-api-golang"
	"github.com/mollie/mollie-api-golang/models/components"
	"github.com/mollie/mollie-api-golang/models/operations"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := client.New(
		client.WithSecurity(components.Security{
			APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
		}),
	)

	res, err := s.Balances.List(ctx, operations.ListBalancesRequest{
		Currency:       client.Pointer("EUR"),
		From:           client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
		Limit:          client.Pointer[int64](50),
		Testmode:       client.Pointer(false),
		IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.Object != nil {
		// handle response
	}
}

Authentication

Per-Client Security Schemes

This SDK supports the following security schemes globally:

Name Type Scheme Environment Variable
APIKey http HTTP Bearer CLIENT_API_KEY
OAuth oauth2 OAuth2 token CLIENT_O_AUTH

You can set the security parameters through the WithSecurity option when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:

package main

import (
	"context"
	client "github.com/mollie/mollie-api-golang"
	"github.com/mollie/mollie-api-golang/models/components"
	"github.com/mollie/mollie-api-golang/models/operations"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := client.New(
		client.WithSecurity(components.Security{
			APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
		}),
	)

	res, err := s.Balances.List(ctx, operations.ListBalancesRequest{
		Currency:       client.Pointer("EUR"),
		From:           client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
		Limit:          client.Pointer[int64](50),
		Testmode:       client.Pointer(false),
		IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.Object != nil {
		// handle response
	}
}

Idempotency Key

This SDK supports the usage of Idempotency Keys. See our documentation on how to use it.

package main

import(
	"context"
	"os"
	"github.com/mollie/mollie-api-golang/models/components"
	client "github.com/mollie/mollie-api-golang"
	"log"
)

func main() {
    ctx := context.Background()

    s := client.New(
        client.WithSecurity(components.Security{
            APIKey: client.Pointer(os.Getenv("MOLLIE_API_KEY")),
        }),
    )

	request := &components.PaymentRequest{
		Description: client.Pointer("Description"),
		Amount: &components.Amount{
			Currency: "EUR",
			Value: "5.00",
		},
		RedirectURL: client.Pointer("https://example.org/redirect"),
	}

	idempotencyKey := client.Pointer("<some-idempotency-key>")

    payment1, _ := s.Payments.Create(
		ctx,
		nil, idempotencyKey,
		request,
	)

	payment2, _ := s.Payments.Create(
		ctx,
		nil, idempotencyKey,
		request,
	)

	log.Println("Payment with ID:", *payment1.PaymentResponse.ID)
	log.Println("Payment with ID:", *payment2.PaymentResponse.ID)

	if *payment1.PaymentResponse.ID == *payment2.PaymentResponse.ID {
		log.Println("Payments are the same")
	} else {
		log.Println("Payments are different")
	}
}

Available Resources and Operations

Available methods
Balances
BalanceTransfers
  • Create - Create a Connect balance transfer
  • List - List all Connect balance transfers
  • Get - Get a Connect balance transfer
Capabilities
  • List - List capabilities
Captures
Chargebacks
  • List - List payment chargebacks
  • Get - Get payment chargeback
  • All - List all chargebacks
Clients
  • List - List clients
  • Get - Get client
Customers
DelayedRouting
  • Create - Create a delayed route
  • List - List payment routes
Invoices
  • List - List invoices
  • Get - Get invoice
Mandates
Methods
  • List - List payment methods
  • All - List all payment methods
  • Get - Get payment method
Onboarding
  • Get - Get onboarding status
  • Submit - Submit onboarding data
Organizations
Payments
Permissions
  • List - List permissions
  • Get - Get permission
Profiles
Refunds
  • Create - Create payment refund
  • List - List payment refunds
  • Get - Get payment refund
  • Cancel - Cancel payment refund
  • All - List all refunds
SalesInvoices
  • Create - Create sales invoice
  • List - List sales invoices
  • Get - Get sales invoice
  • Update - Update sales invoice
  • Delete - Delete sales invoice
Settlements
Subscriptions
  • Create - Create subscription
  • List - List customer subscriptions
  • Get - Get subscription
  • Update - Update subscription
  • Cancel - Cancel subscription
  • All - List all subscriptions
  • ListPayments - List subscription payments
Terminals
  • List - List terminals
  • Get - Get terminal
Wallets
WebhookEvents
  • Get - Get a Webhook Event
Webhooks
  • Create - Create a webhook
  • List - List all webhooks
  • Update - Update a webhook
  • Get - Get a webhook
  • Delete - Delete a webhook
  • Test - Test a webhook

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retry.Config object to the call by using the WithRetries option:

package main

import (
	"context"
	client "github.com/mollie/mollie-api-golang"
	"github.com/mollie/mollie-api-golang/models/components"
	"github.com/mollie/mollie-api-golang/models/operations"
	"github.com/mollie/mollie-api-golang/retry"
	"log"
	"models/operations"
	"os"
)

func main() {
	ctx := context.Background()

	s := client.New(
		client.WithSecurity(components.Security{
			APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
		}),
	)

	res, err := s.Balances.List(ctx, operations.ListBalancesRequest{
		Currency:       client.Pointer("EUR"),
		From:           client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
		Limit:          client.Pointer[int64](50),
		Testmode:       client.Pointer(false),
		IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
	}, operations.WithRetries(
		retry.Config{
			Strategy: "backoff",
			Backoff: &retry.BackoffStrategy{
				InitialInterval: 1,
				MaxInterval:     50,
				Exponent:        1.1,
				MaxElapsedTime:  100,
			},
			RetryConnectionErrors: false,
		}))
	if err != nil {
		log.Fatal(err)
	}
	if res.Object != nil {
		// handle response
	}
}

If you'd like to override the default retry strategy for all operations that support retries, you can use the WithRetryConfig option at SDK initialization:

package main

import (
	"context"
	client "github.com/mollie/mollie-api-golang"
	"github.com/mollie/mollie-api-golang/models/components"
	"github.com/mollie/mollie-api-golang/models/operations"
	"github.com/mollie/mollie-api-golang/retry"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := client.New(
		client.WithRetryConfig(
			retry.Config{
				Strategy: "backoff",
				Backoff: &retry.BackoffStrategy{
					InitialInterval: 1,
					MaxInterval:     50,
					Exponent:        1.1,
					MaxElapsedTime:  100,
				},
				RetryConnectionErrors: false,
			}),
		client.WithSecurity(components.Security{
			APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
		}),
	)

	res, err := s.Balances.List(ctx, operations.ListBalancesRequest{
		Currency:       client.Pointer("EUR"),
		From:           client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
		Limit:          client.Pointer[int64](50),
		Testmode:       client.Pointer(false),
		IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.Object != nil {
		// handle response
	}
}

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.

By Default, an API error will return apierrors.APIError. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective Errors tables in SDK docs for more details on possible error types for each operation.

For example, the List function may return the following errors:

Error Type Status Code Content Type
apierrors.ErrorResponse 400, 404 application/hal+json
apierrors.APIError 4XX, 5XX */*
Example
package main

import (
	"context"
	"errors"
	client "github.com/mollie/mollie-api-golang"
	"github.com/mollie/mollie-api-golang/models/apierrors"
	"github.com/mollie/mollie-api-golang/models/components"
	"github.com/mollie/mollie-api-golang/models/operations"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := client.New(
		client.WithSecurity(components.Security{
			APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
		}),
	)

	res, err := s.Balances.List(ctx, operations.ListBalancesRequest{
		Currency:       client.Pointer("EUR"),
		From:           client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
		Limit:          client.Pointer[int64](50),
		Testmode:       client.Pointer(false),
		IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
	})
	if err != nil {

		var e *apierrors.ErrorResponse
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}

		var e *apierrors.APIError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}
	}
}

Server Selection

Override Server URL Per-Client

The default server can be overridden globally using the WithServerURL(serverURL string) option when initializing the SDK client instance. For example:

package main

import (
	"context"
	client "github.com/mollie/mollie-api-golang"
	"github.com/mollie/mollie-api-golang/models/components"
	"github.com/mollie/mollie-api-golang/models/operations"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := client.New(
		client.WithServerURL("https://api.mollie.com/v2"),
		client.WithSecurity(components.Security{
			APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
		}),
	)

	res, err := s.Balances.List(ctx, operations.ListBalancesRequest{
		Currency:       client.Pointer("EUR"),
		From:           client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
		Limit:          client.Pointer[int64](50),
		Testmode:       client.Pointer(false),
		IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.Object != nil {
		// handle response
	}
}

Custom HTTP Client

The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

The built-in net/http client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.

import (
	"net/http"
	"time"

	"github.com/mollie/mollie-api-golang"
)

var (
	httpClient = &http.Client{Timeout: 30 * time.Second}
	sdkClient  = client.New(client.WithClient(httpClient))
)

This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.

Special Types

This SDK defines the following custom types to assist with marshalling and unmarshalling data.

Date

types.Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".

Usage
d1 := types.NewDate(time.Now()) // returns *types.Date

d2 := types.DateFromTime(time.Now()) // returns types.Date

d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error

d4, err := types.DateFromString("2019-01-01") // returns types.Date, error

d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error

d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

SDK Created by Speakeasy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = []string{
	"https://api.mollie.com/v2",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type BalanceTransfers added in v0.5.1

type BalanceTransfers struct {
	// contains filtered or unexported fields
}

func (*BalanceTransfers) Create added in v0.5.1

Create a Connect balance transfer This API endpoint allows you to create a balance transfer from your organization's balance to a connected organization's balance, or vice versa. You can also create a balance transfer between two connected organizations. To create a balance transfer, you must be authenticated as the source organization, and the destination organization must be a connected organization that has authorized the `balance-transfers.write` scope for your organization.

func (*BalanceTransfers) Get added in v0.5.1

func (s *BalanceTransfers) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetConnectBalanceTransferResponse, error)

Get a Connect balance transfer Retrieve a single Connect balance transfer object by its ID.

func (*BalanceTransfers) List added in v0.5.1

List all Connect balance transfers Returns a paginated list of balance transfers associated with your organization. These may be a balance transfer that was received or sent from your balance, or a balance transfer that you initiated on behalf of your clients. If no balance transfers are available, the resulting array will be empty. This request should never throw an error.

type Balances

type Balances struct {
	// contains filtered or unexported fields
}

func (*Balances) Get

func (s *Balances) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetBalanceResponse, error)

Get balance When processing payments with Mollie, we put all pending funds — usually minus Mollie fees — on a balance. Once you have linked a bank account to your Mollie account, we can pay out your balance towards this bank account.

With the Balances API you can retrieve your current balance. The response includes two amounts:

* The *pending amount*. These are payments that have been marked as `paid`, but are not yet available on your balance. * The *available amount*. This is the amount that you can get paid out to your bank account, or use for refunds.

With instant payment methods like iDEAL, payments are moved to the available balance instantly. With slower payment methods, like credit card for example, it can take a few days before the funds are available on your balance. These funds will be shown under the *pending amount* in the meanwhile.

func (*Balances) GetPrimary

func (s *Balances) GetPrimary(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetPrimaryBalanceResponse, error)

GetPrimary - Get primary balance Retrieve the primary balance. This is the balance of your account's primary currency, where all payments are settled to by default.

This endpoint is a convenient alias of the [Get balance](get-balance) endpoint.

func (*Balances) GetReport

GetReport - Get balance report Retrieve a summarized report for all transactions on a given balance within a given timeframe.

The API also provides a detailed report on all 'prepayments' for Mollie fees that were deducted from your balance during the reported period, ahead of your Mollie invoice.

The alias `primary` can be used instead of the balance ID to refer to the organization's primary balance.

func (*Balances) List

List balances Retrieve a list of the organization's balances, including the primary balance.

The results are paginated.

func (*Balances) ListTransactions

ListTransactions - List balance transactions Retrieve a list of all balance transactions. Transactions include for example payments, refunds, chargebacks, and settlements.

For an aggregated report of these balance transactions, refer to the [Get balance report](get-balance-report) endpoint.

The alias `primary` can be used instead of the balance ID to refer to the organization's primary balance.

The results are paginated.

type Capabilities

type Capabilities struct {
	// contains filtered or unexported fields
}

func (*Capabilities) List

func (s *Capabilities) List(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.ListCapabilitiesResponse, error)

List capabilities > 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

Retrieve a list of capabilities for an organization.

This API provides detailed insights into the specific requirements and status of each client's onboarding journey.

Capabilities are at the organization level, indicating if the organization can perform a given capability.

For payments, regardless them being at the profile level, the capability is listed at the organization level. This means that if at least one of the clients's profiles can receive payments, the payments capability is enabled, communicating that the organization can indeed receive payments.

type Captures

type Captures struct {
	// contains filtered or unexported fields
}

func (*Captures) Create

func (s *Captures) Create(ctx context.Context, paymentID string, idempotencyKey *string, entityCapture *components.EntityCapture, opts ...operations.Option) (*operations.CreateCaptureResponse, error)

Create capture Capture an *authorized* payment.

Some payment methods allow you to first collect a customer's authorization, and capture the amount at a later point.

By default, Mollie captures payments automatically. If however you configured your payment with `captureMode: manual`, you can capture the payment using this endpoint after having collected the customer's authorization.

func (*Captures) Get

Get capture Retrieve a single payment capture by its ID and the ID of its parent payment.

func (*Captures) List

List captures Retrieve a list of all captures created for a specific payment.

The results are paginated.

type Chargebacks

type Chargebacks struct {
	// contains filtered or unexported fields
}

func (*Chargebacks) All

All - List all chargebacks Retrieve all chargebacks initiated for all your payments.

The results are paginated.

func (*Chargebacks) Get

Get payment chargeback Retrieve a single payment chargeback by its ID and the ID of its parent payment.

func (*Chargebacks) List

List payment chargebacks Retrieve the chargebacks initiated for a specific payment.

The results are paginated.

type Client

type Client struct {
	SDKVersion       string
	Balances         *Balances
	Settlements      *Settlements
	Invoices         *Invoices
	Permissions      *Permissions
	Organizations    *Organizations
	Profiles         *Profiles
	Onboarding       *Onboarding
	Capabilities     *Capabilities
	Clients          *Clients
	ClientLinks      *ClientLinks
	Webhooks         *Webhooks
	WebhookEvents    *WebhookEvents
	BalanceTransfers *BalanceTransfers
	Payments         *Payments
	Methods          *Methods
	Refunds          *Refunds
	Chargebacks      *Chargebacks
	Captures         *Captures
	Wallets          *Wallets
	PaymentLinks     *PaymentLinks
	Terminals        *Terminals
	DelayedRouting   *DelayedRouting
	Customers        *Customers
	Mandates         *Mandates
	Subscriptions    *Subscriptions
	SalesInvoices    *SalesInvoices
	// contains filtered or unexported fields
}

func New

func New(opts ...SDKOption) *Client

New creates a new instance of the SDK with the provided options

type ClientLinks struct {
	// contains filtered or unexported fields
}

func (*ClientLinks) Create

func (s *ClientLinks) Create(ctx context.Context, idempotencyKey *string, entityClientLink *components.EntityClientLink, opts ...operations.Option) (*operations.CreateClientLinkResponse, error)

Create client link Link a new or existing organization to your OAuth application, in effect creating a new client. The response contains a `clientLink` where you should redirect your customer to.

## Redirecting the Customer

The `clientLink` URL behaves similarly to a standard OAuth authorization URL. Therefore, after receiving the `clientLink` URL in the API response, you need to **append the following query parameters** *before* redirecting the customer:

* `client_id` _string (required)_

The client ID you received when you registered your OAuth app. The ID starts with `app_`. For example:
`app_abc123qwerty`.

* `state` _string (required)_

A random string **generated by your app** to prevent CSRF attacks. This will be reflected in the `state` query
parameter when the user returns to the `redirect_uri` after authorizing your app.

* `scope` _string (required)_

A space-separated list of permissions ('scopes') your app requires. See the
[permissions list](https://docs.mollie.com/docs/connect-permissions) for more information about the available
scopes.

We recommend at least : `onboarding.read onboarding.write`

* `approval_prompt` _string_

Can be set to `force` to force showing the consent screen to the merchant, *even when it is not necessary*. If you
force an approval prompt and the user creates a new authorization, previously active authorizations will be
revoked.

Possible values: `auto` `force` (default: `auto`)

### Example of a Complete Redirect URL

After adding the above url parameter your URL will look something like this and you can redirect your client to this page:

``` https://my.mollie.com/dashboard/client-link/{id}?client_id={your_client_id}&state={unique_state}&scope=onboarding.read%20onboarding.write ```

## Error Handling

Error handling is also dealt with similar to the [Authorize](https://docs.mollie.com/reference/authorize) endpoint: the customer is redirected back to your app's redirect URL with the `error` and `error_description` parameters added to the URL.

> 🚧 > > A client link must be used within 30 days of creation. After that period, it will expire and you will need to create a new client link.

type Clients

type Clients struct {
	// contains filtered or unexported fields
}

func (*Clients) Get

func (s *Clients) Get(ctx context.Context, id string, embed *string, idempotencyKey *string, opts ...operations.Option) (*operations.GetClientResponse, error)

Get client Retrieve a single client by its ID.

func (*Clients) List

func (s *Clients) List(ctx context.Context, embed *string, from *string, limit *int64, idempotencyKey *string, opts ...operations.Option) (*operations.ListClientsResponse, error)

List clients Retrieve a list of all clients linked to your account.

The results are paginated.

type Customers

type Customers struct {
	// contains filtered or unexported fields
}

func (*Customers) Create

func (s *Customers) Create(ctx context.Context, idempotencyKey *string, entityCustomer *components.EntityCustomer, opts ...operations.Option) (*operations.CreateCustomerResponse, error)

Create customer Creates a simple minimal representation of a customer. Payments, recurring mandates, and subscriptions can be linked to this customer object, which simplifies management of recurring payments.

Once registered, customers will also appear in your Mollie dashboard.

func (*Customers) CreatePayment

func (s *Customers) CreatePayment(ctx context.Context, customerID string, idempotencyKey *string, paymentRequest *components.PaymentRequest, opts ...operations.Option) (*operations.CreateCustomerPaymentResponse, error)

CreatePayment - Create customer payment Creates a payment for the customer.

Linking customers to payments enables you to:

* Keep track of payment preferences for your customers * Allow your customers to charge a previously used credit card with a single click in our hosted checkout * Improve payment insights in the Mollie dashboard * Use recurring payments

This endpoint is effectively an alias of the [Create payment endpoint](create-payment) with the `customerId` parameter predefined.

func (*Customers) Delete

func (s *Customers) Delete(ctx context.Context, customerID string, idempotencyKey *string, requestBody *operations.DeleteCustomerRequestBody, opts ...operations.Option) (*operations.DeleteCustomerResponse, error)

Delete customer Delete a customer. All mandates and subscriptions created for this customer will be canceled as well.

func (*Customers) Get

func (s *Customers) Get(ctx context.Context, customerID string, include *string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetCustomerResponse, error)

Get customer Retrieve a single customer by its ID.

func (*Customers) List

List customers Retrieve a list of all customers.

The results are paginated.

func (*Customers) ListPayments

ListPayments - List customer payments Retrieve all payments linked to the customer.

func (*Customers) Update

func (s *Customers) Update(ctx context.Context, customerID string, idempotencyKey *string, entityCustomer *components.EntityCustomer, opts ...operations.Option) (*operations.UpdateCustomerResponse, error)

Update customer Update an existing customer.

For an in-depth explanation of each parameter, refer to the [Create customer](create-customer) endpoint.

type DelayedRouting

type DelayedRouting struct {
	// contains filtered or unexported fields
}

func (*DelayedRouting) Create

func (s *DelayedRouting) Create(ctx context.Context, paymentID string, idempotencyKey *string, routeCreateRequest *components.RouteCreateRequest, opts ...operations.Option) (*operations.PaymentCreateRouteResponse, error)

Create a delayed route Create a route for a specific payment. The routed amount is credited to the account of your customer.

func (*DelayedRouting) List

func (s *DelayedRouting) List(ctx context.Context, paymentID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.PaymentListRoutesResponse, error)

List payment routes Retrieve a list of all routes created for a specific payment.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for supplying the SDK with a custom HTTP client

type Invoices

type Invoices struct {
	// contains filtered or unexported fields
}

func (*Invoices) Get

func (s *Invoices) Get(ctx context.Context, id string, idempotencyKey *string, opts ...operations.Option) (*operations.GetInvoiceResponse, error)

Get invoice Retrieve a single invoice by its ID.

If you want to retrieve the details of an invoice by its invoice number, call the [List invoices](list-invoices) endpoint with the `reference` parameter.

func (*Invoices) List

List invoices Retrieve a list of all your invoices, optionally filtered by year or by invoice reference.

The results are paginated.

type Mandates

type Mandates struct {
	// contains filtered or unexported fields
}

func (*Mandates) Create

func (s *Mandates) Create(ctx context.Context, customerID string, idempotencyKey *string, entityMandate *components.EntityMandate, opts ...operations.Option) (*operations.CreateMandateResponse, error)

Create mandate Create a mandate for a specific customer. Mandates allow you to charge a customer's card, PayPal account or bank account recurrently.

It is only possible to create mandates for IBANs and PayPal billing agreements with this endpoint. To create mandates for cards, your customers need to perform a 'first payment' with their card.

func (*Mandates) Get

func (s *Mandates) Get(ctx context.Context, customerID string, mandateID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetMandateResponse, error)

Get mandate Retrieve a single mandate by its ID. Depending on the type of mandate, the object will contain the customer's bank account details, card details, or PayPal account details.

func (*Mandates) List

List mandates Retrieve a list of all mandates.

The results are paginated.

func (*Mandates) Revoke

func (s *Mandates) Revoke(ctx context.Context, customerID string, mandateID string, idempotencyKey *string, requestBody *operations.RevokeMandateRequestBody, opts ...operations.Option) (*operations.RevokeMandateResponse, error)

Revoke mandate Revoke a customer's mandate. You will no longer be able to charge the customer's bank account or card with this mandate, and all connected subscriptions will be canceled.

type Methods

type Methods struct {
	// contains filtered or unexported fields
}

func (*Methods) All

All - List all payment methods Retrieve all payment methods that Mollie offers, regardless of the eligibility of the organization for the specific method. The results of this endpoint are **not** paginated — unlike most other list endpoints in our API.

The list can optionally be filtered using a number of parameters described below.

func (*Methods) Get

Get payment method Retrieve a single payment method by its ID.

If a method is not available on this profile, a `404 Not Found` response is returned. If the method is available but not enabled yet, a status `403 Forbidden` is returned. You can enable payments methods via the [Enable payment method endpoint](enable-method) of the Profiles API, or via the Mollie Dashboard.

If you do not know the method's ID, you can use the [methods list endpoint](list-methods) to retrieve all payment methods that are available.

Additionally, it is possible to check if wallet methods such as Apple Pay are enabled by passing the wallet ID (`applepay`) as the method ID.

func (*Methods) List

List payment methods Retrieve all enabled payment methods. The results of this endpoint are **not** paginated — unlike most other list endpoints in our API.

For test mode, all pending and enabled payment methods are returned. If no payment methods are requested yet, the most popular payment methods are returned in the test mode. For live mode, only fully enabled payment methods are returned.

Payment methods can be requested and enabled via the Mollie Dashboard, or via the [Enable payment method endpoint](enable-method) of the Profiles API.

The list can optionally be filtered using a number of parameters described below.

By default, only payment methods for the Euro currency are returned. If you wish to retrieve payment methods which exclusively support other currencies (e.g. Twint), you need to use the `amount` parameters.

type Onboarding

type Onboarding struct {
	// contains filtered or unexported fields
}

func (*Onboarding) Get

func (s *Onboarding) Get(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetOnboardingStatusResponse, error)

Get onboarding status Retrieve the onboarding status of the currently authenticated organization.

func (*Onboarding) Submit

Submit onboarding data **⚠️ We no longer recommend implementing this endpoint. Please refer to the Client Links API instead to kick off the onboarding process for your merchants.**

Submit data that will be prefilled in the merchant's onboarding. The data you submit will only be processed when the onboarding status is `needs-data`. Information that the merchant has entered in their dashboard will not be overwritten.

type Organizations

type Organizations struct {
	// contains filtered or unexported fields
}

func (*Organizations) Get

func (s *Organizations) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetOrganizationResponse, error)

Get organization Retrieve a single organization by its ID.

You can normally only retrieve the currently authenticated organization with this endpoint. This is primarily useful for OAuth apps. See also [Get current organization](get-current-organization).

If you have a *partner account*', you can retrieve organization details of connected organizations.

func (*Organizations) GetCurrent

func (s *Organizations) GetCurrent(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetCurrentOrganizationResponse, error)

GetCurrent - Get current organization Retrieve the currently authenticated organization. A convenient alias of the [Get organization](get-organization) endpoint.

For a complete reference of the organization object, refer to the [Get organization](get-organization) endpoint documentation.

func (*Organizations) GetPartner

func (s *Organizations) GetPartner(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetPartnerStatusResponse, error)

GetPartner - Get partner status Retrieve partnership details about the currently authenticated organization. Only relevant for so-called *partner accounts*.

type PaymentLinks struct {
	// contains filtered or unexported fields
}

func (*PaymentLinks) Create

Create payment link With the Payment links API you can generate payment links that by default, unlike regular payments, do not expire. The payment link can be shared with your customers and will redirect them to them the payment page where they can complete the payment. A [payment](get-payment) will only be created once the customer initiates the payment.

func (*PaymentLinks) Delete

func (s *PaymentLinks) Delete(ctx context.Context, paymentLinkID string, idempotencyKey *string, requestBody *operations.DeletePaymentLinkRequestBody, opts ...operations.Option) (*operations.DeletePaymentLinkResponse, error)

Delete payment link Payment links which have not been opened and no payments have been made yet can be deleted entirely. This can be useful for removing payment links that have been incorrectly configured or that are no longer relevant.

Once deleted, the payment link will no longer show up in the API or Mollie dashboard.

To simply disable a payment link without fully deleting it, you can use the `archived` parameter on the [Update payment link](update-payment-link) endpoint instead.

func (*PaymentLinks) Get

func (s *PaymentLinks) Get(ctx context.Context, paymentLinkID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetPaymentLinkResponse, error)

Get payment link Retrieve a single payment link by its ID.

func (*PaymentLinks) List

func (s *PaymentLinks) List(ctx context.Context, from *string, limit *int64, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.ListPaymentLinksResponse, error)

List payment links Retrieve a list of all payment links.

The results are paginated.

func (*PaymentLinks) ListPayments

ListPayments - Get payment link payments Retrieve the list of payments for a specific payment link.

The results are paginated.

func (*PaymentLinks) Update

func (s *PaymentLinks) Update(ctx context.Context, paymentLinkID string, idempotencyKey *string, requestBody *operations.UpdatePaymentLinkRequestBody, opts ...operations.Option) (*operations.UpdatePaymentLinkResponse, error)

Update payment link Certain details of an existing payment link can be updated.

type Payments

type Payments struct {
	// contains filtered or unexported fields
}

func (*Payments) Cancel

func (s *Payments) Cancel(ctx context.Context, paymentID string, idempotencyKey *string, requestBody *operations.CancelPaymentRequestBody, opts ...operations.Option) (*operations.CancelPaymentResponse, error)

Cancel payment Depending on the payment method, you may be able to cancel a payment for a certain amount of time — usually until the next business day or as long as the payment status is open.

Payments may also be canceled manually from the Mollie Dashboard.

The `isCancelable` property on the [Payment object](get-payment) will indicate if the payment can be canceled.

func (*Payments) Create

func (s *Payments) Create(ctx context.Context, include *string, idempotencyKey *string, paymentRequest *components.PaymentRequest, opts ...operations.Option) (*operations.CreatePaymentResponse, error)

Create payment Payment creation is elemental to the Mollie API: this is where most payment implementations start off.

Once you have created a payment, you should redirect your customer to the URL in the `_links.checkout` property from the response.

To wrap your head around the payment process, an explanation and flow charts can be found in the 'Accepting payments' guide.

If you specify the `method` parameter when creating a payment, optional additional parameters may be available for the payment method that are not listed below. Please refer to the guide on [method-specific parameters](extra-payment-parameters).

func (*Payments) Get

Get payment Retrieve a single payment object by its payment ID.

func (*Payments) List

List payments Retrieve all payments created with the current website profile.

The results are paginated.

func (*Payments) ReleaseAuthorization

func (s *Payments) ReleaseAuthorization(ctx context.Context, paymentID string, idempotencyKey *string, requestBody *operations.ReleaseAuthorizationRequestBody, opts ...operations.Option) (*operations.ReleaseAuthorizationResponse, error)

ReleaseAuthorization - Release payment authorization Releases the full remaining authorized amount. Call this endpoint when you will not be making any additional captures. Payment authorizations may also be released manually from the Mollie Dashboard.

Mollie will do its best to process release requests, but it is not guaranteed that it will succeed. It is up to the issuing bank if and when the hold will be released.

If the request does succeed, the payment status will change to `canceled` for payments without captures. If there is a successful capture, the payment will transition to `paid`.

func (*Payments) Update

func (s *Payments) Update(ctx context.Context, paymentID string, idempotencyKey *string, requestBody *operations.UpdatePaymentRequestBody, opts ...operations.Option) (*operations.UpdatePaymentResponse, error)

Update payment Certain details of an existing payment can be updated.

Updating the payment details will not result in a webhook call.

type Permissions

type Permissions struct {
	// contains filtered or unexported fields
}

func (*Permissions) Get

func (s *Permissions) Get(ctx context.Context, permissionID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetPermissionResponse, error)

Get permission Retrieve a single permission by its ID, and see if the permission is granted to the current access token.

func (*Permissions) List

func (s *Permissions) List(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.ListPermissionsResponse, error)

List permissions Retrieve a list of all permissions available to the current access token.

The results are **not** paginated.

type Profiles

type Profiles struct {
	// contains filtered or unexported fields
}

func (*Profiles) Create

func (s *Profiles) Create(ctx context.Context, entityProfile components.EntityProfile, idempotencyKey *string, opts ...operations.Option) (*operations.CreateProfileResponse, error)

Create profile Create a profile to process payments on.

Profiles are required for payment processing. Normally they are created via the Mollie dashboard. Alternatively, you can use this endpoint to automate profile creation.

func (*Profiles) Delete

func (s *Profiles) Delete(ctx context.Context, id string, idempotencyKey *string, opts ...operations.Option) (*operations.DeleteProfileResponse, error)

Delete profile Delete a profile. A deleted profile and its related credentials can no longer be used for accepting payments.

func (*Profiles) Get

func (s *Profiles) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetProfileResponse, error)

Get profile Retrieve a single profile by its ID.

func (*Profiles) GetCurrent

func (s *Profiles) GetCurrent(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetCurrentProfileResponse, error)

GetCurrent - Get current profile Retrieve the currently authenticated profile. A convenient alias of the [Get profile](get-profile) endpoint.

For a complete reference of the profile object, refer to the [Get profile](get-profile) endpoint documentation.

func (*Profiles) List

func (s *Profiles) List(ctx context.Context, from *string, limit *int64, idempotencyKey *string, opts ...operations.Option) (*operations.ListProfilesResponse, error)

List profiles Retrieve a list of all of your profiles.

The results are paginated.

func (*Profiles) Update

func (s *Profiles) Update(ctx context.Context, id string, requestBody operations.UpdateProfileRequestBody, idempotencyKey *string, opts ...operations.Option) (*operations.UpdateProfileResponse, error)

Update profile Update an existing profile.

Profiles are required for payment processing. Normally they are created and updated via the Mollie dashboard. Alternatively, you can use this endpoint to automate profile management.

type Refunds

type Refunds struct {
	// contains filtered or unexported fields
}

func (*Refunds) All

All - List all refunds Retrieve a list of all of your refunds.

The results are paginated.

func (*Refunds) Cancel

func (s *Refunds) Cancel(ctx context.Context, paymentID string, refundID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.CancelRefundResponse, error)

Cancel payment refund Refunds will be executed with a delay of two hours. Until that time, refunds may be canceled manually via the Mollie Dashboard, or by using this endpoint.

A refund can only be canceled while its `status` field is either `queued` or `pending`. See the [Get refund endpoint](get-refund) for more information.

func (*Refunds) Create

func (s *Refunds) Create(ctx context.Context, paymentID string, idempotencyKey *string, entityRefund *components.EntityRefund, opts ...operations.Option) (*operations.CreateRefundResponse, error)

Create payment refund Creates a refund for a specific payment. The refunded amount is credited to your customer usually either via a bank transfer or by refunding the amount to your customer's credit card.

func (*Refunds) Get

Get payment refund Retrieve a single payment refund by its ID and the ID of its parent payment.

func (*Refunds) List

List payment refunds Retrieve a list of all refunds created for a specific payment.

The results are paginated.

type SDKOption

type SDKOption func(*Client)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(security components.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

type SalesInvoices

type SalesInvoices struct {
	// contains filtered or unexported fields
}

func (*SalesInvoices) Create

func (s *SalesInvoices) Create(ctx context.Context, idempotencyKey *string, entitySalesInvoice *components.EntitySalesInvoice, opts ...operations.Option) (*operations.CreateSalesInvoiceResponse, error)

Create sales invoice > 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

With the Sales Invoice API you can generate sales invoices to send to your customers.

func (*SalesInvoices) Delete

func (s *SalesInvoices) Delete(ctx context.Context, id string, idempotencyKey *string, deleteValuesSalesInvoice *components.DeleteValuesSalesInvoice, opts ...operations.Option) (*operations.DeleteSalesInvoiceResponse, error)

Delete sales invoice > 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

Sales invoices which are in status `draft` can be deleted. For all other statuses, please use the [Update sales invoice](update-sales-invoice) endpoint instead.

func (*SalesInvoices) Get

func (s *SalesInvoices) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetSalesInvoiceResponse, error)

Get sales invoice > 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

Retrieve a single sales invoice by its ID.

func (*SalesInvoices) List

func (s *SalesInvoices) List(ctx context.Context, from *string, limit *int64, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.ListSalesInvoicesResponse, error)

List sales invoices > 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

Retrieve a list of all sales invoices created through the API.

The results are paginated.

func (*SalesInvoices) Update

func (s *SalesInvoices) Update(ctx context.Context, id string, idempotencyKey *string, updateValuesSalesInvoice *components.UpdateValuesSalesInvoice, opts ...operations.Option) (*operations.UpdateSalesInvoiceResponse, error)

Update sales invoice > 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

Certain details of an existing sales invoice can be updated. For `draft` it is all values listed below, but for statuses `paid` and `issued` there are certain additional requirements (`paymentDetails` and `emailDetails`, respectively).

type Settlements

type Settlements struct {
	// contains filtered or unexported fields
}

func (*Settlements) Get

func (s *Settlements) Get(ctx context.Context, id string, idempotencyKey *string, opts ...operations.Option) (*operations.GetSettlementResponse, error)

Get settlement Retrieve a single settlement by its ID.

To lookup settlements by their bank reference, replace the ID in the URL by a reference. For example: `1234567.2404.03`.

A settlement represents a transfer of your balance funds to your external bank account.

Settlements will typically include a report that details what balance transactions have taken place between this settlement and the previous one.

For more accurate bookkeeping, refer to the [balance report](get-balance-report) endpoint or the [balance transactions](list-balance-transactions) endpoint.

func (*Settlements) GetNext

func (s *Settlements) GetNext(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetNextSettlementResponse, error)

GetNext - Get next settlement Retrieve the details of the current settlement, that has not yet been paid out.

For a complete reference of the settlement object, refer to the [Get settlement endpoint](get-settlement) documentation.

For more accurate bookkeeping, refer to the [balance report](get-balance-report) endpoint or the [balance transactions](list-balance-transactions) endpoint.

func (*Settlements) GetOpen

func (s *Settlements) GetOpen(ctx context.Context, idempotencyKey *string, opts ...operations.Option) (*operations.GetOpenSettlementResponse, error)

GetOpen - Get open settlement Retrieve the details of the open balance of the organization. This will return a settlement object representing your organization's balance.

For a complete reference of the settlement object, refer to the [Get settlement endpoint](get-settlement) documentation.

For more accurate bookkeeping, refer to the [balance report](get-balance-report) endpoint or the [balance transactions](list-balance-transactions) endpoint.

func (*Settlements) List

List settlements Retrieve a list of all your settlements.

The results are paginated.

func (*Settlements) ListCaptures

ListCaptures - List settlement captures Retrieve all captures included in the given settlement.

The response is in the same format as the response of the [List captures endpoint](list-captures).

func (*Settlements) ListChargebacks

ListChargebacks - List settlement chargebacks Retrieve all chargebacks 'deducted' from the given settlement.

The response is in the same format as the response of the [List chargebacks endpoint](list-chargebacks).

func (*Settlements) ListPayments

ListPayments - List settlement payments Retrieve all payments included in the given settlement.

The response is in the same format as the response of the [List payments endpoint](list-payments).

For capture-based payment methods such as Klarna, the payments are not listed here. Refer to the [List captures endpoint](list-captures) endpoint instead.

func (*Settlements) ListRefunds

ListRefunds - List settlement refunds Retrieve all refunds 'deducted' from the given settlement.

The response is in the same format as the response of the [List refunds endpoint](list-refunds).

type Subscriptions

type Subscriptions struct {
	// contains filtered or unexported fields
}

func (*Subscriptions) All

All - List all subscriptions Retrieve all subscriptions initiated across all your customers.

The results are paginated.

func (*Subscriptions) Cancel

func (s *Subscriptions) Cancel(ctx context.Context, customerID string, subscriptionID string, idempotencyKey *string, requestBody *operations.CancelSubscriptionRequestBody, opts ...operations.Option) (*operations.CancelSubscriptionResponse, error)

Cancel subscription Cancel an existing subscription. Canceling a subscription has no effect on the mandates of the customer.

func (*Subscriptions) Create

func (s *Subscriptions) Create(ctx context.Context, customerID string, idempotencyKey *string, subscriptionRequest *components.SubscriptionRequest, opts ...operations.Option) (*operations.CreateSubscriptionResponse, error)

Create subscription With subscriptions, you can schedule recurring payments to take place at regular intervals.

For example, by simply specifying an `amount` and an `interval`, you can create an endless subscription to charge a monthly fee, until you cancel the subscription.

Or, you could use the times parameter to only charge a limited number of times, for example to split a big transaction in multiple parts.

A few example usages:

`amount[currency]="EUR"` `amount[value]="5.00"` `interval="2 weeks"` Your customer will be charged €5 once every two weeks.

`amount[currency]="EUR"` `amount[value]="20.00"` `interval="1 day" times=5` Your customer will be charged €20 every day, for five consecutive days.

`amount[currency]="EUR"` `amount[value]="10.00"` `interval="1 month"` `startDate="2018-04-30"` Your customer will be charged €10 on the last day of each month, starting in April 2018.

func (*Subscriptions) Get

func (s *Subscriptions) Get(ctx context.Context, customerID string, subscriptionID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetSubscriptionResponse, error)

Get subscription Retrieve a single subscription by its ID and the ID of its parent customer.

func (*Subscriptions) List

List customer subscriptions Retrieve all subscriptions of a customer.

The results are paginated.

func (*Subscriptions) ListPayments

ListPayments - List subscription payments Retrieve all payments of a specific subscription.

The results are paginated.

func (*Subscriptions) Update

func (s *Subscriptions) Update(ctx context.Context, customerID string, subscriptionID string, idempotencyKey *string, requestBody *operations.UpdateSubscriptionRequestBody, opts ...operations.Option) (*operations.UpdateSubscriptionResponse, error)

Update subscription Update an existing subscription.

Canceled subscriptions cannot be updated.

For an in-depth explanation of each parameter, refer to the [Create subscription](create-subscription) endpoint.

type Terminals

type Terminals struct {
	// contains filtered or unexported fields
}

func (*Terminals) Get

func (s *Terminals) Get(ctx context.Context, terminalID string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetTerminalResponse, error)

Get terminal Retrieve a single terminal by its ID.

func (*Terminals) List

List terminals Retrieve a list of all physical point-of-sale devices.

The results are paginated.

type Wallets

type Wallets struct {
	// contains filtered or unexported fields
}

func (*Wallets) RequestApplePaySession

RequestApplePaySession - Request Apple Pay payment session When integrating Apple Pay in your own checkout on the web, you need to [provide merchant validation](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation). This is normally done using Apple's [Requesting an Apple Pay Session](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/requesting_an_apple_pay_payment_session). The merchant validation proves to Apple that a validated merchant is calling the Apple Pay Javascript APIs.

To integrate Apple Pay via Mollie, you will have to call the Mollie API instead of Apple's API. The response of this API call can then be passed as-is to the completion method, `completeMerchantValidation`.

Before requesting an Apple Pay Payment Session, you must place the domain validation file on your server at: `https://[domain]/.well-known/apple-developer-merchantid-domain-association`. Without this file, it will not be possible to use Apple Pay on your domain.

Each new transaction requires a new payment session object. Merchant session objects are not reusable, and they expire after five minutes.

Payment sessions cannot be requested directly from the browser. The request must be sent from your server. For the full documentation, see the official [Apple Pay JS API](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api) documentation.

type WebhookEvents

type WebhookEvents struct {
	// contains filtered or unexported fields
}

func (*WebhookEvents) Get

func (s *WebhookEvents) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetWebhookEventResponse, error)

Get a Webhook Event Retrieve a single webhook event object by its event ID.

type Webhooks

type Webhooks struct {
	// contains filtered or unexported fields
}

func (*Webhooks) Create

func (s *Webhooks) Create(ctx context.Context, idempotencyKey *string, requestBody *operations.CreateWebhookRequestBody, opts ...operations.Option) (*operations.CreateWebhookResponse, error)

Create a webhook A webhook must have a name, an url and a list of event types. You can also create webhooks in the webhooks settings section of the Dashboard.

func (*Webhooks) Delete

func (s *Webhooks) Delete(ctx context.Context, id string, idempotencyKey *string, requestBody *operations.DeleteWebhookRequestBody, opts ...operations.Option) (*operations.DeleteWebhookResponse, error)

Delete a webhook Delete a single webhook object by its webhook ID.

func (*Webhooks) Get

func (s *Webhooks) Get(ctx context.Context, id string, testmode *bool, idempotencyKey *string, opts ...operations.Option) (*operations.GetWebhookResponse, error)

Get a webhook Retrieve a single webhook object by its ID.

func (*Webhooks) List

List all webhooks Returns a paginated list of your webhooks. If no webhook endpoints are available, the resulting array will be empty. This request should never throw an error.

func (*Webhooks) Test

func (s *Webhooks) Test(ctx context.Context, id string, idempotencyKey *string, requestBody *operations.TestWebhookRequestBody, opts ...operations.Option) (*operations.TestWebhookResponse, error)

Test a webhook Sends a test event to the webhook to verify the endpoint is working as expected.

func (*Webhooks) Update

func (s *Webhooks) Update(ctx context.Context, id string, idempotencyKey *string, requestBody *operations.UpdateWebhookRequestBody, opts ...operations.Option) (*operations.UpdateWebhookResponse, error)

Update a webhook Updates the webhook. You may edit the name, url and the list of subscribed event types.

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL