Documentation
¶
Overview ¶
Package mollie is a wrapper around Mollie's REST API.
See: https://www.mollie.com/developers
The Mollie API is a straightforward REST API. This means all endpoints either create, retrieve, or update objects. API calls are authenticated with an [API credential](https://docs.mollie.com/reference/authentication). In some cases, you can receive live updates via [webhooks](https://docs.mollie.com/reference/webhooks).
Index ¶
- Constants
- func CheckResponse(r *Response) error
- type AccessTokenPaymentFields
- type Address
- type Amount
- type ApplePaymentSession
- type ApplePaymentSessionRequest
- type ApplicationFee
- type ApprovalPromptAction
- type Balance
- type BalanceAmount
- type BalanceGroupingFormat
- type BalanceLinks
- type BalanceReport
- type BalanceReportDetail
- type BalanceReportLinks
- type BalanceReportOptions
- type BalanceReportTotalsGrouping
- type BalanceStatus
- type BalanceTransaction
- type BalanceTransactionsList
- type BalancesList
- type BalancesService
- func (bs *BalancesService) Get(ctx context.Context, balance string) (res *Response, b *Balance, err error)
- func (bs *BalancesService) GetPrimaryReport(ctx context.Context, options *BalanceReportOptions) (res *Response, br *BalanceReport, err error)
- func (bs *BalancesService) GetPrimaryTransactionsList(ctx context.Context, options *ListBalanceTransactionsOptions) (res *Response, btl *BalanceTransactionsList, err error)
- func (bs *BalancesService) GetReport(ctx context.Context, balance string, options *BalanceReportOptions) (res *Response, br *BalanceReport, err error)
- func (bs *BalancesService) GetTransactionsList(ctx context.Context, balance string, options *ListBalanceTransactionsOptions) (res *Response, btl *BalanceTransactionsList, err error)
- func (bs *BalancesService) List(ctx context.Context, options *ListBalancesOptions) (res *Response, bl *BalancesList, err error)
- func (bs *BalancesService) Primary(ctx context.Context) (res *Response, b *Balance, err error)
- type BaseError
- type BusinessCategory
- type Capture
- type CaptureAccessTokenFields
- type CaptureLinks
- type CaptureMode
- type CaptureOptions
- type CaptureStatus
- type CapturesList
- type CapturesService
- func (cs *CapturesService) Create(ctx context.Context, payment string, capture CreateCapture) (res *Response, c *Capture, err error)
- func (cs *CapturesService) Get(ctx context.Context, payment, capture string, options *CaptureOptions) (res *Response, c *Capture, err error)
- func (cs *CapturesService) List(ctx context.Context, payment string, options *CaptureOptions) (res *Response, cl *CapturesList, err error)
- type CardLabel
- type CategoryCode
- type Chargeback
- type ChargebackAccessTokenFields
- type ChargebackLinks
- type ChargebackOptions
- type ChargebackReason
- type ChargebacksList
- type ChargebacksService
- func (cs *ChargebacksService) Get(ctx context.Context, payment, chargeback string, opts *ChargebackOptions) (res *Response, p *Chargeback, err error)
- func (cs *ChargebacksService) List(ctx context.Context, options *ListChargebacksOptions) (res *Response, cl *ChargebacksList, err error)
- func (cs *ChargebacksService) ListForPayment(ctx context.Context, payment string, options *ListChargebacksOptions) (res *Response, cl *ChargebacksList, err error)
- type Client
- func (c *Client) Do(req *http.Request) (*Response, error)
- func (c *Client) HasAccessToken() bool
- func (c *Client) NewAPIRequest(ctx context.Context, method string, uri string, body interface{}) (req *http.Request, err error)
- func (c *Client) SetIdempotencyKeyGenerator(kg idempotency.KeyGenerator)
- func (c *Client) WithAuthenticationValue(k string) error
- type ClientLink
- type ClientLinkAuthorizeOptions
- type ClientLinkLinks
- type ClientLinksService
- type ClientsService
- type Company
- type Config
- type ContextValue
- type ContextValues
- type CreateCapture
- type CreateClientLink
- type CreateCustomer
- type CreateMandate
- type CreateMandateAccessTokenFields
- type CreateMollieConnectPaymentFields
- type CreateOrUpdateProfile
- type CreateOrder
- type CreateOrderRefund
- type CreatePayment
- type CreatePaymentAccessTokenFields
- type CreatePaymentRefund
- type CreatePreAuthorizedPaymentFields
- type CreateRecurrentPaymentFields
- type CreateShipment
- type CreateSubscription
- type Customer
- type CustomerLinks
- type CustomersList
- type CustomersService
- func (cs *CustomersService) Create(ctx context.Context, c CreateCustomer) (res *Response, cc *Customer, err error)
- func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p CreatePayment) (res *Response, pp *Payment, err error)
- func (cs *CustomersService) Delete(ctx context.Context, id string) (res *Response, err error)
- func (cs *CustomersService) Get(ctx context.Context, id string) (res *Response, c *Customer, err error)
- func (cs *CustomersService) GetPayments(ctx context.Context, id string, options *ListCustomersOptions) (res *Response, pl *PaymentList, err error)
- func (cs *CustomersService) List(ctx context.Context, options *ListCustomersOptions) (res *Response, cl *CustomersList, err error)
- func (cs *CustomersService) Update(ctx context.Context, id string, c UpdateCustomer) (res *Response, cc *Customer, err error)
- type EligibilityReasons
- type EmbedValue
- type EnableVoucherIssuer
- type EntityType
- type ErrorLinks
- type FailureReason
- type FeeRegion
- type GetLinkedClientOptions
- type GiftCardEnabled
- type GiftCardIssuer
- type GiftCardLinks
- type Image
- type IncludeValue
- type Invoice
- type InvoiceLinks
- type InvoiceStatus
- type InvoicesList
- type InvoicesService
- type IssuerStatus
- type LineItem
- type LinkedClient
- type LinkedClientLinks
- type LinkedClientList
- type ListBalanceTransactionsOptions
- type ListBalancesOptions
- type ListChargebacksOptions
- type ListCustomersOptions
- type ListInvoicesOptions
- type ListLinkedClientsOptions
- type ListMandatesOptions
- type ListOrderRefundsOptions
- type ListOrdersOptions
- type ListPaymentMethodsOptions
- type ListPaymentsOptions
- type ListProfilesOptions
- type ListRefundsOptions
- type ListSettlementsOptions
- type ListSubscriptionsOptions
- type ListTerminalsOptions
- type Locale
- type Mandate
- type MandateDetails
- type MandateLinks
- type MandateStatus
- type MandatesList
- type MandatesService
- func (ms *MandatesService) Create(ctx context.Context, customer string, mandate CreateMandate) (res *Response, mr *Mandate, err error)
- func (ms *MandatesService) Get(ctx context.Context, customer, mandate string) (res *Response, mr *Mandate, err error)
- func (ms *MandatesService) List(ctx context.Context, customer string, options *ListMandatesOptions) (res *Response, ml *MandatesList, err error)
- func (ms *MandatesService) Revoke(ctx context.Context, customer, mandate string) (res *Response, err error)
- type MethodsLinks
- type Mode
- type MollieConnectPaymentFields
- type Onboarding
- type OnboardingData
- type OnboardingDataOrganization
- type OnboardingDataProfile
- type OnboardingLinks
- type OnboardingService
- type OnboardingStatus
- type Order
- type OrderAccessTokenFields
- type OrderAddress
- type OrderLine
- type OrderLineChangeInstruction
- type OrderLineLinks
- type OrderLineOperation
- type OrderLineOperationData
- type OrderLineOperationProductCategory
- type OrderLineOperations
- type OrderLineStatus
- type OrderLinks
- type OrderOptions
- type OrderPayment
- type OrderRefundLine
- type OrderRefundsList
- type OrderStatus
- type OrdersList
- type OrdersService
- func (ors *OrdersService) Cancel(ctx context.Context, orderID string) (res *Response, order *Order, err error)
- func (ors *OrdersService) CancelOrderLines(ctx context.Context, orderID string, orderLines []OrderLine) (res *Response, err error)
- func (ors *OrdersService) Create(ctx context.Context, ord CreateOrder, opts *OrderOptions) (res *Response, order *Order, err error)
- func (ors *OrdersService) CreateOrderPayment(ctx context.Context, orderID string, ordPay *OrderPayment) (res *Response, payment *Payment, err error)
- func (ors *OrdersService) CreateOrderRefund(ctx context.Context, orderID string, order *Order) (res *Response, refund *Refund, err error)
- func (ors *OrdersService) Get(ctx context.Context, orID string, opts *OrderOptions) (res *Response, order *Order, err error)
- func (ors *OrdersService) List(ctx context.Context, opts *ListOrdersOptions) (res *Response, ordList *OrdersList, err error)
- func (ors *OrdersService) ListOrderRefunds(ctx context.Context, orderID string, opts *ListOrderRefundsOptions) (res *Response, orderListRefund *OrderRefundsList, err error)
- func (ors *OrdersService) ManageOrderLines(ctx context.Context, orderID string, operations *OrderLineOperations) (res *Response, order *Order, err error)
- func (ors *OrdersService) Update(ctx context.Context, orderID string, ord UpdateOrder) (res *Response, order *Order, err error)
- func (ors *OrdersService) UpdateOrderLine(ctx context.Context, orderID string, orderLineID string, ...) (res *Response, order *Order, err error)
- type Organization
- type OrganizationLinks
- type OrganizationPartnerLinks
- type OrganizationPartnerStatus
- type OrganizationsService
- func (os *OrganizationsService) Get(ctx context.Context, id string) (res *Response, o *Organization, err error)
- func (os *OrganizationsService) GetCurrent(ctx context.Context) (res *Response, o *Organization, err error)
- func (os *OrganizationsService) GetPartnerStatus(ctx context.Context) (res *Response, ops *OrganizationPartnerStatus, err error)
- type Owner
- type PaginationLinks
- type PartnerType
- type Payment
- type PaymentDestination
- type PaymentDetails
- type PaymentDetailsAddress
- type PaymentLineType
- type PaymentLines
- type PaymentLink
- type PaymentLinkLinks
- type PaymentLinkOptions
- type PaymentLinkPaymentsList
- type PaymentLinkPaymentsListOptions
- type PaymentLinks
- type PaymentLinksList
- type PaymentLinksService
- func (pls *PaymentLinksService) Create(ctx context.Context, p PaymentLink, opts *PaymentLinkOptions) (res *Response, np *PaymentLink, err error)
- func (pls *PaymentLinksService) Delete(ctx context.Context, id string) (res *Response, err error)
- func (pls *PaymentLinksService) Get(ctx context.Context, id string) (res *Response, pl *PaymentLink, err error)
- func (pls *PaymentLinksService) List(ctx context.Context, opts *PaymentLinkOptions) (res *Response, pl *PaymentLinksList, err error)
- func (pls *PaymentLinksService) Payments(ctx context.Context, id string, opts *PaymentLinkPaymentsListOptions) (res *Response, pl *PaymentLinkPaymentsList, err error)
- func (pls *PaymentLinksService) Update(ctx context.Context, id string, p UpdatePaymentLinks) (res *Response, pl *PaymentLink, err error)
- type PaymentList
- type PaymentMethod
- type PaymentMethodDetails
- type PaymentMethodIssuer
- type PaymentMethodOptions
- type PaymentMethodPricing
- type PaymentMethodStatus
- type PaymentMethodsList
- type PaymentMethodsService
- func (ms *PaymentMethodsService) All(ctx context.Context, options *ListPaymentMethodsOptions) (res *Response, pm *PaymentMethodsList, err error)
- func (ms *PaymentMethodsService) Get(ctx context.Context, id PaymentMethod, options *PaymentMethodOptions) (res *Response, pmd *PaymentMethodDetails, err error)
- func (ms *PaymentMethodsService) List(ctx context.Context, options *ListPaymentMethodsOptions) (res *Response, pm *PaymentMethodsList, err error)
- type PaymentOptions
- type PaymentRefundAccessTokenFields
- type PaymentRefundMollieConnectFields
- type PaymentRefundOptions
- type PaymentRouting
- type PaymentsService
- func (ps *PaymentsService) Cancel(ctx context.Context, id string) (res *Response, p *Payment, err error)
- func (ps *PaymentsService) Create(ctx context.Context, p CreatePayment, opts *PaymentOptions) (res *Response, np *Payment, err error)
- func (ps *PaymentsService) Get(ctx context.Context, id string, opts *PaymentOptions) (res *Response, p *Payment, err error)
- func (ps *PaymentsService) List(ctx context.Context, opts *ListPaymentsOptions) (res *Response, pl *PaymentList, err error)
- func (ps *PaymentsService) Update(ctx context.Context, id string, up UpdatePayment) (res *Response, p *Payment, err error)
- type Permission
- type PermissionGrant
- type PermissionLinks
- type PermissionsList
- type PermissionsService
- type PhoneNumber
- type PreAuthorizedPaymentFields
- type ProductKind
- type Profile
- type ProfileLinks
- type ProfileReview
- type ProfileReviewStatus
- type ProfileStatus
- type ProfilesList
- type ProfilesService
- func (ps *ProfilesService) Create(ctx context.Context, np CreateOrUpdateProfile) (res *Response, p *Profile, err error)
- func (ps *ProfilesService) Current(ctx context.Context) (res *Response, p *Profile, err error)
- func (ps *ProfilesService) Delete(ctx context.Context, id string) (res *Response, err error)
- func (ps *ProfilesService) DisableGiftCardIssuer(ctx context.Context, profileID string, issuer GiftCardIssuer) (res *Response, err error)
- func (ps *ProfilesService) DisableGiftCardIssuerForCurrent(ctx context.Context, issuer GiftCardIssuer) (res *Response, err error)
- func (ps *ProfilesService) DisablePaymentMethod(ctx context.Context, id string, pm PaymentMethod) (res *Response, err error)
- func (ps *ProfilesService) DisableVoucherIssuer(ctx context.Context, profileID string, issuer VoucherIssuer) (res *Response, err error)
- func (ps *ProfilesService) DisableVoucherIssuerForCurrent(ctx context.Context, issuer VoucherIssuer) (res *Response, err error)
- func (ps *ProfilesService) EnableGiftCardIssuer(ctx context.Context, profileID string, issuer GiftCardIssuer) (res *Response, gc *GiftCardEnabled, err error)
- func (ps *ProfilesService) EnableGiftCardIssuerForCurrent(ctx context.Context, issuer GiftCardIssuer) (res *Response, gc *GiftCardEnabled, err error)
- func (ps *ProfilesService) EnablePaymentMethod(ctx context.Context, id string, pm PaymentMethod) (res *Response, pmi *PaymentMethodDetails, err error)
- func (ps *ProfilesService) EnableVoucherIssuer(ctx context.Context, profileID string, issuer VoucherIssuer, ...) (res *Response, vc *VoucherIssuerEnabled, err error)
- func (ps *ProfilesService) EnableVoucherIssuerForCurrent(ctx context.Context, issuer VoucherIssuer) (res *Response, vc *VoucherIssuerEnabled, err error)
- func (ps *ProfilesService) Get(ctx context.Context, id string) (res *Response, p *Profile, err error)
- func (ps *ProfilesService) List(ctx context.Context, opts *ListProfilesOptions) (res *Response, pl *ProfilesList, err error)
- func (ps *ProfilesService) Update(ctx context.Context, id string, up CreateOrUpdateProfile) (res *Response, p *Profile, err error)
- type QRCode
- type Rate
- type RecurrentPaymentFields
- type Refund
- type RefundLinks
- type RefundStatus
- type RefundsList
- type RefundsService
- func (rs *RefundsService) CancelPaymentRefund(ctx context.Context, paymentID, refundID string) (res *Response, err error)
- func (rs *RefundsService) CreateOrderRefund(ctx context.Context, orderID string, r CreateOrderRefund) (res *Response, rf *Refund, err error)
- func (rs *RefundsService) CreatePaymentRefund(ctx context.Context, paymentID string, re CreatePaymentRefund, ...) (res *Response, rf *Refund, err error)
- func (rs *RefundsService) GetPaymentRefund(ctx context.Context, paymentID, refundID string, opts *PaymentRefundOptions) (res *Response, refund *Refund, err error)
- func (rs *RefundsService) List(ctx context.Context, opts *ListRefundsOptions) (res *Response, rl *RefundsList, err error)
- func (rs *RefundsService) ListOrderRefunds(ctx context.Context, orderID string, opts *ListRefundsOptions) (res *Response, rl *RefundsList, err error)
- func (rs *RefundsService) ListPaymentRefunds(ctx context.Context, paymentID string, opts *ListRefundsOptions) (res *Response, rl *RefundsList, err error)
- type Response
- type RoutingReversal
- type RoutingSource
- type SequenceType
- type Settlement
- type SettlementCosts
- type SettlementLinks
- type SettlementObject
- type SettlementPeriod
- type SettlementRevenue
- type SettlementStatus
- type SettlementsList
- type SettlementsService
- func (ss *SettlementsService) Get(ctx context.Context, settlement string) (res *Response, s *Settlement, err error)
- func (ss *SettlementsService) GetCaptures(ctx context.Context, settlement string, slo *ListSettlementsOptions) (res *Response, cl *CapturesList, err error)
- func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ListChargebacksOptions) (res *Response, cl *ChargebacksList, err error)
- func (ss *SettlementsService) GetRefunds(ctx context.Context, settlement string, slo *ListSettlementsOptions) (res *Response, rl *RefundsList, err error)
- func (ss *SettlementsService) List(ctx context.Context, slo *ListSettlementsOptions) (res *Response, sl *SettlementsList, err error)
- func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentsOptions) (res *Response, pl *PaymentList, err error)
- func (ss *SettlementsService) Next(ctx context.Context) (res *Response, s *Settlement, err error)
- func (ss *SettlementsService) Open(ctx context.Context) (res *Response, s *Settlement, err error)
- type Shipment
- type ShipmentAccessTokenFields
- type ShipmentLinks
- type ShipmentTracking
- type ShipmentsList
- type ShipmentsService
- func (ss *ShipmentsService) Create(ctx context.Context, order string, cs CreateShipment) (res *Response, s *Shipment, err error)
- func (ss *ShipmentsService) Get(ctx context.Context, order string, shipment string) (res *Response, s *Shipment, err error)
- func (ss *ShipmentsService) List(ctx context.Context, order string) (res *Response, sl *ShipmentsList, err error)
- func (ss *ShipmentsService) Update(ctx context.Context, order string, shipment string, us UpdateShipment) (res *Response, s *Shipment, err error)
- type ShortDate
- type SortDirection
- type Subscription
- type SubscriptionAccessTokenFields
- type SubscriptionLinks
- type SubscriptionStatus
- type SubscriptionsList
- type SubscriptionsService
- func (ss *SubscriptionsService) All(ctx context.Context, opts *ListSubscriptionsOptions) (res *Response, sl *SubscriptionsList, err error)
- func (ss *SubscriptionsService) Cancel(ctx context.Context, customer, subscription string) (res *Response, s *Subscription, err error)
- func (ss *SubscriptionsService) Create(ctx context.Context, customer string, sc CreateSubscription) (res *Response, s *Subscription, err error)
- func (ss *SubscriptionsService) Get(ctx context.Context, customer, subscription string) (res *Response, s *Subscription, err error)
- func (ss *SubscriptionsService) List(ctx context.Context, customer string, opts *ListSubscriptionsOptions) (res *Response, sl *SubscriptionsList, err error)
- func (ss *SubscriptionsService) ListPayments(ctx context.Context, customer, subscription string, ...) (res *Response, sl *PaymentList, err error)
- func (ss *SubscriptionsService) Update(ctx context.Context, customer, subscription string, sc UpdateSubscription) (res *Response, s *Subscription, err error)
- type Subtotal
- type Terminal
- type TerminalList
- type TerminalStatus
- type TerminalsService
- type TransactionType
- type TransferDestination
- type TransferFrequency
- type URL
- type UpdateCustomer
- type UpdateOrder
- type UpdateOrderLine
- type UpdatePayment
- type UpdatePaymentLinks
- type UpdateShipment
- type UpdateSubscription
- type UsedGiftCard
- type UserAgentToken
- type VoucherContractor
- type VoucherIssuer
- type VoucherIssuerEnabled
- type VoucherLinks
- type Wallet
- type WalletsService
Examples ¶
Constants ¶
const ( BaseURL string = "https://api.mollie.com/" AuthHeader string = "Authorization" TokenType string = "Bearer" APITokenEnv string = "MOLLIE_API_TOKEN" OrgTokenEnv string = "MOLLIE_ORG_TOKEN" RequestContentType string = "application/json" IdempotencyKeyHeader string = "Idempotency-Key" ClientName string = "MollieGoClient" Version string = "4.0.0" )
Constants holding values for client initialization and request instantiation.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body.
Types ¶
type AccessTokenPaymentFields ¶
type AccessTokenPaymentFields struct {
Testmode bool `json:"testmode,omitempty"`
}
AccessTokenPaymentFields describes the fields specific to payments created using an access token.
type Address ¶
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"` City string `json:"city,omitempty"` Region string `json:"region,omitempty"` Country string `json:"country,omitempty"` }
Address provides a human friendly representation of a geographical space.
When providing an address object as parameter to a request, the following conditions must be met:
If any of the fields is provided, all fields have to be provided with exception of the region field. If only the region field is given, one should provide all the other fields as per the previous condition. For certain PayPal payments the region field is required.
type Amount ¶
type Amount struct { Currency string `json:"currency,omitempty" url:"currency,omitempty"` Value string `json:"value,omitempty" url:"value,omitempty"` }
Amount represents a currency and value pair.
type ApplePaymentSession ¶
type ApplePaymentSession struct { EpochTimestamp int `json:"epochTimestamp,omitempty"` ExpiresAt int `json:"expiresAt,omitempty"` MerchantSessionID string `json:"merchantSessionIdentifier,omitempty"` Nonce string `json:"nonce,omitempty"` MerchantID string `json:"merchantIdentified,omitempty"` DomainName string `json:"domainName,omitempty"` DisplayName string `json:"displayName,omitempty"` Signature string `json:"signature,omitempty"` }
ApplePaymentSession contains information about an Apple pay session.
type ApplePaymentSessionRequest ¶
type ApplePaymentSessionRequest struct { Domain string `json:"domain,omitempty"` ValidationURL string `json:"validationUrl,omitempty"` }
ApplePaymentSessionRequest contains the body parameters for requesting a valid PaymentSession from Apple.
type ApplicationFee ¶
type ApplicationFee struct { Amount *Amount `json:"amount,omitempty"` Description string `json:"description,omitempty"` }
ApplicationFee allows you to split a payment between a platform and connected merchant accounts.
type ApprovalPromptAction ¶
type ApprovalPromptAction string
ApprovalPromptAction represents possible actions to be performed once the client link is created and redirected to the dashboard.
const ( ForceApproval ApprovalPromptAction = "force" AutoApproval ApprovalPromptAction = "auto" )
Possible approval prompt actions.
type Balance ¶
type Balance struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` Currency string `json:"currency,omitempty"` TransferReference string `json:"transferReference,omitempty"` Status BalanceStatus `json:"status,omitempty"` TransferFrequency TransferFrequency `json:"transferFrequency,omitempty"` TransferThreshold *Amount `json:"transferThreshold,omitempty"` AvailableAmount *Amount `json:"availableAmount,omitempty"` PendingAmount *Amount `json:"pendingAmount,omitempty"` TransferDestination *TransferDestination `json:"transferDestination,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Links BalanceLinks `json:"_links,omitempty"` }
Balance holds the payments processed with Mollie once fees have been deducted.
type BalanceAmount ¶
type BalanceAmount struct {
Amount *Amount `json:"amount,omitempty"`
}
BalanceAmount wraps the std Amount type.
type BalanceGroupingFormat ¶
type BalanceGroupingFormat string
BalanceGroupingFormat defines a grouping mechanism for transactions included in a balance report.
const ( StatusBalancesGrouping BalanceGroupingFormat = "status-balances" TransactionCategoriesGrouping BalanceGroupingFormat = "transaction-categories" )
Supported transaction grouping.
type BalanceLinks ¶
type BalanceLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
BalanceLinks holds URL objects relevant to the balance.
type BalanceReport ¶
type BalanceReport struct { Resource string `json:"resource,omitempty"` BalanceID string `json:"balanceId,omitempty"` TimeZone string `json:"timeZone,omitempty"` From *ShortDate `json:"from,omitempty"` Until *ShortDate `json:"until,omitempty"` Totals *BalanceReportTotalsGrouping `json:"totals,omitempty"` Grouping BalanceGroupingFormat `json:"grouping,omitempty"` Links BalanceReportLinks `json:"_links,omitempty"` }
BalanceReport contains the common fields between different balance grouping options.
type BalanceReportDetail ¶
type BalanceReportDetail struct { Open *BalanceAmount `json:"open,omitempty"` Pending *BalanceAmount `json:"pending,omitempty"` MovedToAvailable *BalanceAmount `json:"movedToAvailable,omitempty"` ImmediatelyAvailable *BalanceAmount `json:"immediatelyAvailable,omitempty"` Close *BalanceAmount `json:"close,omitempty"` }
BalanceReportDetail contains the breakdown categories when grouping balance transactions.
type BalanceReportLinks ¶
type BalanceReportLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
BalanceReportLinks holds URL objects relevant to the balance report.
type BalanceReportOptions ¶
type BalanceReportOptions struct { Grouping BalanceGroupingFormat `url:"grouping,omitempty"` From *ShortDate `url:"from,omitempty"` Until *ShortDate `url:"until,omitempty"` }
BalanceReportOptions contains valid query parameters for the list balances endpoint.
type BalanceReportTotalsGrouping ¶
type BalanceReportTotalsGrouping struct { PendingBalance *BalanceReportDetail `json:"pendingBalance,omitempty"` AvailableBalance *BalanceReportDetail `json:"availableBalance,omitempty"` Open *BalanceReportDetail `json:"open,omitempty"` Payments *BalanceReportDetail `json:"payments,omitempty"` Refunds *BalanceReportDetail `json:"refunds,omitempty"` Chargebacks *BalanceReportDetail `json:"chargebacks,omitempty"` Capital *BalanceReportDetail `json:"capital,omitempty"` Transfers *BalanceReportDetail `json:"transfers,omitempty"` FeePrePayments *BalanceReportDetail `json:"fee-prepayments,omitempty"` Corrections *BalanceReportDetail `json:"corrections,omitempty"` Close *BalanceReportDetail `json:"close,omitempty"` }
BalanceReportTotalsGrouping contains the per totals grouped balances for the requested period.
type BalanceStatus ¶
type BalanceStatus string
BalanceStatus reflects whether a balance is operational or not.
const ( BalanceActive BalanceStatus = "active" BalanceInactive BalanceStatus = "inactive" )
Possible values for type BalanceStatus.
type BalanceTransaction ¶
type BalanceTransaction struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` TransactionType string `json:"transactionType,omitempty"` ResultAmount *Amount `json:"resultAmount,omitempty"` InitialAmount *Amount `json:"initialAmount,omitempty"` Deductions *Amount `json:"deductions,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Context ContextValues `json:"context,omitempty"` }
BalanceTransaction represents a the movement on your balance.
type BalanceTransactionsList ¶
type BalanceTransactionsList struct { Count int `json:"count,omitempty"` Embedded struct { BalanceTransactions []*BalanceTransaction `json:"balance_transactions,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
BalanceTransactionsList contains an array of embedded transactions.
type BalancesList ¶
type BalancesList struct { Count int `json:"count,omitempty"` Embedded struct { Balances []*Balance `json:"balances,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
BalancesList describes a list of captures.
type BalancesService ¶
type BalancesService service
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/balances-api
func (*BalancesService) Get ¶
func (bs *BalancesService) Get(ctx context.Context, balance string) (res *Response, b *Balance, err error)
GetBalance retrieves a balance by its id.
func (*BalancesService) GetPrimaryReport ¶
func (bs *BalancesService) GetPrimaryReport(ctx context.Context, options *BalanceReportOptions) ( res *Response, br *BalanceReport, err error, )
GetPrimaryReport returns the report for the primary balance.
The alias `primary` is used instead of the balance ID to refer to the organization's primary balance.
func (*BalancesService) GetPrimaryTransactionsList ¶
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.
The alias primary is used instead of the balance ID to refer to the organization's primary balance.
See: https://docs.mollie.com/reference/list-balance-transactions
func (*BalancesService) GetReport ¶
func (bs *BalancesService) GetReport(ctx context.Context, balance string, options *BalanceReportOptions) ( res *Response, br *BalanceReport, err error, )
GetReport returns the balance report for the specified balance id.
func (*BalancesService) GetTransactionsList ¶
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.
See: https://docs.mollie.com/reference/list-balance-transactions
func (*BalancesService) List ¶
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.
type BaseError ¶
type BaseError struct { Status int `json:"status,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Field string `json:"field,omitempty"` Links *ErrorLinks `json:"_links,omitempty"` }
BaseError contains the general error structure returned by mollie.
type BusinessCategory ¶
type BusinessCategory string
BusinessCategory specifies an industry or category. It replaces the DEPRECATED CategoryCode type.
const ( PetShopsPetFoodAndSupplies BusinessCategory = "PET_SHOPS" VeterinaryServices BusinessCategory = "VETERINARY_SERVICES" ACAndHeatingContractors BusinessCategory = "AC_AND_HEATING_CONTRACTORS" CarpentryContractors BusinessCategory = "CARPENTRY_CONTRACTORS" ElectricalContractors BusinessCategory = "ELECTRICAL_CONTRACTORS" EquipmentToolsOrFurnitureRentalOrLeasing BusinessCategory = "EQUIPMENT_TOOLS_FURNITURE_RENTAL_LEASING" GeneralContractors BusinessCategory = "GENERAL_CONTRACTORS" SpecialTradeContractors BusinessCategory = "SPECIAL_TRADE_CONTRACTORS" CharityAndDonationsCategory BusinessCategory = "CHARITY_AND_DONATIONS" FundraisingCrowdfundingAndSocialServiceOrganizations BusinessCategory = "FUNDRAISING_CROWDFUNDING_SOCIAL_SERVICE" Apps BusinessCategory = "APPS" BooksMediaMoviesMusic BusinessCategory = "BOOKS_MEDIA_MOVIES_MUSIC" Games BusinessCategory = "GAMES" SoftwareAndSubscriptions BusinessCategory = "SOFTWARE_AND_SUBSCRIPTIONS" ChildCareServices BusinessCategory = "CHILD_CARE_SERVICES" CollegesOrUniversities BusinessCategory = "COLLEGES_UNIVERSITIES" ElementaryOrSecondarySchools BusinessCategory = "ELEMENTARY_SECONDARY_SCHOOLS" OtherEducationalServices BusinessCategory = "OTHER_EDUCATIONAL_SERVICES" VocationalSchoolsOrTradeSchools BusinessCategory = "VOCATIONAL_SCHOOLS_TRADE_SCHOOLS" AmusementParksCircusesCarnivalsAndFortuneTellers BusinessCategory = "AMUSEMENT_PARKS" EventTicketing BusinessCategory = "EVENT_TICKETING" GamingEstablishmentsBilliardsPoolBowlingArcades BusinessCategory = "GAMING_ESTABLISHMENTS" MovieTheatres BusinessCategory = "MOVIE_THEATRES" MusiciansBandsOrOrchestras BusinessCategory = "MUSICIANS_BANDS_ORCHESTRAS" OnlineGambling BusinessCategory = "ONLINE_GAMBLING" OtherEntertainmentAndRecreation BusinessCategory = "OTHER_ENTERTAINMENT_RECREATION" SportingAndRecreationalCamps BusinessCategory = "SPORTING_RECREATIONAL_CAMPS" SportsForecastingOrPredictionServices BusinessCategory = "SPORTS_FORECASTING" CreditCounsellingOrCreditRepair BusinessCategory = "CREDIT_COUNSELLING_REPAIR" DigitalWallets BusinessCategory = "DIGITAL_WALLETS" InvestmentServices BusinessCategory = "INVESTMENT_SERVICES" MoneyServicesOrTransmission BusinessCategory = "MONEY_SERVICES" MortgagesInsurancesLoansAndFinancialAdvice BusinessCategory = "MORTGAGES_INSURANCES_LOANS_FINANCIAL_ADVICE" SecurityBrokersOrDealers BusinessCategory = "SECURITY_BROKERS_DEALERS" TrustOffices BusinessCategory = "TRUST_OFFICES" VirtualCurrenciesAndCryptoCurrencies BusinessCategory = "VIRTUAL_CRYPTO_CURRENCIES" CaterersPrepareAndDelivery BusinessCategory = "CATERERS" FastFoodRestaurants BusinessCategory = "FAST_FOOD_RESTAURANTS" GroceryStoresSupermarketsAndFoodProductStores BusinessCategory = "FOOD_PRODUCT_STORES" RestaurantsNightlifeAndOtherOnPremiseConsumption BusinessCategory = "RESTAURANTS_NIGHTLIFE" BoatRentalsAndLeasing BusinessCategory = "BOAT_RENTALS_LEASING" CruiseLines BusinessCategory = "CRUISE_LINES" HotelsMotelsResortsInnsAndOtherLodgingAndHospitality BusinessCategory = "LODGING" PropertyRentalsOrCamping BusinessCategory = "PROPERTY_RENTALS_CAMPING" Marketplaces BusinessCategory = "MARKETPLACES" DentalLabAndOrOphthalmicEquipmentAndSupplies BusinessCategory = "DENTAL_EQUIPMENT_SUPPLIES" DentistsAndOrthodontists BusinessCategory = "DENTISTS_ORTHODONTISTS" DoctorsPhysiciansAndOtherMedicalServices BusinessCategory = "MEDICAL_SERVICES" DrugStoresPharmaciesAndPrescriptionMedicine BusinessCategory = "DRUG_PHARMACIES_PRESCRIPTION" MedicalDevices BusinessCategory = "MEDICAL_DEVICES" MedicalOrganizations BusinessCategory = "MEDICAL_ORGANIZATIONS" MentalHealthServices BusinessCategory = "MENTAL_HEALTH_SERVICES" NursingOrPersonalCareFacilitiesAndAssistedLiving BusinessCategory = "NURSING" OpticiansAndEyeglasses BusinessCategory = "OPTICIANS_EYEGLASSES" CivicFraternalOrSocialAssociations BusinessCategory = "SOCIAL_ASSOCIATIONS" GymsMembershipFeeBasedSports BusinessCategory = "MEMBERSHIP_FEE_BASED_SPORTS" OtherMembershipOrganizations BusinessCategory = "OTHER_MEMBERSHIP_ORGANIZATIONS" AdultContentOrServices BusinessCategory = "ADULT_CONTENT_SERVICES" CounselingServices BusinessCategory = "COUNSELING_SERVICES" DatingServices BusinessCategory = "DATING_SERVICES" HealthAndBeautySpas BusinessCategory = "HEALTH_BEAUTY_SPAS" LandscapingServices BusinessCategory = "LANDSCAPING_SERVICES" LaundryOrDryCleaningServices BusinessCategory = "LAUNDRY_DRYCLEANING_SERVICES" MassageParlours BusinessCategory = "MASSAGE_PARLOURS" OtherPersonalServices BusinessCategory = "OTHER_PERSONAL_SERVICES" PhotographyStudios BusinessCategory = "PHOTOGRAPHY_STUDIOS" SalonsOrBarbers BusinessCategory = "SALONS_BARBERS" PoliticalPartiesCategory BusinessCategory = "POLITICAL_PARTIES" AccountingAuditingBookkeepingAndTaxPreparationServices BusinessCategory = "ACCOUNTING_AUDITING_BOOKKEEPING_TAX_PREPARATION_SERVICES" AdvertisingServices BusinessCategory = "ADVERTISING_SERVICES" CleaningAndMaintenanceJanitorialServices BusinessCategory = "CLEANING_MAINTENANCE_JANITORIAL_SERVICES" ComputerRepair BusinessCategory = "COMPUTER_REPAIR" ConsultancyCategory BusinessCategory = "CONSULTANCY" DetectiveOrProtectiveAgenciesSecurityServices BusinessCategory = "SECURITY_SERVICES" DirectMarketing BusinessCategory = "DIRECT_MARKETING" FuneralServicesAndCrematories BusinessCategory = "FUNERAL_SERVICES" GovernmentServices BusinessCategory = "GOVERNMENT_SERVICES" HostingAndVpnServices BusinessCategory = "HOSTING_VPN_SERVICES" IndustrialSuppliesNotElsewhereClassified BusinessCategory = "INDUSTRIAL_SUPPLIES_NOT_ELSEWHERE_CLASSIFIED" LegalServicesAndAttorneys BusinessCategory = "LEGAL_SERVICES_ATTORNEYS" MotionPictureOrVideoTapeProductionAndOrDistribution BusinessCategory = "MOTION_PICTURES_DISTRIBUTION" OtherBusinessServices BusinessCategory = "OTHER_BUSINESS_SERVICES" PrintingAndPublishing BusinessCategory = "PRINTING_PUBLISHING" RealEstateAgents BusinessCategory = "REAL_ESTATE_AGENTS" SanitationPolishingAndSpecialtyCleaning BusinessCategory = "SANITATION_POLISHING_SPECIALTY_CLEANING" StationeryOrOfficeSupplies BusinessCategory = "OFFICE_SUPPLIES" TestingLaboratoriesNotMedical BusinessCategory = "TESTING_LABORATORIES_NOT_MEDICAL" TrainingAndCoaching BusinessCategory = "TRAINING_AND_COACHING" Utilities BusinessCategory = "UTILITIES" ReligiousOrganizations BusinessCategory = "RELIGIOUS_ORGANIZATIONS" SportsClothingShoesAndAccessories BusinessCategory = "CLOTHING_SHOES_ACCESSORIES" ArtDealersGalleriesCommercialPhotographyAndGraphics BusinessCategory = "COMMERCIAL_ART" BeautyProducts BusinessCategory = "BEAUTY_PRODUCTS" BooksPeriodicalsAndNewspapers BusinessCategory = "BOOKS_PERIODICALS_NEWSPAPERS" BuildingHomeImprovementAndEquipment BusinessCategory = "HOME_IMPROVEMENT" CardsGiftsNoveltyAndSouvenirShops BusinessCategory = "GIFTS_SHOPS" CbdOrMarijuanaRelatedProducts BusinessCategory = "CBD_MARIJUANA_PRODUCTS" CoffeeShopsOrGrowShops BusinessCategory = "COFFEE_SHOPS" ConvenienceStoresSpecialtyMarketsHealthFoodStores BusinessCategory = "CONVENIENCE_STORES" CreditsVouchersGiftCardsForNonFinancialInstitutions BusinessCategory = "GIFT_CARDS" EroticToys BusinessCategory = "EROTIC_TOYS" FloristsFloristSupplier BusinessCategory = "FLORISTS" FuelDealers BusinessCategory = "FUEL_DEALERS" FurnitureHomeFurnishingsAndEquipmentStores BusinessCategory = "FURNITURE_FURNISHINGS_EQUIPMENT_STORES" GameToyAndHobbyShops BusinessCategory = "GAME_TOY_HOBBY_SHOPS" GardenAndOutdoorEquipment BusinessCategory = "OUTDOOR_EQUIPMENT" HomeElectronicsAndPersonalComputers BusinessCategory = "HOME_ELECTRONICS" HouseholdApplianceStores BusinessCategory = "HOUSEHOLD_APPLIANCE_STORES" JewelryWatchClockAndSilverwareStoresUnder1000Euro BusinessCategory = "JEWELRY_WATCH_CLOCK_AND_SILVERWARE_STORES_UNDER_1000" MusicStoresInstrumentsAndRecords BusinessCategory = "MUSIC_STORES" OtherMerchandise BusinessCategory = "OTHER_MERCHANDISE" PackageStoresBeerWineAndLiquor BusinessCategory = "LIQUOR_STORES" PaidTelevisionOrRadioServicesCableOrSatellite BusinessCategory = "PAID_TELEVISION_RADIO" PreciousStonesMetalsWatchesAndJewelryOver1000Euro BusinessCategory = "PRECIOUS_STONES_METALS_JEWELRY_OVER_1000" RepairShopsAndRelatedServicesNotElsewhereClassified BusinessCategory = "REPAIR_SHOPS" SecondHandOrUsedMerchandiseStores BusinessCategory = "SECOND_HAND_STORES" SportingGoodsStoresMiscellaneousAndSpecialtyRetailShops BusinessCategory = "SPORTING_GOODS_SPECIALTY_RETAIL_SHOPS" SupplementsNutritionVitaminStores BusinessCategory = "SUPPLEMENTS_STORES" TelecomEquipment BusinessCategory = "TELECOM_EQUIPMENT" TelecomServices BusinessCategory = "TELECOM_SERVICES" TobaccoCigarsECigarettesAndRelatedProducts BusinessCategory = "TOBACCO_PRODUCTS" TradersInDiamonds BusinessCategory = "TRADERS_DIAMONDS" TradersInGold BusinessCategory = "TRADERS_GOLD" WeaponsOrAmmunition BusinessCategory = "WEAPONS_AMMUNITION" CommuterTransportation BusinessCategory = "COMMUTER_TRANSPORTATION" CourierServicesAndFreightForwarders BusinessCategory = "COURIER_SERVICES" OtherTransportationServices BusinessCategory = "OTHER_TRANSPORTATION_SERVICES" TaxisLimosAndRideSharing BusinessCategory = "RIDESHARING" TravelAgenciesTourOperatorsAndOtherTravelServices BusinessCategory = "TRAVEL_SERVICES" AutomotivePartsAndAccessories BusinessCategory = "AUTOMOTIVE_PARTS_ACCESSORIES" AutoAndTruckSalesAndServiceDealersAndLeasingCompanies BusinessCategory = "CAR_TRUCK_COMPANIES" AutomotiveServices BusinessCategory = "AUTOMOTIVE_SERVICES" BicyclePartsShopsAndService BusinessCategory = "BICYCLE_PARTS_SHOPS_SERVICE" CarBoatCamperMobileHomeDealer BusinessCategory = "CAR_BOAT_CAMPER_MOBILE_HOME_DEALER" CarRentals BusinessCategory = "CAR_RENTALS" MotorcyclePartsShopsAndDealers BusinessCategory = "MOTORCYCLE_PARTS_SHOPS_AND_DEALERS" )
Available business categories.
type Capture ¶
type Capture struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Mode Mode `json:"mode,omitempty"` Amount *Amount `json:"amount,omitempty"` Status CaptureStatus `json:"status,omitempty"` SettlementAmount *Amount `json:"settlementAmount,omitempty"` PaymentID string `json:"paymentId,omitempty"` ShipmentID string `json:"shipmentId,omitempty"` SettlementID string `json:"settlementId,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Metadata any `json:"metadata,omitempty"` Links CaptureLinks `json:"_links,omitempty"` CaptureAccessTokenFields }
Capture describes a single capture. Captures are used for payments that have the authorize-then-capture flow.
type CaptureAccessTokenFields ¶
type CaptureAccessTokenFields struct {
Testmode bool `json:"testmode,omitempty"`
}
CaptureAccessTokenFields describes the payload for creating a capture with an access token.
type CaptureLinks ¶
type CaptureLinks struct { Self *URL `json:"self,omitempty"` Payment *URL `json:"payment,omitempty"` Shipment *URL `json:"shipment,omitempty"` Settlement *URL `json:"settlement,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
CaptureLinks contains relevant links for a capture object.
type CaptureMode ¶
type CaptureMode string
CaptureMode describes the mode of a capture.
const ( AutomaticCapture CaptureMode = "automatic" ManualCapture CaptureMode = "manual" )
CaptureMode possible values.
type CaptureOptions ¶
type CaptureOptions struct {
Embed []EmbedValue `url:"embed,omitempty"`
}
CaptureOptions describes the query params available to use when retrieving captures.
See: https://docs.mollie.com/reference/get-capture#embedding-of-related-resources
type CaptureStatus ¶
type CaptureStatus string
CaptureStatus describes the status of a capture.
const ( CaptureStatusPending CaptureStatus = "pending" CaptureStatusSucceeded CaptureStatus = "succeeded" CaptureStatusFailed CaptureStatus = "failed" )
CaptureStatus possible values.
type CapturesList ¶
type CapturesList struct { Count int `json:"count,omitempty"` Embedded struct { Captures []*Capture } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
CapturesList describes a list of captures.
type CapturesService ¶
type CapturesService service
CapturesService operates over captures resource.
func (*CapturesService) Create ¶
func (cs *CapturesService) Create(ctx context.Context, payment string, capture CreateCapture) ( res *Response, c *Capture, err error, )
Create creates a new capture for a payment.
func (*CapturesService) Get ¶
func (cs *CapturesService) Get(ctx context.Context, payment, capture string, options *CaptureOptions) ( res *Response, c *Capture, err error, )
Get retrieves a single capture by its ID. Note the original payment’s ID is needed as well.
func (*CapturesService) List ¶
func (cs *CapturesService) List(ctx context.Context, payment string, options *CaptureOptions) ( res *Response, cl *CapturesList, err error, )
List retrieves all captures for a certain payment.
type CardLabel ¶
type CardLabel string
CardLabel Note that not all labels can be processed through Mollie.
const ( AmericaExpress CardLabel = "American Express" CartaSi CardLabel = "Carta Si" CarteBleue CardLabel = "Carte Bleue" Dankort CardLabel = "Dankort" DinersClub CardLabel = "Diners Club" Discover CardLabel = "Discover" JCB CardLabel = "JCB" Laser CardLabel = "Laser" Maestro CardLabel = "Maestro" Mastercard CardLabel = "Mastercard" Unionpay CardLabel = "Unionpay" Visa CardLabel = "Visa" Empty CardLabel = "null" )
Available card labels.
type CategoryCode ¶
type CategoryCode uint
CategoryCode is DEPRECATED! It is replaced by BusinessCategory type.
const ( BookMagazinesAndNewspapers CategoryCode = 5192 GeneralMerchandise CategoryCode = 5399 FoodAndDrinks CategoryCode = 5499 AutomotiveProducts CategoryCode = 5533 ChildrenProducts CategoryCode = 5641 ClothingAndShoes CategoryCode = 5651 MarketplaceCrowdfundingAndDonations CategoryCode = 5262 ElectronicsComputersAndSoftware CategoryCode = 5732 HostingOrVpnServices CategoryCode = 5734 Entertainment CategoryCode = 5735 CreditsOrVouchersOrGiftCards CategoryCode = 5815 Alcohol CategoryCode = 5921 JewelryAndAccessories CategoryCode = 5944 HealthAndBeautyProducts CategoryCode = 5977 FinancialServices CategoryCode = 6012 Consultancy CategoryCode = 7299 TravelRentalAndTransportation CategoryCode = 7999 AdvisingOrCoachingOrTraining CategoryCode = 8299 CharityAndDonations CategoryCode = 8398 PoliticalParties CategoryCode = 8699 Others CategoryCode = 0 )
DEPRECATED category codes. Replaced by BusinessCategory values.
type Chargeback ¶
type Chargeback struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` PaymentID string `json:"paymentId,omitempty"` Amount *Amount `json:"amount,omitempty"` SettlementAmount *Amount `json:"settlementAmount,omitempty"` Reason *ChargebackReason `json:"reason,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` ReversedAt *time.Time `json:"reversedAt,omitempty"` Links ChargebackLinks `json:"_links,omitempty"` ChargebackAccessTokenFields }
Chargeback describes a forced transaction reversal initiated by the cardholder's bank.
type ChargebackAccessTokenFields ¶
type ChargebackAccessTokenFields struct { ProfileID string `json:"profileId,omitempty"` Testmode bool `json:"testmode,omitempty"` }
ChargebackAccessTokenFields describes the fields to be used to create a chargeback access token.
type ChargebackLinks ¶
type ChargebackLinks struct { Self *URL `json:"self,omitempty"` Payment *URL `json:"payment,omitempty"` Settlement *URL `json:"settlement,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
ChargebackLinks describes all the possible links to be returned with a chargeback object.
type ChargebackOptions ¶
type ChargebackOptions struct { Include []IncludeValue `url:"include,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` }
ChargebackOptions describes chargeback endpoint valid query string parameters.
type ChargebackReason ¶
type ChargebackReason struct { Code string `json:"code,omitempty"` Description string `json:"description,omitempty"` }
ChargebackReason describes the reason for the chargeback as given by the bank.
type ChargebacksList ¶
type ChargebacksList struct { Count int `json:"count,omitempty"` Embedded struct { Chargebacks []*Chargeback } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
ChargebacksList describes how a list of chargebacks will be retrieved by Mollie.
type ChargebacksService ¶
type ChargebacksService service
ChargebacksService instance operates over chargeback resources.
func (*ChargebacksService) Get ¶
func (cs *ChargebacksService) Get(ctx context.Context, payment, chargeback string, opts *ChargebackOptions) ( res *Response, p *Chargeback, err error, )
Get retrieves a single chargeback by its ID. Note the original payment’s ID is needed as well.
func (*ChargebacksService) List ¶
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.
func (*ChargebacksService) ListForPayment ¶
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.
type Client ¶
type Client struct { BaseURL *url.URL // Services Payments *PaymentsService Chargebacks *ChargebacksService PaymentMethods *PaymentMethodsService Invoices *InvoicesService Organizations *OrganizationsService Profiles *ProfilesService Refunds *RefundsService Shipments *ShipmentsService Orders *OrdersService Settlements *SettlementsService Captures *CapturesService Subscriptions *SubscriptionsService Customers *CustomersService Wallets *WalletsService Mandates *MandatesService Permissions *PermissionsService Onboarding *OnboardingService PaymentLinks *PaymentLinksService Clients *ClientsService Balances *BalancesService ClientLinks *ClientLinksService Terminals *TerminalsService // contains filtered or unexported fields }
Client manages communication with Mollie's API.
func NewClient ¶
NewClient returns a new Mollie HTTP API client. You can pass a previously build http client, if none is provided then http.DefaultClient will be used.
NewClient will lookup the environment for values to assign to the API token (`MOLLIE_API_TOKEN`) and the Organization token (`MOLLIE_ORG_TOKEN`) according to the provided Config object.
You can also set the token values programmatically by using the Client WithAPIKey and WithOrganizationKey functions.
func (*Client) Do ¶
Do sends an API request and returns the API response or returned as an error if an API error has occurred.
func (*Client) HasAccessToken ¶
HasAccessToken will return true when the provided authentication token complies with the access token REGEXP match check. This will enable TestMode inside the request body.
See: https://github.com/VictorAvelar/mollie-api-go/issues/123
func (*Client) NewAPIRequest ¶
func (c *Client) NewAPIRequest(ctx context.Context, method string, uri string, body interface{}) ( req *http.Request, err error, )
NewAPIRequest is a wrapper around the http.NewRequest function.
It will setup the authentication headers/parameters according to the client config.
func (*Client) SetIdempotencyKeyGenerator ¶
func (c *Client) SetIdempotencyKeyGenerator(kg idempotency.KeyGenerator)
SetIdempotencyKeyGenerator allows you to pass your own idempotency key generator.
func (*Client) WithAuthenticationValue ¶
WithAuthenticationValue offers a convenient setter for any of the valid authentication tokens provided by Mollie.
Ideally your API key will be provided from and environment variable or a secret management engine. This should only be used when environment variables are "impossible" to be used.
type ClientLink ¶
type ClientLink struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` Links ClientLinkLinks `json:"_links,omitempty"` }
ClientLink object with redirect target.
type ClientLinkAuthorizeOptions ¶
type ClientLinkAuthorizeOptions struct { ClientID string `url:"clientId,omitempty"` State string `url:"state,omitempty"` Scope []PermissionGrant `del:"+" url:"scope,omitempty"` ApprovalPrompt ApprovalPromptAction `url:"approvalPrompt,omitempty"` }
ClientLinkAuthorizeOptions subset of the parameters allowed for the Authorize endpoint.
type ClientLinkLinks ¶
type ClientLinkLinks struct { ClientLink *URL `json:"clientLink,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
ClientLinkLinks describes all the possible links to be returned with a client links response object.
type ClientLinksService ¶
type ClientLinksService service
ClientLinksService interacts with the Client Links API to create new organizations for your customers.
func (*ClientLinksService) Create ¶
func (cls *ClientLinksService) Create(ctx context.Context, cd CreateClientLink) ( res *Response, cl *ClientLink, err error, )
Create a client link based on the provided CreateClientLink values.
func (*ClientLinksService) GetFinalClientLink ¶
func (cls *ClientLinksService) GetFinalClientLink( ctx context.Context, clientLink string, options *ClientLinkAuthorizeOptions, ) ( clientLinkURI string, )
GetFinalClientLink returns the final client link URI with the provided options.
type ClientsService ¶
type ClientsService service
ClientsService operates over the partners API.
func (*ClientsService) Get ¶
func (ps *ClientsService) Get(ctx context.Context, id string, opts *GetLinkedClientOptions) ( res *Response, pc *LinkedClient, err error, )
Get retrieves a single client, linked to your partner account, by its ID.
func (*ClientsService) List ¶
func (ps *ClientsService) List(ctx context.Context, opts *ListLinkedClientsOptions) ( res *Response, pc *LinkedClientList, err error, )
List retrieves all clients.
type Company ¶
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 ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains information that helps during the setup of a new Mollie client.
func NewAPIConfig ¶
NewAPIConfig builds a configuration object with the following settings: tests mode: disabled api token source: MOLLIE_API_TOKEN
it receives `reqIdem (boolean)` to enable the request idempotency feature.
Example ¶
ExampleNewAPIConfig demonstrates how to initialize a Config struct with testing mode disabled, token source from the default API token env variable (MOLLIE_API_TOKEN) and request idempotency feature enabled.
conf := NewAPIConfig(true) fmt.Printf( "testing api config, testing: %v, req_idempotency: %v, token source: %s.", conf.testing, conf.reqIdempotency, conf.auth, )
Output: testing api config, testing: false, req_idempotency: true, token source: MOLLIE_API_TOKEN.
func NewAPITestingConfig ¶
NewAPITestingConfig builds a configuration object with the following settings: tests mode: enabled api token source: MOLLIE_API_TOKEN
it receives `reqIdem (boolean)` to enable the request idempotency feature.
Example ¶
ExampleNewAPITestingConfig demonstrates how to initialize a Config struct with testing mode enabled, token source from the default API token env variable (MOLLIE_API_TOKEN) and request idempotency feature enabled.
conf := NewAPITestingConfig(true) fmt.Printf( "testing api config, testing: %v, req_idempotency: %v, token source: %s.", conf.testing, conf.reqIdempotency, conf.auth, )
Output: testing api config, testing: true, req_idempotency: true, token source: MOLLIE_API_TOKEN.
func NewConfig ¶
NewConfig builds a Mollie configuration object, it takes t to indicate if our client is meant to create requests for testing, and auth to indicate the authentication method we want to use.
Example ¶
ExampleNewConfig demonstrates how to initialize a Config struct with the specified values for testing and token source.
conf := NewConfig(true, APITokenEnv) fmt.Printf( "testing config, testing: %v, req_idempotency: %v, token source: %s.", conf.testing, conf.reqIdempotency, conf.auth, )
Output: testing config, testing: true, req_idempotency: false, token source: MOLLIE_API_TOKEN.
func NewOrgConfig ¶
NewOrgConfig builds a configuration object with the following settings: tests mode: disabled Org token source: MOLLIE_ORG_TOKEN
it receives `reqIdem (boolean)` to enable the request idempotency feature.
Example ¶
ExampleNewOrgConfig demonstrates how to initialize a Config struct with testing mode disabled, token source from the default Org token env variable (MOLLIE_ORG_TOKEN) and request idempotency feature enabled.
conf := NewOrgConfig(true) fmt.Printf( "testing org config, testing: %v, req_idempotency: %v, token source: %s.", conf.testing, conf.reqIdempotency, conf.auth, )
Output: testing org config, testing: false, req_idempotency: true, token source: MOLLIE_ORG_TOKEN.
func NewOrgTestingConfig ¶
NewOrgTestingConfig builds a configuration object with the following settings: tests mode: enabled api token source: MOLLIE_ORG_TOKEN
it receives `reqIdem (boolean)` to enable the request idempotency feature.
Example ¶
ExampleNewOrgTestingConfig demonstrates how to initialize a Config struct with testing mode enabled, token source from the default Org token env variable (MOLLIE_ORG_TOKEN) and request idempotency feature enabled.
conf := NewOrgTestingConfig(true) fmt.Printf( "testing org config, testing: %v, req_idempotency: %v, token source: %s.", conf.testing, conf.reqIdempotency, conf.auth, )
Output: testing org config, testing: true, req_idempotency: true, token source: MOLLIE_ORG_TOKEN.
func (*Config) SwitchAuthStrategy ¶
SwitchAuthStrategy changes the environment variable used to fetch the auth tokens.
Known values are: [MOLLIE_API_TOKEN,MOLLIE_ORG_TOKEN], if you use a custom environment variable pass it as argument.
func (*Config) ToggleIdempotency ¶
ToggleIdempotency enables/disables the request idempotency feature in the current Config.
func (*Config) ToggleTesting ¶
ToggleTesting enables/disables the test-mode in the current Config.
type ContextValue ¶
type ContextValue string
ContextValue represents a relevant value in the system associated with a BalanceTransaction.
type ContextValues ¶
type ContextValues map[TransactionType]ContextValue
ContextValues is a map of TransactionType to ContextValue.
func (*ContextValues) UnmarshalJSON ¶
func (cv *ContextValues) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface on ContextValues.
See: https://github.com/VictorAvelar/mollie-api-go/issues/251
type CreateCapture ¶
type CreateCapture struct { Description string `json:"description,omitempty"` Metadata any `json:"metadata,omitempty"` Amount *Amount `json:"amount,omitempty"` CaptureAccessTokenFields }
CreateCapture describes the payload for creating a capture.
type CreateClientLink ¶
type CreateClientLink struct { Owner Owner `json:"owner,omitempty"` Name string `json:"name,omitempty"` Address *Address `json:"address,omitempty"` RegistrationNumber string `json:"registrationNumber,omitempty"` VATNumber string `json:"vatNumber,omitempty"` }
CreateClientLink contains information to link a new organization to an OAuth application.
type CreateCustomer ¶
type CreateCustomer struct { Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Locale Locale `json:"locale,omitempty"` Metadata any `json:"metadata,omitempty"` }
CreateCustomer contains the parameters to create a customer.
type CreateMandate ¶
type CreateMandate struct { ConsumerName string `json:"consumerName,omitempty"` ConsumerAccount string `json:"consumerAccount,omitempty"` ConsumerBIC string `json:"consumerBic,omitempty"` ConsumerEmail string `json:"consumerEmail,omitempty"` MandateReference string `json:"mandateReference,omitempty"` PaypalBillingAgreementID string `json:"paypalBillingAgreementId,omitempty"` SignatureDate *ShortDate `json:"signatureDate,omitempty"` Method PaymentMethod `json:"method,omitempty"` CreateMandateAccessTokenFields }
CreateMandate contains the parameters to create a mandate.
type CreateMandateAccessTokenFields ¶
type CreateMandateAccessTokenFields struct {
Testmode bool `json:"testmode,omitempty"`
}
CreateMandateAccessTokenFields contains the parameters to create a mandate when using an access token.
type CreateMollieConnectPaymentFields ¶
type CreateMollieConnectPaymentFields struct { ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"` Routing []*PaymentRouting `json:"routing,omitempty"` }
CreateMollieConnectPaymentFields describes the fields to be sent to the Mollie API when creating a new payment using Mollie Connect.
See: https://docs.mollie.com/reference/create-payment#mollie-connect-parameters
type CreateOrUpdateProfile ¶
type CreateOrUpdateProfile struct { Name string `json:"name,omitempty"` Website string `json:"website,omitempty"` Email string `json:"email,omitempty"` Description string `json:"description,omitempty"` Phone PhoneNumber `json:"phone,omitempty"` BusinessCategory BusinessCategory `json:"businessCategory,omitempty"` CategoryCode CategoryCode `json:"categoryCode,omitempty"` Mode Mode `json:"mode,omitempty"` }
CreateOrUpdateProfile describes the parameters to create or update a profile.
type CreateOrder ¶
type CreateOrder struct { ShopperCountryMustMatchTheBillingCountry bool `json:"shopperCountryMustMatchTheBillingCountry,omitempty"` OrderNumber string `json:"orderNumber,omitempty"` RedirectURL string `json:"redirectUrl,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` CancelURL string `json:"cancelUrl,omitempty"` Amount *Amount `json:"amount,omitempty"` BillingAddress *OrderAddress `json:"billingAddress,omitempty"` ShippingAddress *OrderAddress `json:"shippingAddress,omitempty"` ConsumerDateOfBirth *ShortDate `json:"consumerDateOfBirth,omitempty"` Payment *OrderPayment `json:"payment,omitempty"` ExpiresAt *ShortDate `json:"expiresAt,omitempty"` Lines []OrderLine `json:"lines,omitempty"` Method []PaymentMethod `json:"method,omitempty"` Locale Locale `json:"locale,omitempty"` Metadata any `json:"metadata,omitempty"` OrderAccessTokenFields }
CreateOrder contains the parameters to create an order.
type CreateOrderRefund ¶
type CreateOrderRefund struct { Description string `json:"description,omitempty"` Metadata any `json:"metadata,omitempty"` Lines []*OrderRefundLine `json:"lines,omitempty"` PaymentRefundAccessTokenFields }
CreateOrderRefund describes the payload to create a refund associated to an order.
type CreatePayment ¶
type CreatePayment struct { Description string `json:"description,omitempty"` RedirectURL string `json:"redirectUrl,omitempty"` CancelURL string `json:"cancelUrl,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` RestrictPaymentMethodsToCountry string `json:"restrictPaymentMethodsToCountry,omitempty"` Amount *Amount `json:"amount,omitempty"` Locale Locale `json:"locale,omitempty"` Method []PaymentMethod `json:"method,omitempty"` Metadata any `json:"metadata,omitempty"` // Beta fields Lines []PaymentLines `json:"lines,omitempty"` // PaymentMethods specific fields DigitalGoods bool `json:"digitalGoods,omitempty"` ApplePayPaymentToken string `json:"applePayPaymentToken,omitempty"` BillingEmail string `json:"billingEmail,omitempty"` CardToken string `json:"cardToken,omitempty"` VoucherNumber string `json:"voucherNumber,omitempty"` VoucherPin string `json:"voucherPin,omitempty"` Issuer string `json:"issuer,omitempty"` ExtraMerchantData string `json:"extraMerchantData,omitempty"` SessionID string `json:"sessionId,omitempty"` CustomerReference string `json:"customerReference,omitempty"` TerminalID string `json:"terminalId,omitempty"` ConsumerName string `json:"consumerName,omitempty"` ConsumerAccount string `json:"consumerAccount,omitempty"` DueDate *ShortDate `json:"dueDate,omitempty"` ShippingAddress *Address `json:"shippingAddress,omitempty"` BillingAddress *Address `json:"billingAddress,omitempty"` Company *Company `json:"company,omitempty"` // Other case specific fields CreateRecurrentPaymentFields CreatePreAuthorizedPaymentFields CreatePaymentAccessTokenFields CreateMollieConnectPaymentFields }
CreatePayment describes the payload to be sent to the Mollie API when creating or updating a new payment.
Some fields are only valid for specific payment methods, and are documented in the Mollie API reference.
See: https://docs.mollie.com/reference/create-payment#payment-method-specific-parameters
type CreatePaymentAccessTokenFields ¶
type CreatePaymentAccessTokenFields struct { ProfileID string `json:"profileId,omitempty"` Testmode bool `json:"testmode,omitempty"` }
CreatePaymentAccessTokenFields describes the fields to be sent to the Mollie API when creating a new payment using an access token.
See: https://docs.mollie.com/reference/create-payment#access-token-parameters
type CreatePaymentRefund ¶
type CreatePaymentRefund struct { Description string `json:"description,omitempty"` Metadata any `json:"metadata,omitempty"` Amount *Amount `json:"amount,omitempty"` PaymentRefundAccessTokenFields PaymentRefundMollieConnectFields }
CreatePaymentRefund describes the payload to create a refund associated to a payment.
type CreatePreAuthorizedPaymentFields ¶
type CreatePreAuthorizedPaymentFields struct { CaptureDelay string `json:"captureDelay,omitempty"` CaptureMode CaptureMode `json:"captureMode,omitempty"` }
CreatePreAuthorizedPaymentFields describes the fields to be sent to the Mollie API when creating a new pre-authorized payment.
See: https://docs.mollie.com/reference/create-payment#parameters-for-pre-authorized-payments
type CreateRecurrentPaymentFields ¶
type CreateRecurrentPaymentFields struct { CustomerID string `json:"customerId,omitempty"` MandateID string `json:"mandateId,omitempty"` SequenceType SequenceType `json:"sequenceType,omitempty"` }
CreateRecurrentPaymentFields describes the fields to be sent to the Mollie API when creating a new recurrent payment.
See: https://docs.mollie.com/reference/create-payment#parameters-for-recurring-payments
type CreateShipment ¶
type CreateShipment struct { Lines []*OrderLine `json:"lines,omitempty"` Tracking *ShipmentTracking `json:"tracking,omitempty"` ShipmentAccessTokenFields }
CreateShipment contains information required to create a new shipment.
type CreateSubscription ¶
type CreateSubscription struct { Times int `json:"times,omitempty"` Interval string `json:"interval,omitempty"` Description string `json:"description,omitempty"` MandateID string `json:"mandateId,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` Amount *Amount `json:"amount,omitempty"` StartDate *ShortDate `json:"startDate,omitempty"` Method PaymentMethod `json:"method,omitempty"` Metadata any `json:"metadata,omitempty"` SubscriptionAccessTokenFields }
CreateSubscription contains the fields that are required to create a subscription.
type Customer ¶
type Customer struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Mode Mode `json:"mode,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Locale Locale `json:"locale,omitempty"` Metadata any `json:"metadata,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Links CustomerLinks `json:"_links,omitempty"` }
Customer represents buyers.
type CustomerLinks ¶
type CustomerLinks struct { Self *URL `json:"self,omitempty"` Dashboard *URL `json:"dashboard,omitempty"` Mandates *URL `json:"mandates,omitempty"` Subscriptions *URL `json:"subscriptions,omitempty"` Payments *URL `json:"payments,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
CustomerLinks contains the HAL resources for a customer response.
type CustomersList ¶
type CustomersList struct { Count int `json:"count,omitempty"` Embedded struct { Customers []*Customer `json:"customers,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"links,omitempty"` }
CustomersList contains a embedded list of customers wrapped in a standard Mollie paginated response.
type CustomersService ¶
type CustomersService service
CustomersService operates over the customer resource.
func (*CustomersService) Create ¶
func (cs *CustomersService) Create(ctx context.Context, c CreateCustomer) (res *Response, cc *Customer, err error)
Create creates a simple minimal representation of a customer in the Mollie API to use for the Mollie Checkout and Recurring features.
func (*CustomersService) CreatePayment ¶
func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p CreatePayment) ( res *Response, pp *Payment, err error, )
CreatePayment creates a payment for the customer.
See: https://docs.mollie.com/reference/create-customer-payment
func (*CustomersService) Delete ¶
Delete a customer.
All mandates and subscriptions created for this customer will be canceled as well.
func (*CustomersService) Get ¶
func (cs *CustomersService) Get(ctx context.Context, id string) (res *Response, c *Customer, err error)
Get finds a customer by its ID.
func (*CustomersService) GetPayments ¶
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.
See: https://docs.mollie.com/reference/list-customer-payments
func (*CustomersService) List ¶
func (cs *CustomersService) List(ctx context.Context, options *ListCustomersOptions) ( res *Response, cl *CustomersList, err error, )
List retrieves all customers created.
func (*CustomersService) Update ¶
func (cs *CustomersService) Update(ctx context.Context, id string, c UpdateCustomer) ( res *Response, cc *Customer, err error, )
Update an existing customer.
type EligibilityReasons ¶
type EligibilityReasons string
EligibilityReasons for paypal seller protection.
const ( Eligible EligibilityReasons = "Eligible" Ineligible EligibilityReasons = "Ineligible" INROnly EligibilityReasons = "Partially Eligible - INR Only" AuthOnly EligibilityReasons = "Partially Eligible - Unauth Only" PartiallyEligible EligibilityReasons = "PartiallyEligible" EligibilityNone EligibilityReasons = "None" ActiveFraudControlUnAuthPremium EligibilityReasons = "Active Fraud Control - Unauth Premium Eligible" )
Available eligibility reasons for Paypal sellers protection.
type EmbedValue ¶
type EmbedValue string
EmbedValue describes the valid value of embed query string.
const ( EmbedPayments EmbedValue = "payments" EmbedRefunds EmbedValue = "refunds" EmbedShipments EmbedValue = "shipments" EmbedChargebacks EmbedValue = "chargebacks" EmbedCaptures EmbedValue = "captures" EmbedOrganization EmbedValue = "organization" EmbedOnboarding EmbedValue = "onboarding" )
Valid Embed query string value.
const (
EmbedNestedPaymentDetails EmbedValue = "payments.details.remainderDetails"
)
Local embed value type.
type EnableVoucherIssuer ¶
type EnableVoucherIssuer struct {
ContractID string `json:"contractId,omitempty"`
}
EnableVoucherIssuer describes the parameters to enable a voucher issuer.
type EntityType ¶
type EntityType string
EntityType for an organization.
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 ¶
type ErrorLinks struct {
Documentation *URL `json:"documentation,omitempty"`
}
ErrorLinks container references to common urls returned with errors.
type FailureReason ¶
type FailureReason string
FailureReason provides a description on a failed payment.
const ( ReasonAuthenticationAbandoned FailureReason = "authentication_abandoned" ReasonInvalidCardNumber FailureReason = "invalid_card_number" ReasonInvalidCCV FailureReason = "invalid_ccv" ReasonInvalidCardHolderName FailureReason = "invalid_card_holder_name" ReasonCardExpired FailureReason = "card_expired" ReasonInvalidCardType FailureReason = "invalid_card_type" ReasonRefusedByIssuer FailureReason = "refused_by_issuer" ReasonInsufficientFunds FailureReason = "insufficient_funds" ReasonInactiveCard FailureReason = "inactive_card" ReasonUnknown FailureReason = "unknown_reason" ReasonPossibleFraud FailureReason = "possible_fraud" )
Possible failure reasons.
type GetLinkedClientOptions ¶
type GetLinkedClientOptions struct {
Embed []EmbedValue `url:"embed,omitempty"`
}
GetLinkedClientOptions contains valid query parameters for the get clients endpoint.
type GiftCardEnabled ¶
type GiftCardEnabled struct { Resource string `json:"resource,omitempty"` ID GiftCardIssuer `json:"id,omitempty"` Description string `json:"description,omitempty"` Status IssuerStatus `json:"status,omitempty"` Links GiftCardLinks `json:"_links,omitempty"` }
GiftCardEnabled describes the response of a gift card issuer enable operation.
type GiftCardIssuer ¶
type GiftCardIssuer string
GiftCardIssuer type describes issuers supported by mollie.
const ( BloemenCadeuKaart GiftCardIssuer = "bloemencadeaukaart" BloemPlantGiftCard GiftCardIssuer = "bloemplantgiftcard" Boekenbon GiftCardIssuer = "boekenbon" DaGiftCard GiftCardIssuer = "dagiftcard" DecaudeuKaart GiftCardIssuer = "decadeaukaart" DelokaleDecauKaart GiftCardIssuer = "delokalecadeaukaart" Dinercadeau GiftCardIssuer = "dinercadeau" Doenkadotickets GiftCardIssuer = "doenkadotickets" Fashioncheque GiftCardIssuer = "fashioncheque" Festivalcadeau GiftCardIssuer = "festivalcadeau" Good4fun GiftCardIssuer = "good4fun" Horseandgifts GiftCardIssuer = "horseandgifts" HuistuinCadeauKaart GiftCardIssuer = "huistuincadeaukaart" JewelCard GiftCardIssuer = "jewelcard" KlusCadeu GiftCardIssuer = "kluscadeau" Kunstencultuurcadeaukaart GiftCardIssuer = "kunstencultuurcadeaukaart" Nationalebioscoopbon GiftCardIssuer = "nationalebioscoopbon" Nationaleentertainmentcard GiftCardIssuer = "nationaleentertainmentcard" Nationalegolfbon GiftCardIssuer = "nationalegolfbon" Ohmygood GiftCardIssuer = "ohmygood" Podiumcadeaukaart GiftCardIssuer = "podiumcadeaukaart" Reiscadeau GiftCardIssuer = "reiscadeau" Restaurantcadeau GiftCardIssuer = "restaurantcadeau" Shoesandsneakerscadeu GiftCardIssuer = "shoesandsneakerscadeau" SodexoSportCulturePass GiftCardIssuer = "sodexosportculturepass" Sportenfitcadeau GiftCardIssuer = "sportenfitcadeau" Sustainablefashion GiftCardIssuer = "sustainablefashion" Travelcheq GiftCardIssuer = "travelcheq" Vvvgiftcard GiftCardIssuer = "vvvgiftcard" Vvvdinercheque GiftCardIssuer = "vvvdinercheque" Vvvlekkerweg GiftCardIssuer = "vvvlekkerweg" Webshopgiftcard GiftCardIssuer = "webshopgiftcard" Wijncadeukaart GiftCardIssuer = "wijncadeaukaart" Yourgift GiftCardIssuer = "yourgift" )
Supported gift card issuers. #nosec G101 -- This are the brands issuing gift cards.
type GiftCardLinks ¶
type GiftCardLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
GiftCardLinks are links embedded when a gift card is enabled.
type Image ¶
type Image struct { Size1x string `json:"size1X,omitempty"` Size2X string `json:"size2X,omitempty"` Svg string `json:"svg,omitempty"` }
Image describes a generic image resource retrieved by Mollie.
type IncludeValue ¶
type IncludeValue string
IncludeValue is a valid value for the Include query string parameter.
const ( IncludeQrCode IncludeValue = "details.qrCode" IncludeRemainderDetails IncludeValue = "details.remainderDetails" IncludeIssuers IncludeValue = "issuers" IncludePricing IncludeValue = "pricing" )
Supported Include values.
type Invoice ¶
type Invoice struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Reference string `json:"reference,omitempty"` VatNumber string `json:"vatNumber,omitempty"` IssuedAt string `json:"issuedAt,omitempty"` PaidAt string `json:"paidAt,omitempty"` DueAt string `json:"dueAt,omitempty"` NetAmount *Amount `json:"netAmount,omitempty"` VatAmount *Amount `json:"vatAmount,omitempty"` GrossAmount *Amount `json:"grossAmount,omitempty"` Lines []*LineItem `json:"lines,omitempty"` Status InvoiceStatus `json:"status,omitempty"` Links InvoiceLinks `json:"_links,omitempty"` }
Invoice describes an invoice details.
type InvoiceLinks ¶
type InvoiceLinks struct { Self *URL `json:"self,omitempty"` PDF *URL `json:"pdf,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
InvoiceLinks describes all the possible links to be returned with a invoice object.
type InvoiceStatus ¶
type InvoiceStatus string
InvoiceStatus status of the invoice.
const ( InvoiceStatusOpen InvoiceStatus = "open" InvoiceStatusPaid InvoiceStatus = "paid" InvoiceStatusOverdue InvoiceStatus = "overdue" )
Valid status of the invoice.
type InvoicesList ¶
type InvoicesList struct { Count int `json:"count,omitempty"` Embedded struct { Invoices []*Invoice `json:"invoices"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
InvoicesList describes how a list of invoices will be retrieved by Mollie.
type InvoicesService ¶
type InvoicesService service
InvoicesService instance operates over invoice resources.
func (*InvoicesService) Get ¶
func (is *InvoicesService) Get(ctx context.Context, id string) (res *Response, i *Invoice, err error)
Get retrieve details of an invoice, using the invoice’s identifier.
func (*InvoicesService) List ¶
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.
type IssuerStatus ¶
type IssuerStatus string
IssuerStatus describes the status of a gift card issuer in your account.
const ( PendingIssuer IssuerStatus = "pending-issuer" EnabledIssuer IssuerStatus = "enabled" )
Valid issuer statuses.
type LineItem ¶
type LineItem struct { Count int64 `json:"count,omitempty"` VatPercentage float64 `json:"vatPercentage,omitempty"` Period string `json:"period,omitempty"` Description string `json:"description,omitempty"` Amount *Amount `json:"amount,omitempty"` }
LineItem product details.
type LinkedClient ¶
type LinkedClient struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` OrganizationCreatedAt *time.Time `json:"organizationCreatedAt,omitempty"` Links LinkedClientLinks `json:"_links,omitempty"` }
LinkedClient describes a single client, linked to your partner account.
type LinkedClientLinks ¶
type LinkedClientLinks struct { Self *URL `json:"self,omitempty"` Organization *URL `json:"organization,omitempty"` Onboarding *URL `json:"onboarding,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
LinkedClientLinks contains URL objects relevant to the client.
type LinkedClientList ¶
type LinkedClientList struct { Count int `json:"count,omitempty"` PartnerClients struct { Clients []*LinkedClient `json:"clients,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
LinkedClientList describes a list of partner clients.
type ListBalanceTransactionsOptions ¶
type ListBalanceTransactionsOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` }
ListBalanceTransactionsOptions are valid query parameters for list balance transactions requests.
type ListBalancesOptions ¶
type ListBalancesOptions struct { Currency string `url:"currency,omitempty"` From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` }
ListBalancesOptions contains valid query parameters for the list balances endpoint.
type ListChargebacksOptions ¶
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"` }
ListChargebacksOptions describes list chargebacks endpoint valid query string parameters.
type ListCustomersOptions ¶
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"` }
ListCustomersOptions contains valid query parameters for the list customers endpoint.
type ListInvoicesOptions ¶
type ListInvoicesOptions struct { Limit int64 `url:"limit,omitempty"` Reference string `url:"reference,omitempty"` Year string `url:"year,omitempty"` From string `url:"from,omitempty"` }
ListInvoicesOptions describes list invoices endpoint valid query string parameters.
type ListLinkedClientsOptions ¶
type ListLinkedClientsOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` }
ListLinkedClientsOptions contains valid query parameters for the list clients endpoint.
type ListMandatesOptions ¶
type ListMandatesOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` }
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 ListOrderRefundsOptions ¶
type ListOrderRefundsOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` Embed EmbedValue `url:"embed,omitempty"` }
ListOrderRefundsOptions describes order endpoint valid query string parameters.
type ListOrdersOptions ¶
type ListOrdersOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` Sort string `url:"sort,omitempty"` ProfileID string `url:"profileId,omitempty"` }
ListOrdersOptions describes order endpoint valid query string parameters.
type ListPaymentMethodsOptions ¶
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"` }
ListPaymentMethodsOptions are applicable query string parameters to list methods from mollie's API.
It contains list specific options and embeds GetMethodOptions.
type ListPaymentsOptions ¶
type ListPaymentsOptions struct { Limit int `url:"limit,omitempty"` Include []IncludeValue `url:"include,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` ProfileID string `url:"profileId,omitempty"` From string `url:"from,omitempty"` }
ListPaymentsOptions describes list payments endpoint valid query string parameters.
type ListProfilesOptions ¶
type ListProfilesOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` }
ListProfilesOptions are optional query string parameters for the list profiles request.
type ListRefundsOptions ¶
type ListRefundsOptions struct { Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` ProfileID string `url:"profileId,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` }
ListRefundsOptions describes payment and order refunds list endpoint valid query string parameters.
type ListSettlementsOptions ¶
type ListSettlementsOptions struct { From string `url:"from,omitempty"` Limit int `url:"limit,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` }
ListSettlementsOptions contains query parameters for settlement lists.
type ListSubscriptionsOptions ¶
type ListSubscriptionsOptions struct { Testmode bool `url:"testmode,omitempty"` Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` ProfileID string `url:"profileId,omitempty"` }
ListSubscriptionsOptions holds query string parameters valid for subscription lists.
type ListTerminalsOptions ¶
type ListTerminalsOptions struct { Testmode bool `url:"testMode,omitempty"` Limit int `url:"limit,omitempty"` From string `url:"from,omitempty"` ProfileID string `url:"profileID,omitempty"` }
ListTerminalsOptions holds query string parameters valid for terminals lists.
ProfileID and TestMode are valid only when using access tokens.
type Locale ¶
type Locale string
Locale represents a country and language in ISO-15897 format.
const ( English Locale = "en_US" EnglishGB Locale = "en_GB" Dutch Locale = "nl_NL" DutchBelgium Locale = "nl_BE" French Locale = "fr_FR" FrenchBelgium Locale = "fr_BE" German Locale = "de_DE" GermanAustria Locale = "de_AT" GermanSwiss Locale = "de_CH" Spanish Locale = "es_ES" Catalan Locale = "ca_ES" Portuguese Locale = "pt_PT" Italian Locale = "it_IT" Norwegian Locale = "nb_NO" Swedish Locale = "sv_SE" Finish Locale = "fi_FI" Danish Locale = "da_DK" Icelandic Locale = "is_IS" Hungarian Locale = "hu_HU" Polish Locale = "pl_PL" Latvian Locale = "lv_LV" Lithuanian Locale = "lt_LT" )
Mollie supported locales.
type Mandate ¶
type Mandate struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` ConsumerName string `json:"consumerName,omitempty"` ConsumerAccount string `json:"consumerAccount,omitempty"` ConsumerBic string `json:"consumerBic,omitempty"` MandateReference string `json:"mandateReference,omitempty"` SignatureDate *ShortDate `json:"signatureDate,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Mode Mode `json:"mode,omitempty"` Status MandateStatus `json:"status,omitempty"` Method PaymentMethod `json:"method,omitempty"` Details MandateDetails `json:"details,omitempty"` Links MandateLinks `json:"_links,omitempty"` }
Mandate allow you to charge a customer’s credit card or bank account recurrently.
type MandateDetails ¶
type MandateDetails struct { ConsumerName string `json:"consumerName,omitempty"` ConsumerAccount string `json:"consumerAccount,omitempty"` ConsumerBic string `json:"consumerBic,omitempty"` CardHolder string `json:"cardHolder,omitempty"` CardNumber string `json:"cardNumber,omitempty"` CardFingerprint string `json:"cardFingerprint,omitempty"` CardExpiryDate *ShortDate `json:"cardExpiryDate,omitempty"` CardLabel CardLabel `json:"cardLabel,omitempty"` }
MandateDetails are possible values inside the mandate.details field.
type MandateLinks ¶
type MandateLinks struct { Self *URL `json:"self,omitempty"` Customer *URL `json:"customer,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
MandateLinks response objects.
type MandateStatus ¶
type MandateStatus string
MandateStatus for the Mandate object.
const ( PendingMandate MandateStatus = "pending" ValidMandate MandateStatus = "valid" InvalidMandate MandateStatus = "invalid" )
Valid mandate statuses.
type MandatesList ¶
type MandatesList struct { Count int `json:"count,omitempty"` Embedded struct { Mandates []*Mandate } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
MandatesList describes how a list of mandates will be retrieved by Mollie.
type MandatesService ¶
type MandatesService service
MandatesService operates over customer mandates endpoints.
func (*MandatesService) Create ¶
func (ms *MandatesService) Create(ctx context.Context, customer string, mandate CreateMandate) ( res *Response, mr *Mandate, err error, )
Create a mandate for a specific customer.
Mandates allow you to charge a customer’s credit card or bank account recurrently.
func (*MandatesService) Get ¶
func (ms *MandatesService) Get(ctx context.Context, customer, mandate string) (res *Response, mr *Mandate, err error)
Get retrieves a mandate by its ID and its customer’s ID. The mandate will either contain IBAN or credit card details, depending on the type of mandate.
func (*MandatesService) List ¶
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.
func (*MandatesService) Revoke ¶
func (ms *MandatesService) Revoke(ctx context.Context, customer, mandate string) (res *Response, err error)
Revoke a customer’s mandate.
You will no longer be able to charge the consumer’s bank account or credit card with this mandate and all connected subscriptions will be canceled.
type MethodsLinks ¶
type MethodsLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
MethodsLinks describes links attached to methods service responses.
type MollieConnectPaymentFields ¶
type MollieConnectPaymentFields struct {
ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"`
}
MollieConnectPaymentFields describes the fields specific to Mollie Connect payments.
type Onboarding ¶
type Onboarding struct { CanReceivePayments bool `json:"canReceivePayments,omitempty"` CanReceiveSettlements bool `json:"canReceiveSettlements,omitempty"` Resource string `json:"reference,omitempty"` Name string `json:"name,omitempty"` SignedUpAt *time.Time `json:"signedUpAt,omitempty"` Status OnboardingStatus `json:"status,omitempty"` Links OnboardingLinks `json:"_links,omitempty"` }
Onboarding data for an organization.
type OnboardingData ¶
type OnboardingData struct { Organization OnboardingDataOrganization `json:"organization,omitempty"` Profile OnboardingDataProfile `json:"profile,omitempty"` }
Full onboarding data to be submitted.
type OnboardingDataOrganization ¶
type OnboardingDataOrganization struct { Name string `json:"name,omitempty"` RegistrationNumber string `json:"registrationNumber,omitempty"` VatNumber string `json:"vatNumber,omitempty"` VatRegulation string `json:"vatRegulation,omitempty"` Address *Address `json:"address,omitempty"` }
OnboardingDataOrganization contains data of the organization you want to provide.
type OnboardingDataProfile ¶
type OnboardingDataProfile struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Email string `json:"email,omitempty"` Description string `json:"description,omitempty"` Phone string `json:"phone,omitempty"` BusinessCategory BusinessCategory `json:"businessCategory,omitempty"` }
OnboardingDataProfile contains data of the payment profile you want to provide.
type OnboardingLinks ¶
type OnboardingLinks struct { Self *URL `json:"self,omitempty"` Dashboard *URL `json:"dashboard,omitempty"` Organization *URL `json:"organization,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
OnboardingLinks contains URL objects relevant to the onboarding status.
type OnboardingService ¶
type OnboardingService service
OnboardingService operates over the onboarding API.
func (*OnboardingService) GetOnboardingStatus ¶
func (os *OnboardingService) GetOnboardingStatus(ctx context.Context) (res *Response, o *Onboarding, err error)
GetOnboardingStatus gets the status of onboarding of the authenticated organization.
See: https://docs.mollie.com/reference/get-onboarding-status
func (*OnboardingService) SubmitOnboardingData ¶
func (os *OnboardingService) SubmitOnboardingData(ctx context.Context, d *OnboardingData) (res *Response, err error)
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: https://docs.mollie.com/reference/submit-onboarding-data
type OnboardingStatus ¶
type OnboardingStatus string
OnboardingStatus describes status of the organization’s onboarding process.
const ( NeedsDataOnboardingStatus OnboardingStatus = "needs-data" InReviewOnboardingStatus OnboardingStatus = "in-review" CompletedOnboardingStatus OnboardingStatus = "completed" )
Possible status values.
type Order ¶
type Order struct { IsCancelable bool `json:"isCancelable,omitempty"` ShopperCountryMustMatchTheBillingCountry bool `json:"shopperCountryMustMatchTheBillingCountry,omitempty"` Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` ProfileID string `json:"profileId,omitempty"` RedirectURL string `json:"redirectUrl,omitempty"` CancelURL string `json:"cancelUrl,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` OrderNumber string `json:"orderNumber,omitempty"` Lines []*OrderLine `json:"lines,omitempty"` Amount *Amount `json:"amount,omitempty"` AmountCaptured *Amount `json:"amountCaptured,omitempty"` AmountRefunded *Amount `json:"amountRefunded,omitempty"` BillingAddress *OrderAddress `json:"billingAddress,omitempty"` ConsumerDateOfBirth *ShortDate `json:"consumerDateOfBirth,omitempty"` ShippingAddress *OrderAddress `json:"shippingAddress,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` ExpiresAt *time.Time `json:"expiresAt,omitempty"` ExpiredAt *time.Time `json:"expiredAt,omitempty"` PaidAt *time.Time `json:"paidAt,omitempty"` AuthorizedAt *time.Time `json:"authorizedAt,omitempty"` CanceledAt *time.Time `json:"canceledAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` Method PaymentMethod `json:"method,omitempty"` Mode Mode `json:"mode,omitempty"` Locale Locale `json:"locale,omitempty"` Status OrderStatus `json:"status,omitempty"` Links OrderLinks `json:"_links,omitempty"` Metadata any `json:"metadata,omitempty"` Embedded struct { Payments []*Payment `json:"payments,omitempty"` Refunds []*Refund `json:"refunds,omitempty"` } `json:"_embedded,omitempty"` }
Order explain the items that customers need to pay for.
type OrderAccessTokenFields ¶
type OrderAccessTokenFields struct { ProfileID string `json:"profileId,omitempty"` Testmode bool `json:"testmode,omitempty"` }
OrderAccessTokenFields contains the fields available to include in an order when using an access token.
type OrderAddress ¶
type OrderAddress struct { OrganizationName string `json:"organizationName,omitempty"` Title string `json:"title,omitempty"` GivenName string `json:"givenName,omitempty"` FamilyName string `json:"familyName,omitempty"` Email string `json:"email,omitempty"` StreetAndNumber string `json:"streetAndNumber,omitempty"` StreetAdditional string `json:"streetAdditional,omitempty"` PostalCode string `json:"postalCode,omitempty"` City string `json:"city,omitempty"` Region string `json:"region,omitempty"` Country string `json:"country,omitempty"` Phone PhoneNumber `json:"phone,omitempty"` }
OrderAddress identify both the address and the person the order is billed or shipped to.
type OrderLine ¶
type OrderLine struct { IsCancelable bool `json:"isCancelable,omitempty"` Quantity int `json:"quantity,omitempty"` QuantityShipped int `json:"quantityShipped,omitempty"` QuantityRefunded int `json:"quantityRefunded,omitempty"` QuantityCanceled int `json:"quantityCanceled,omitempty"` ShippableQuantity int `json:"shippableQuantity,omitempty"` RefundableQuantity int `json:"refundableQuantity,omitempty"` CancelableQuantity int `json:"cancelableQuantity,omitempty"` Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` OrderID string `json:"orderId,omitempty"` Name string `json:"name,omitempty"` VatRate string `json:"vatRate,omitempty"` SKU string `json:"sku,omitempty"` AmountShipped *Amount `json:"amountShipped,omitempty"` AmountRefunded *Amount `json:"amountRefunded,omitempty"` AmountCanceled *Amount `json:"amountCanceled,omitempty"` UnitPrice *Amount `json:"unitPrice,omitempty"` DiscountAmount *Amount `json:"discountAmount,omitempty"` TotalAmount *Amount `json:"totalAmount,omitempty"` VatAmount *Amount `json:"vatAmount,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` ProductType ProductKind `json:"type,omitempty"` Status OrderLineStatus `json:"status,omitempty"` Links OrderLineLinks `json:"_links,omitempty"` }
OrderLine contain the actual things the customer bought.
type OrderLineChangeInstruction ¶
type OrderLineChangeInstruction struct { Operation OrderLineOperation `json:"operation,omitempty"` Data *OrderLineOperationData `json:"data,omitempty"` }
OrderLineChangeInstruction contains details on what needs to be changed when managing order lines.
type OrderLineLinks ¶
type OrderLineLinks struct { ProductURL *URL `json:"productUrl,omitempty"` ImageURL *URL `json:"imageUrl,omitempty"` }
OrderLineLinks describes object with several URL objects relevant to the order line.
type OrderLineOperation ¶
type OrderLineOperation string
OrderLineOperation describes supported operations when managing order lines.
const ( AddOrderLineOperation OrderLineOperation = "add" UpdateOrderLineOperation OrderLineOperation = "update" CancelOrderLineOperation OrderLineOperation = "cancel" )
Supported order lines operation types.
type OrderLineOperationData ¶
type OrderLineOperationData struct { Quantity int `json:"quantity,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` SKU string `json:"sku,omitempty"` ImageURL string `json:"imageUrl,omitempty"` ProductURL string `json:"productUrl,omitempty"` VATRate string `json:"vatRate,omitempty"` Kind ProductKind `json:"type,omitempty"` Category OrderLineOperationProductCategory `json:"category,omitempty"` Amount *Amount `json:"amount,omitempty"` UnitPrice *Amount `json:"unitPrice,omitempty"` DiscountAmount *Amount `json:"discountAmount,omitempty"` VATAmount *Amount `json:"vatAmount,omitempty"` TotalAmount *Amount `json:"totalAmount,omitempty"` Metadata any `json:"metadata,omitempty"` OrderAccessTokenFields }
OrderLineOperationData contains the order line’s details for an update operation.
type OrderLineOperationProductCategory ¶
type OrderLineOperationProductCategory string
OrderLineOperationProductCategory contains the product category.
const ( MealProductCategory OrderLineOperationProductCategory = "meal" EcoProductCategory OrderLineOperationProductCategory = "eco" GiftProductCategory OrderLineOperationProductCategory = "gift" )
Product category possible values.
type OrderLineOperations ¶
type OrderLineOperations struct {
Operations []*OrderLineChangeInstruction `json:"operations,omitempty"`
}
OrderLineOperations contains the operations to be performed when managing order lines.
type OrderLineStatus ¶
type OrderLineStatus string
OrderLineStatus describes status of the order line.
const ( OrderLineCreated OrderLineStatus = "created" OrderLineAuthorized OrderLineStatus = "authorized" OrderLinePaid OrderLineStatus = "paid" OrderLineShipping OrderLineStatus = "shipping" OrderLineCanceled OrderLineStatus = "canceled" OrderLineCompleted OrderLineStatus = "completed" )
Valid order line status.
type OrderLinks ¶
type OrderLinks struct { Self *URL `json:"self,omitempty"` Checkout *URL `json:"checkout,omitempty"` Documentation *URL `json:"documentation,omitempty"` Dashboard *URL `json:"dashboard,omitempty"` }
OrderLinks describes an object with several URL objects relevant to the order. Every URL object will contain an href and a type field.
type OrderOptions ¶
type OrderOptions struct { ProfileID string `url:"profileId,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` }
OrderOptions describes order endpoint valid query string parameters.
type OrderPayment ¶
type OrderPayment struct { ApplePayPaymentToken string `json:"applePayPaymentToken,omitempty"` CardToken string `json:"cardToken,omitempty"` ConsumerAccount string `json:"consumerAccount,omitempty"` CustomerID string `json:"customerId,omitempty"` CustomerReference string `json:"customerReference,omitempty"` ExtraMerchantData string `json:"extraMerchantData,omitempty"` Issuer string `json:"issuer,omitempty"` VoucherNumber string `json:"voucherNumber,omitempty"` VoucherPin string `json:"voucherPin,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` BillingEmail string `json:"billingEmail,omitempty"` SessionID string `json:"sessionId,omitempty"` TerminalID string `json:"terminalId,omitempty"` ConsumerName string `json:"consumerName,omitempty"` DueDate *ShortDate `json:"dueDate,omitempty"` ShippingAddress *Address `json:"shippingAddress,omitempty"` BillingAddress *Address `json:"billingAddress,omitempty"` Company *Company `json:"company,omitempty"` // Only available when using access tokens. ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"` SequenceType SequenceType `json:"sequenceType,omitempty"` Method []PaymentMethod `json:"method,omitempty"` }
OrderPayment describes payment specific parameters that can be passed during order creation.
type OrderRefundLine ¶
type OrderRefundLine struct { Quantity int `json:"quantity,omitempty"` ID string `json:"id,omitempty"` Amount *Amount `json:"amount,omitempty"` }
OrderRefundLine describes the payload to create a refund associated to an order line.
type OrderRefundsList ¶
type OrderRefundsList struct { Count int `json:"count,omitempty"` Embedded struct { Refunds []*Refund `json:"refund,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"links,omitempty"` }
OrderRefundsList for containing the response of list orders.
type OrderStatus ¶
type OrderStatus string
OrderStatus describes the valid order status.
const ( Created OrderStatus = "created" Paid OrderStatus = "paid" Authorized OrderStatus = "authorized" Canceled OrderStatus = "canceled" Shipping OrderStatus = "shipping" Completed OrderStatus = "completed" Expired OrderStatus = "expired" )
Valid order status.
type OrdersList ¶
type OrdersList struct { Count int `json:"count,omitempty"` Embedded struct { Orders []*Order `json:"orders,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"links,omitempty"` }
OrdersList for containing the response of list orders.
type OrdersService ¶
type OrdersService service
OrdersService instance operates over refund resources.
func (*OrdersService) Cancel ¶
func (ors *OrdersService) Cancel(ctx context.Context, orderID string) (res *Response, order *Order, err error)
Cancel try to cancel the order that fulfill certain requirements.
func (*OrdersService) CancelOrderLines ¶
func (ors *OrdersService) CancelOrderLines(ctx context.Context, orderID string, orderLines []OrderLine) ( res *Response, err error, )
CancelOrderLines can be used to cancel one or more order lines that were previously authorized using a pay after delivery payment method. Use the Cancel Order API if you want to cancel the entire order or the remainder of the order.
func (*OrdersService) Create ¶
func (ors *OrdersService) Create(ctx context.Context, ord CreateOrder, opts *OrderOptions) ( res *Response, order *Order, err error, )
Create an order will automatically create the required payment to allow your customer to pay for the order.
func (*OrdersService) CreateOrderPayment ¶
func (ors *OrdersService) CreateOrderPayment(ctx context.Context, orderID string, ordPay *OrderPayment) ( res *Response, payment *Payment, err error, )
CreateOrderPayment can only be created while the status of the order is created, and when the status of the existing payment is either expired, canceled or failed.
func (*OrdersService) CreateOrderRefund ¶
func (ors *OrdersService) CreateOrderRefund(ctx context.Context, orderID string, order *Order) ( res *Response, refund *Refund, err error, )
CreateOrderRefund using the Orders API, refunds should be made against the order.
func (*OrdersService) Get ¶
func (ors *OrdersService) Get(ctx context.Context, orID string, opts *OrderOptions) ( res *Response, order *Order, err error, )
Get retrieve a single order by its ID.
func (*OrdersService) List ¶
func (ors *OrdersService) List(ctx context.Context, opts *ListOrdersOptions) ( res *Response, ordList *OrdersList, err error, )
List is to retrieve all orders.
func (*OrdersService) ListOrderRefunds ¶
func (ors *OrdersService) ListOrderRefunds(ctx context.Context, orderID string, opts *ListOrderRefundsOptions) ( res *Response, orderListRefund *OrderRefundsList, err error, )
ListOrderRefunds retrieve all order refunds.
func (*OrdersService) ManageOrderLines ¶
func (ors *OrdersService) ManageOrderLines(ctx context.Context, orderID string, operations *OrderLineOperations) ( res *Response, order *Order, err error, )
ManageOrderLines allows to update, cancel, or add one or more order lines.
func (*OrdersService) Update ¶
func (ors *OrdersService) Update(ctx context.Context, orderID string, ord UpdateOrder) ( res *Response, order *Order, err error, )
Update is used to update the billing and/or shipping address of an order.
func (*OrdersService) UpdateOrderLine ¶
func (ors *OrdersService) UpdateOrderLine( ctx context.Context, orderID string, orderLineID string, orderLine UpdateOrderLine) ( res *Response, order *Order, err error, )
UpdateOrderLine can be used to update an order line.
type Organization ¶
type Organization struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Locale string `json:"locale,omitempty"` Address *Address `json:"address,omitempty"` RegistrationNumber string `json:"registrationNumber,omitempty"` VatNumber string `json:"vatNumber,omitempty"` VatRegulation string `json:"vatRegulation,omitempty"` Links OrganizationLinks `json:"_links,omitempty"` }
Organization describes an organization detail.
type OrganizationLinks ¶
type OrganizationLinks struct { Self *URL `json:"self,omitempty"` Chargebacks *URL `json:"chargebacks,omitempty"` Customers *URL `json:"customers,omitempty"` Dashboard *URL `json:"dashboard,omitempty"` Invoices *URL `json:"invoices,omitempty"` Payments *URL `json:"payments,omitempty"` Profiles *URL `json:"profiles,omitempty"` Refunds *URL `json:"refunds,omitempty"` Settlements *URL `json:"settlements,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
OrganizationLinks describes all the possible links to be returned with a organization object.
type OrganizationPartnerLinks ¶
type OrganizationPartnerLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` SignUpLink *URL `json:"signuplink,omitempty"` }
OrganizationPartnerLinks is an object with several URL objects relevant to the partner resource.
type OrganizationPartnerStatus ¶
type OrganizationPartnerStatus struct { IsCommissionPartner bool `json:"isCommissionPartner,omitempty"` PartnerContractUpdateAvailable bool `json:"partnerContractUpdate_available,omitempty"` Resource string `json:"resource,omitempty"` PartnerType PartnerType `json:"partnerType,omitempty"` UserAgentTokens []*UserAgentToken `json:"userAgentTokens,omitempty"` PartnerContractSignedAt *time.Time `json:"partnerContractSignedAt,omitempty"` PartnerContractExpiresAt *time.Time `json:"partnerContractExpiresAt,omitempty"` Links OrganizationPartnerLinks `json:"_links,omitempty"` }
OrganizationPartnerStatus response descriptor.
type OrganizationsService ¶
type OrganizationsService service
OrganizationsService instance operates over organization resources.
func (*OrganizationsService) Get ¶
func (os *OrganizationsService) Get(ctx context.Context, id string) (res *Response, o *Organization, err error)
Get retrieve an organization by its id.
func (*OrganizationsService) GetCurrent ¶
func (os *OrganizationsService) GetCurrent(ctx context.Context) (res *Response, o *Organization, err error)
GetCurrent retrieve the currently authenticated organization.
func (*OrganizationsService) GetPartnerStatus ¶
func (os *OrganizationsService) GetPartnerStatus(ctx context.Context) ( res *Response, ops *OrganizationPartnerStatus, err error, )
GetPartnerStatus retrieves details about the partner status of the currently authenticated organization.
type Owner ¶
type Owner struct { Email string `json:"email,omitempty"` GivenName string `json:"givenName,omitempty"` FamilyName string `json:"familyName,omitempty"` Locale Locale `json:"locale,omitempty"` }
Personal data of your customer.
type PaginationLinks ¶
type PaginationLinks struct { Self *URL `json:"self,omitempty"` Previous *URL `json:"previous,omitempty"` Next *URL `json:"next,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
PaginationLinks describes the hal component of paginated responses.
type PartnerType ¶
type PartnerType string
PartnerType alias for organization partner types.
const ( PartnerTypeOauth PartnerType = "oauth" PartnerTypeSignUpLink PartnerType = "signuplink" PartnerTypeUserAgent PartnerType = "useragent" )
Available partner types.
type Payment ¶
type Payment struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Status string `json:"status,omitempty"` Description string `json:"description,omitempty"` CancelURL string `json:"cancelUrl,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` CountryCode string `json:"countryCode,omitempty"` RestrictPaymentMethodsToCountry string `json:"restrictPaymentMethodsToCountry,omitempty"` ProfileID string `json:"profileId,omitempty"` SettlementID string `json:"settlementId,omitempty"` OrderID string `json:"orderId,omitempty"` IsCancelable bool `json:"isCancelable,omitempty"` Mode Mode `json:"mode,omitempty"` Locale Locale `json:"locale,omitempty"` Method PaymentMethod `json:"method,omitempty"` Metadata any `json:"metadata,omitempty"` Links PaymentLinks `json:"_links,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` AuthorizedAt *time.Time `json:"authorizedAt,omitempty"` PaidAt *time.Time `json:"paidAt,omitempty"` CanceledAt *time.Time `json:"canceledAt,omitempty"` ExpiresAt *time.Time `json:"expiresAt,omitempty"` ExpiredAt *time.Time `json:"expiredAt,omitempty"` FailedAt *time.Time `json:"failedAt,omitempty"` Amount *Amount `json:"amount,omitempty"` AmountRefunded *Amount `json:"amountRefunded,omitempty"` AmountRemaining *Amount `json:"amountRemaining,omitempty"` AmountCaptured *Amount `json:"amountCaptured,omitempty"` AmountChargedBack *Amount `json:"amountChargedback,omitempty"` SettlementAmount *Amount `json:"settlementAmount,omitempty"` // Beta fields Lines []PaymentLines `json:"lines,omitempty"` // PaymentMethods specific fields Details PaymentDetails `json:"details,omitempty"` // Other case specific fields RecurrentPaymentFields PreAuthorizedPaymentFields MollieConnectPaymentFields AccessTokenPaymentFields }
Payment describes a transaction between a customer and a merchant.
type PaymentDestination ¶
type PaymentDestination struct { Kind string `json:"type,omitempty"` OrganizationID string `json:"organizationId,omitempty"` }
PaymentDestination describes the destination of a payment.
type PaymentDetails ¶
type PaymentDetails struct { PaypalDigitalGoods bool `json:"digitalGoods,omitempty"` BankAccount string `json:"bankAccount,omitempty"` BankBIC string `json:"bankBic,omitempty"` BankName string `json:"bankName,omitempty"` BankReason string `json:"bankReason,omitempty"` BatchReference string `json:"batchReference,omitempty"` BillingEmail string `json:"billingEmail,omitempty"` CardAudience string `json:"cardAudience,omitempty"` CardCountryCode string `json:"cardCountryCode,omitempty"` CardFingerPrint string `json:"cardFingerPrint,omitempty"` CardHolder string `json:"cardHolder,omitempty"` CardLabel string `json:"cardLabel,omitempty"` CardNumber string `json:"cardNumber,omitempty"` CardSecurity string `json:"cardSecurity,omitempty"` ConsumerAccount string `json:"consumerAccount,omitempty"` ConsumerBIC string `json:"consumerBic,omitempty"` ConsumerName string `json:"consumerName,omitempty"` ConsumerReference string `json:"consumerReference,omitempty"` CreditorIdentifier string `json:"creditorIdentifier,omitempty"` EndToEndIdentifier string `json:"endToEndIdentifier,omitempty"` FileReference string `json:"fileReference,omitempty"` MandateReference string `json:"mandateReference,omitempty"` PaypalReference string `json:"paypalReference,omitempty"` PaypalPayerID string `json:"paypalPayerId,omitempty"` TransferReference string `json:"transferReference,omitempty"` VoucherNumber string `json:"voucherNumber,omitempty"` Wallet string `json:"wallet,omitempty"` PaypalFee Amount `json:"paypalFee,omitempty"` FailureReason FailureReason `json:"failureReason,omitempty"` FeeRegion FeeRegion `json:"feeRegion,omitempty"` RemainderMethod PaymentMethod `json:"remainderMethod,omitempty"` SellerProtection EligibilityReasons `json:"sellerProtection,omitempty"` DueDate *ShortDate `json:"dueDate,omitempty"` GiftCards []*UsedGiftCard `json:"giftCards,omitempty"` QRCode *QRCode `json:"qrCode,omitempty"` RemainderAmount *Amount `json:"remainderAmount,omitempty"` ShippingAddress *PaymentDetailsAddress `json:"shippingAddress,omitempty"` SignatureDate *ShortDate `json:"signatureDate,omitempty"` Links struct { Status *URL `json:"status,omitempty"` PayOnline *URL `json:"payOnline,omitempty"` } `json:"_links,omitempty"` }
PaymentDetails contains details for the specified payment method.
type PaymentDetailsAddress ¶
type PaymentDetailsAddress struct { OrganizationName string `json:"organizationName,omitempty"` Title string `json:"title,omitempty"` GivenName string `json:"givenName,omitempty"` FamilyName string `json:"familyName,omitempty"` Email string `json:"email,omitempty"` Phone PhoneNumber `json:"phone,omitempty"` StreetAndNumber string `json:"streetAndNumber,omitempty"` StreetAdditional string `json:"streetAdditional,omitempty"` PostalCode string `json:"postalCode,omitempty"` City string `json:"city,omitempty"` Region string `json:"region,omitempty"` Country string `json:"country,omitempty"` }
PaymentDetailsAddress identify both the address and the person the payment is shipped to.
type PaymentLineType ¶ added in v4.1.0
type PaymentLineType string
PaymentLineType reflects the type of product bought.
const ( PhysicalProductLine PaymentLineType = "physical" DiscountProductLine PaymentLineType = "discount" DigitalProductLine PaymentLineType = "digital" ShippingFeeLine PaymentLineType = "shipping_fee" StoreCreditLine PaymentLineType = "store_credit" GiftCardLine PaymentLineType = "gift_card" SurchargeLine PaymentLineType = "surcharge" Tip PaymentLineType = "tip" )
Supported payment line types.
type PaymentLines ¶ added in v4.1.0
type PaymentLines struct { Quantity int `json:"quantity,omitempty"` Description string `json:"description,omitempty"` QuantityUnit string `json:"quantityUnit,omitempty"` SKU string `json:"sku,omitempty"` ImageURL string `json:"imageUrl,omitempty"` ProductURL string `json:"productUrl,omitempty"` VATRate string `json:"vatRate,omitempty"` UnitPrice *Amount `json:"unitPrice,omitempty"` DiscountAmount *Amount `json:"discountAmount,omitempty"` TotalAmount *Amount `json:"totalAmount,omitempty"` VATAmount *Amount `json:"vatAmount,omitempty"` Type PaymentLineType `json:"type,omitempty"` }
PaymentLines describes the payment lines to be sent to the Mollie API when creating a new payment.
type PaymentLink ¶
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.
type PaymentLinkLinks ¶
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.
type PaymentLinkOptions ¶
type PaymentLinkOptions struct { Limit int `url:"limit,omitempty"` ProfileID string `url:"profileId,omitempty"` From string `url:"from,omitempty"` }
PaymentLinkOptions represents query string parameters to modify the payment links requests.
type PaymentLinkPaymentsList ¶ added in v4.5.0
type PaymentLinkPaymentsList struct { Count int `json:"count,omitempty"` Links PaymentLinkLinks `json:"_links,omitempty"` Embedded struct { Payments []*Payment `json:"payments,omitempty"` } `json:"_embedded,omitempty"` }
PaymentLinkPaymentsList retrieves a list of payment associated with a specific payment link.
type PaymentLinkPaymentsListOptions ¶ added in v4.5.0
type PaymentLinkPaymentsListOptions struct { Limit int `url:"limit,omitempty"` Sort SortDirection `url:"sort,omitempty"` TestMode bool `url:"testmode,omitempty"` }
PaymentLinkPaymentsListOptions represents query string parameters to modify the payment link payments list requests.
type PaymentLinks ¶
type PaymentLinks struct { Self *URL `json:"self,omitempty"` Checkout *URL `json:"checkout,omitempty"` ChangePaymentState *URL `json:"changePaymentState,omitempty"` Refunds *URL `json:"refunds,omitempty"` ChargeBacks *URL `json:"chargebacks,omitempty"` Captures *URL `json:"captures,omitempty"` Settlement *URL `json:"settlement,omitempty"` Documentation *URL `json:"documentation,omitempty"` Mandate *URL `json:"mandate,omitempty"` Subscription *URL `json:"subscription,omitempty"` Customer *URL `json:"customer,omitempty"` Order *URL `json:"order,omitempty"` Dashboard *URL `json:"dashboard,omitempty"` MobileAppCheckout *URL `json:"mobileAppCheckout,omitempty"` Terminal *URL `json:"terminal,omitempty"` }
PaymentLinks describes all the possible links to be returned with a payment object.
type PaymentLinksList ¶
type PaymentLinksList struct { Count int `json:"count,omitempty"` Links PaymentLinkLinks `json:"_links,omitempty"` Embedded struct { PaymentLinks []*PaymentLink `json:"payment_links,omitempty"` } `json:"_embedded,omitempty"` }
PaymentLinksList retrieves a list of payment links for the active profile or account token owner.
type PaymentLinksService ¶
type PaymentLinksService service
PaymentLinksService operates over the payment link resource.
func (*PaymentLinksService) Create ¶
func (pls *PaymentLinksService) Create(ctx context.Context, p PaymentLink, opts *PaymentLinkOptions) ( res *Response, np *PaymentLink, err error, )
Create generates payment links that by default, unlike regular payments, do not expire.
func (*PaymentLinksService) Delete ¶ added in v4.2.0
Delete removes a payment link from the website profile.
func (*PaymentLinksService) Get ¶
func (pls *PaymentLinksService) Get(ctx context.Context, id string) (res *Response, pl *PaymentLink, err error)
Get retrieves a single payment link object by its id/token.
func (*PaymentLinksService) List ¶
func (pls *PaymentLinksService) List(ctx context.Context, opts *PaymentLinkOptions) ( res *Response, pl *PaymentLinksList, err error, )
List retrieves all payments links created with the current website profile, ordered from newest to oldest.
func (*PaymentLinksService) Payments ¶ added in v4.5.0
func (pls *PaymentLinksService) Payments(ctx context.Context, id string, opts *PaymentLinkPaymentsListOptions) ( res *Response, pl *PaymentLinkPaymentsList, err error, )
Payments retrieves all payments associated with a specific payment link.
See: https://docs.mollie.com/reference/get-payment-link-payments
func (*PaymentLinksService) Update ¶ added in v4.2.0
func (pls *PaymentLinksService) Update(ctx context.Context, id string, p UpdatePaymentLinks) ( res *Response, pl *PaymentLink, err error, )
Update changes certain details of an existing payment link.
type PaymentList ¶
type PaymentList struct { Count int `json:"count,omitempty"` Embedded struct { Payments []*Payment } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
PaymentList describes how a list of payments will be retrieved by Mollie.
type PaymentMethod ¶
type PaymentMethod string
PaymentMethod is a payment method supported by Mollie.
const ( Bancontact PaymentMethod = "bancontact" BankTransfer PaymentMethod = "banktransfer" Belfius PaymentMethod = "belfius" CBC PaymentMethod = "cbc" CreditCard PaymentMethod = "creditcard" DirectDebit PaymentMethod = "directdebit" EPS PaymentMethod = "eps" GiftCard PaymentMethod = "giftcard" GiroPay PaymentMethod = "giropay" IDeal PaymentMethod = "ideal" KBC PaymentMethod = "kbc" KlarnaPayLater PaymentMethod = "klarnapaylater" KlarnaSliceIt PaymentMethod = "klarnasliceit" MyBank PaymentMethod = "mybank" PayPal PaymentMethod = "paypal" PaySafeCard PaymentMethod = "paysafecard" PRZelewy24 PaymentMethod = "przelewy24" Sofort PaymentMethod = "sofort" Voucher PaymentMethod = "voucher" )
Supported payment methods.
type PaymentMethodDetails ¶
type PaymentMethodDetails struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Description string `json:"description,omitempty"` MinimumAmount *Amount `json:"minimumAmount,omitempty"` MaximumAmount *Amount `json:"maximumAmount,omitempty"` Image *Image `json:"image,omitempty"` Pricing []*PaymentMethodPricing `json:"pricing,omitempty"` Issuers []*PaymentMethodIssuer `json:"issuers,omitempty"` Status *PaymentMethodStatus `json:"status,omitempty"` Links MethodsLinks `json:"_links,omitempty"` }
PaymentMethodDetails describes a single method with details.
type PaymentMethodIssuer ¶
type PaymentMethodIssuer struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Image *Image `json:"image,omitempty"` }
PaymentMethodIssuer available for the payment method (for iDEAL, KBC/CBC payment button, gift cards, or meal vouchers).
type PaymentMethodOptions ¶
type PaymentMethodOptions struct { Locale Locale `url:"locale,omitempty"` Currency string `url:"currency,omitempty"` ProfileID string `url:"profileId,omitempty"` Include []IncludeValue `url:"include,omitempty"` }
PaymentMethodOptions are applicable query string parameters to get methods from mollie's API.
type PaymentMethodPricing ¶
type PaymentMethodPricing struct { Description string `json:"description,omitempty"` Variable string `json:"variable,omitempty"` Fixed *Amount `json:"fixed,omitempty"` FeeRegion FeeRegion `json:"feeRegion,omitempty"` }
PaymentMethodPricing contains information about commissions and fees applicable to a payment method.
type PaymentMethodStatus ¶
type PaymentMethodStatus string
PaymentMethodStatus tels the status that the method is in. Possible values: activated pending-boarding pending-review pending-external rejected.
const ( PaymentMethodActivated PaymentMethodStatus = "activated" PaymentMethodPendingBoarding PaymentMethodStatus = "pending-boarding" PaymentMethodPendingReview PaymentMethodStatus = "pending-review" PaymentMethodPendingExternal PaymentMethodStatus = "pending-external" PaymentMethodRejected PaymentMethodStatus = "pending-rejected" )
Available payment method statuses.
type PaymentMethodsList ¶
type PaymentMethodsList struct { Count int `json:"count,omitempty"` Embedded struct { Methods []*PaymentMethodDetails } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
PaymentMethodsList describes a list of paginated payment methods.
type PaymentMethodsService ¶
type PaymentMethodsService service
PaymentMethodsService operates on methods endpoints.
func (*PaymentMethodsService) All ¶
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.
func (*PaymentMethodsService) Get ¶
func (ms *PaymentMethodsService) Get(ctx context.Context, id PaymentMethod, options *PaymentMethodOptions) ( res *Response, pmd *PaymentMethodDetails, err error, )
Get returns information about the payment method specified by id, it also receives a pointer to the method options containing applicable query string parameters.
func (*PaymentMethodsService) List ¶
func (ms *PaymentMethodsService) List(ctx context.Context, options *ListPaymentMethodsOptions) ( res *Response, pm *PaymentMethodsList, err error, )
List retrieves all enabled payment methods.
The results are not paginated.
type PaymentOptions ¶
type PaymentOptions struct { Include []IncludeValue `url:"include,omitempty"` Embed []EmbedValue `url:"embed,omitempty"` }
PaymentOptions describes payments endpoint valid query string parameters.
type PaymentRefundAccessTokenFields ¶
type PaymentRefundAccessTokenFields struct {
Testmode bool `json:"testmode,omitempty"`
}
PaymentRefundAccessTokenFields describes the access token available fields for a refund.
type PaymentRefundMollieConnectFields ¶
type PaymentRefundMollieConnectFields struct { ReverseRouting bool `json:"reverseRouting,omitempty"` RoutingReversals []*RoutingReversal `json:"routingReversals,omitempty"` }
PaymentRefundMollieConnectFields describes the Mollie Connect available fields for a refund.
type PaymentRefundOptions ¶
type PaymentRefundOptions struct {
Embed []EmbedValue `url:"embed,omitempty"`
}
PaymentRefundOptions describes payment refund endpoint valid query string parameters.
type PaymentRouting ¶
type PaymentRouting struct { Destination PaymentDestination `json:"destination,omitempty"` Amount *Amount `json:"amount,omitempty"` ReleaseDate *ShortDate `json:"releaseDate,omitempty"` }
PaymentRouting describes the routing of a payment.
type PaymentsService ¶
type PaymentsService service
PaymentsService instance operates over payment resources.
func (*PaymentsService) Cancel ¶
func (ps *PaymentsService) Cancel(ctx context.Context, id string) (res *Response, p *Payment, err error)
Cancel removes a payment (if possible) from your Mollie account.
func (*PaymentsService) Create ¶
func (ps *PaymentsService) Create(ctx context.Context, p CreatePayment, opts *PaymentOptions) ( res *Response, np *Payment, err error, )
Create stores a new payment object attached to your Mollie account.
func (*PaymentsService) Get ¶
func (ps *PaymentsService) Get(ctx context.Context, id string, opts *PaymentOptions) ( res *Response, p *Payment, err error, )
Get retrieves a single payment object by its payment token.
func (*PaymentsService) List ¶
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.
func (*PaymentsService) Update ¶
func (ps *PaymentsService) Update(ctx context.Context, id string, up UpdatePayment) ( res *Response, p *Payment, err error, )
Update can be used to update some details of a created payment.
type Permission ¶
type Permission struct { Granted bool `json:"granted,omitempty"` Resource string `json:"resource,omitempty"` Description string `json:"description,omitempty"` ID PermissionGrant `json:"id,omitempty"` Links PermissionLinks `json:"_links,omitempty"` }
Permission represents an action that can be performed by any API actor.
type PermissionGrant ¶
type PermissionGrant string
PermissionGrant defines supported permissions.
const ( PaymentsRead PermissionGrant = "payments.read" PaymentsWrite PermissionGrant = "payments.write" RefundsRead PermissionGrant = "refunds.read" RefundsWrite PermissionGrant = "refunds.write" CustomersRead PermissionGrant = "customers.read" CustomersWrite PermissionGrant = "customers.write" MandatesRead PermissionGrant = "mandates.read" MandatesWrite PermissionGrant = "mandates.write" SubscriptionsRead PermissionGrant = "subscriptions.read" SubscriptionsWrite PermissionGrant = "subscriptions.write" ProfilesRead PermissionGrant = "profiles.read" ProfilesWrite PermissionGrant = "profiles.write" InvoicesRead PermissionGrant = "invoices.read" SettlementsRead PermissionGrant = "settlements.read" OrdersRead PermissionGrant = "orders.read" OrdersWrite PermissionGrant = "orders.write" ShipmentsRead PermissionGrant = "shipments.read" ShipmentsWrite PermissionGrant = "shipments.write" OrganizationsRead PermissionGrant = "organizations.read" OrganizationsWrite PermissionGrant = "organizations.write" OnboardingRead PermissionGrant = "onboarding.read" OnboardingWrite PermissionGrant = "onbording.write" PaymentLinksRead PermissionGrant = "payment-links.read" PaymentLinksWrite PermissionGrant = "payment-links.write" BalancesRead PermissionGrant = "balances.read" TerminalsRead PermissionGrant = "terminals.read" TerminalsWrite PermissionGrant = "terminals.write" )
Available permission grants.
type PermissionLinks ¶
type PermissionLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
PermissionLinks contains URL objects that make reference to an http address related to permissions.
type PermissionsList ¶
type PermissionsList struct { Count int `json:"count,omitempty"` Embedded struct { Permissions []*Permission `json:"permissions,omitempty"` } `json:"_embedded,omitempty"` Links PermissionLinks `json:"_links,omitempty"` }
PermissionsList lists all the permissions given to an API actor.
type PermissionsService ¶
type PermissionsService service
PermissionsService operates over permission resources.
func (*PermissionsService) Get ¶
func (ps *PermissionsService) Get(ctx context.Context, id PermissionGrant) (res *Response, p *Permission, err error)
Get returns a permission by its id.
func (*PermissionsService) List ¶
func (ps *PermissionsService) List(ctx context.Context) (res *Response, pl *PermissionsList, err error)
List retrieves all permissions available with the current app access token. The list is not paginated.
type PhoneNumber ¶
type PhoneNumber string
PhoneNumber represents a phone number in the E.164 format.
type PreAuthorizedPaymentFields ¶
type PreAuthorizedPaymentFields struct { CaptureDelay string `json:"captureDelay,omitempty"` CaptureMode CaptureMode `json:"captureMode,omitempty"` CaptureBefore *time.Time `json:"captureBefore,omitempty"` }
PreAuthorizedPaymentFields describes the fields specific to pre-authorized payments.
type ProductKind ¶
type ProductKind string
ProductKind describes the type of product bought, for example, a physical or a digital product.
const ( PhysicalProduct ProductKind = "physical" DiscountProduct ProductKind = "discount" DigitalProduct ProductKind = "digital" ShippingFeeProduct ProductKind = "shipping_fee" StoreCreditProduct ProductKind = "store_credit" GiftCardProductProduct ProductKind = "gift_card" SurchargeProduct ProductKind = "surcharge" )
Valid product type.
type Profile ¶
type Profile struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Website string `json:"website,omitempty"` Description string `json:"description,omitempty"` CountriesOfActivity []string `json:"countriesOfActivity,omitempty"` Email string `json:"email,omitempty"` Phone PhoneNumber `json:"phone,omitempty"` Mode Mode `json:"mode,omitempty"` BusinessCategory BusinessCategory `json:"businessCategory,omitempty"` CategoryCode CategoryCode `json:"categoryCode,omitempty"` Status ProfileStatus `json:"status,omitempty"` Review ProfileReview `json:"review,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Links ProfileLinks `json:"_links,omitempty"` }
Profile will usually reflect the trademark or brand name of the profile’s website or application.
type ProfileLinks ¶
type ProfileLinks struct { Self *URL `json:"self,omitempty"` Dashboard *URL `json:"dashboard,omitempty"` Chargebacks *URL `json:"chargebacks,omitempty"` Methods *URL `json:"methods,omitempty"` Payments *URL `json:"payments,omitempty"` Refunds *URL `json:"refunds,omitempty"` CheckoutPreviewURL *URL `json:"checkoutPreviewUrl,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
ProfileLinks contains URL's to relevant information related to a profile.
type ProfileReview ¶
type ProfileReview struct {
Status ProfileReviewStatus `json:"status,omitempty"`
}
ProfileReview contains the status of the profile review.
type ProfileReviewStatus ¶
type ProfileReviewStatus string
ProfileReviewStatus determines whether the profile is able to receive live payments.
const ( ReviewStatusPending ProfileReviewStatus = "pending" ReviewStatusRejected ProfileReviewStatus = "rejected" )
Possible profile review statuses.
type ProfileStatus ¶
type ProfileStatus string
ProfileStatus determines whether the profile is able to receive live payments.
const ( StatusUnverified ProfileStatus = "unverified" StatusVerified ProfileStatus = "verified" StatusBlocked ProfileStatus = "blocked" )
Possible profile statuses.
type ProfilesList ¶
type ProfilesList struct { Count int `json:"count,omitempty"` Embedded struct { Profiles []*Profile `json:"profiles,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
ProfilesList contains a list of profiles for your account.
type ProfilesService ¶
type ProfilesService service
ProfilesService operates over profile resource.
func (*ProfilesService) Create ¶
func (ps *ProfilesService) Create(ctx context.Context, np CreateOrUpdateProfile) ( res *Response, p *Profile, err error, )
Create stores a new profile in your Mollie account.
func (*ProfilesService) Current ¶
Current returns the profile belonging to the API key. This method only works when using API keys.
func (*ProfilesService) Delete ¶
Delete enables profile deletions, rendering the profile unavailable for further API calls and transactions.
func (*ProfilesService) DisableGiftCardIssuer ¶
func (ps *ProfilesService) DisableGiftCardIssuer(ctx context.Context, profileID string, issuer GiftCardIssuer) ( res *Response, err error, )
DisableGiftCardIssuer deactivates the requested gift card issuer for the provided profile id when using Organization tokens or App Access tokens.
See: https://docs.mollie.com/reference/disable-method-issuer
func (*ProfilesService) DisableGiftCardIssuerForCurrent ¶
func (ps *ProfilesService) DisableGiftCardIssuerForCurrent(ctx context.Context, issuer GiftCardIssuer) ( res *Response, err error, )
DisableGiftCardIssuerForCurrent deactivates the specified issuer for the current profile when using API tokens.
See: https://docs.mollie.com/reference/disable-method-issuer
func (*ProfilesService) DisablePaymentMethod ¶
func (ps *ProfilesService) DisablePaymentMethod(ctx context.Context, id string, pm PaymentMethod) ( res *Response, err error, )
DisablePaymentMethod disables a payment method on a specific or authenticated profile. If you're using API tokens for authentication, pass "me" as id.
func (*ProfilesService) DisableVoucherIssuer ¶
func (ps *ProfilesService) DisableVoucherIssuer(ctx context.Context, profileID string, issuer VoucherIssuer) ( res *Response, err error, )
DisableVoucherIssuer deactivates the requested voucher issuer for the provided profile id when using Organization tokens or App Access tokens.
See: https://docs.mollie.com/reference/disable-method-issuer
func (*ProfilesService) DisableVoucherIssuerForCurrent ¶
func (ps *ProfilesService) DisableVoucherIssuerForCurrent(ctx context.Context, issuer VoucherIssuer) ( res *Response, err error, )
DisableVoucherIssuerForCurrent deactivates the specified issuer for the current profile when using API tokens.
func (*ProfilesService) EnableGiftCardIssuer ¶
func (ps *ProfilesService) EnableGiftCardIssuer(ctx context.Context, profileID string, issuer GiftCardIssuer) ( res *Response, gc *GiftCardEnabled, err error, )
EnableGiftCardIssuer activates the requested gift card issuer for the provided profile id when using Organization tokens or App Access tokens.
func (*ProfilesService) EnableGiftCardIssuerForCurrent ¶
func (ps *ProfilesService) EnableGiftCardIssuerForCurrent(ctx context.Context, issuer GiftCardIssuer) ( res *Response, gc *GiftCardEnabled, err error, )
EnableGiftCardIssuerForCurrent activates the specified issuer for the current profile when using API tokens.
func (*ProfilesService) EnablePaymentMethod ¶
func (ps *ProfilesService) EnablePaymentMethod(ctx context.Context, id string, pm PaymentMethod) ( res *Response, pmi *PaymentMethodDetails, err error, )
EnablePaymentMethod enables a payment method on a specific or authenticated profile. If you're using API tokens for authentication, pass "me" as id.
func (*ProfilesService) EnableVoucherIssuer ¶
func (ps *ProfilesService) EnableVoucherIssuer( ctx context.Context, profileID string, issuer VoucherIssuer, vi *EnableVoucherIssuer, ) ( res *Response, vc *VoucherIssuerEnabled, err error, )
EnableVoucherIssuer activates the requested voucher issuer for the provided profile id when using Organization tokens or App Access tokens.
func (*ProfilesService) EnableVoucherIssuerForCurrent ¶
func (ps *ProfilesService) EnableVoucherIssuerForCurrent(ctx context.Context, issuer VoucherIssuer) ( res *Response, vc *VoucherIssuerEnabled, err error, )
EnableVoucherIssuerForCurrent activates the specified issuer for the current profile when using API tokens.
func (*ProfilesService) Get ¶
func (ps *ProfilesService) Get(ctx context.Context, id string) (res *Response, p *Profile, err error)
Get retrieves the a profile by ID.
func (*ProfilesService) List ¶
func (ps *ProfilesService) List(ctx context.Context, opts *ListProfilesOptions) ( res *Response, pl *ProfilesList, err error, )
List returns all the profiles for the authenticated account.
func (*ProfilesService) Update ¶
func (ps *ProfilesService) Update(ctx context.Context, id string, up CreateOrUpdateProfile) ( res *Response, p *Profile, err error, )
Update allows you to perform mutations on a profile.
type QRCode ¶
type QRCode struct { Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` Src string `json:"src,omitempty"` }
QRCode object represents an image of a QR code.
type Rate ¶
type Rate struct { Variable string `json:"variable,omitempty"` Fixed *Amount `json:"fixed,omitempty"` }
Rate describes service rates, further divided into fixed and percentage costs.
type RecurrentPaymentFields ¶
type RecurrentPaymentFields struct { SequenceType SequenceType `json:"sequenceType,omitempty"` CustomerID string `json:"customerId,omitempty"` MandateID string `json:"mandateId,omitempty"` SubscriptionID string `json:"subscriptionId,omitempty"` }
RecurrentPaymentFields describes the fields specific to recurrent payments.
type Refund ¶
type Refund struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` SettlementID string `json:"settlementId,omitempty"` Description string `json:"description,omitempty"` PaymentID string `json:"paymentId,omitempty"` OrderID string `json:"orderId,omitempty"` Amount *Amount `json:"amount,omitempty"` SettlementAmount *Amount `json:"settlementAmount,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Lines []*OrderLine `json:"lines,omitempty"` Metadata any `json:"metadata,omitempty"` Status RefundStatus `json:"status,omitempty"` Links RefundLinks `json:"_links,omitempty"` PaymentRefundAccessTokenFields PaymentRefundMollieConnectFields }
Refund describe a refund for a certain payment.
type RefundLinks ¶
type RefundLinks struct { Self *URL `json:"self,omitempty"` Payment *URL `json:"payment,omitempty"` Settlement *URL `json:"settlement,omitempty"` Order *URL `json:"order,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
RefundLinks describes all the possible links to be returned with a Refund object.
type RefundStatus ¶
type RefundStatus string
RefundStatus describes the status of the refund.
const ( Queued RefundStatus = "queued" Pending RefundStatus = "pending" Processing RefundStatus = "processing" Refunded RefundStatus = "refunded" Failed RefundStatus = "failed" )
Valid refund status.
type RefundsList ¶
type RefundsList struct { Count int `json:"count,omitempty"` Embedded struct { Refunds []*Refund } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
RefundsList describes how a list of refunds will be retrieved by Mollie.
type RefundsService ¶
type RefundsService service
RefundsService instance operates over refund resources.
func (*RefundsService) CancelPaymentRefund ¶
func (rs *RefundsService) CancelPaymentRefund( ctx context.Context, paymentID, refundID string, ) (res *Response, err error)
CancelPaymentRefund cancels a refund for a specific payment.
func (*RefundsService) CreateOrderRefund ¶
func (rs *RefundsService) CreateOrderRefund( ctx context.Context, orderID string, r CreateOrderRefund, ) ( res *Response, rf *Refund, err error, )
CreateOrderRefund creates a refund for a specific order.
func (*RefundsService) CreatePaymentRefund ¶
func (rs *RefundsService) CreatePaymentRefund( ctx context.Context, paymentID string, re CreatePaymentRefund, options *PaymentRefundOptions, ) ( res *Response, rf *Refund, err error, )
Create a refund payment request.
func (*RefundsService) GetPaymentRefund ¶
func (rs *RefundsService) GetPaymentRefund( ctx context.Context, paymentID, refundID string, opts *PaymentRefundOptions, ) ( res *Response, refund *Refund, err error, )
GetPaymentRefund retrieves a specific refund for a specific payment.
func (*RefundsService) List ¶
func (rs *RefundsService) List(ctx context.Context, opts *ListRefundsOptions) ( res *Response, rl *RefundsList, err error, )
List retrieves all refunds.
func (*RefundsService) ListOrderRefunds ¶
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.
func (*RefundsService) ListPaymentRefunds ¶
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.
type Response ¶
Response is a Mollie API response. This wraps the standard http.Response returned from Mollie and provides convenient access to things like pagination links.
type RoutingReversal ¶
type RoutingReversal struct { Amount *Amount `json:"amount,omitempty"` Source string `json:"source,omitempty"` }
RoutingReversal describes the payload to be sent to the reverse routing endpoint.
type RoutingSource ¶
type RoutingSource struct { Type string `json:"type,omitempty"` OrganizationID string `json:"organizationId,omitempty"` }
RoutingSource describes the source of the routing.
type SequenceType ¶
type SequenceType string
SequenceType indicates which type of payment this is in a recurring sequence.
const ( OneOffSequence SequenceType = "oneoff" FirstSequence SequenceType = "first" RecurringSequence SequenceType = "recurring" )
Valid sequence types.
type Settlement ¶
type Settlement struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` Reference string `json:"reference,omitempty"` InvoiceID string `json:"invoiceId,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` SettledAt *time.Time `json:"settledAt,omitempty"` Amount *Amount `json:"amount,omitempty"` Periods *SettlementObject `json:"periods,omitempty"` Status SettlementStatus `json:"status,omitempty"` Links SettlementLinks `json:"_links,omitempty"` }
Settlement contains successful payments, together with refunds, captures and chargebacks into settlements.
type SettlementCosts ¶
type SettlementCosts struct { Count int `json:"count,omitempty"` Description string `json:"description,omitempty"` InvoiceID string `json:"invoiceId,omitempty"` AmountNet *Amount `json:"amountNet,omitempty"` AmountVAT *Amount `json:"amountVat,omitempty"` AmountGross *Amount `json:"amountGross,omitempty"` Rate *Rate `json:"rate,omitempty"` Method PaymentMethod `json:"method,omitempty"` }
SettlementCosts contains information about costs related to a settlement.
type SettlementLinks ¶
type SettlementLinks struct { Self *URL `json:"self,omitempty"` Payments *URL `json:"payments,omitempty"` Refunds *URL `json:"refunds,omitempty"` Chargebacks *URL `json:"chargebacks,omitempty"` Captures *URL `json:"captures,omitempty"` Invoice *URL `json:"invoice,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
SettlementLinks is an object with several URL objects relevant to the settlement.
type SettlementObject ¶
type SettlementObject map[string]map[string]SettlementPeriod
SettlementObject nests as describes for settlement periods.
type SettlementPeriod ¶
type SettlementPeriod struct { InvoiceID string `json:"invoiceId,omitempty"` InvoiceReference string `json:"invoiceReference,omitempty"` Revenue []*SettlementRevenue `json:"revenue,omitempty"` Costs []*SettlementCosts `json:"costs,omitempty"` }
SettlementPeriod describe the settlement by month in full detail.
type SettlementRevenue ¶
type SettlementRevenue struct { Count int `json:"count,omitempty"` Description string `json:"description,omitempty"` AmountNet *Amount `json:"amountNet,omitempty"` AmountVAT *Amount `json:"amountVat,omitempty"` AmountGross *Amount `json:"amountGross,omitempty"` Method PaymentMethod `json:"method,omitempty"` }
SettlementRevenue objects contain the total revenue for each payment method during this period.
type SettlementStatus ¶
type SettlementStatus string
SettlementStatus describes the status of the settlement.
const ( SettlementStatusOpen SettlementStatus = "open" SettlementStatusPending SettlementStatus = "pending" SettlementStatusPaidOut SettlementStatus = "paidout" SettlementStatusFailed SettlementStatus = "failed" )
Available settlement statuses.
type SettlementsList ¶
type SettlementsList struct { Count int `json:"count,omitempty"` Embedded struct { Settlements []*Settlement } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
SettlementsList describes a list of settlements.
type SettlementsService ¶
type SettlementsService service
SettlementsService operates over settlements resource.
func (*SettlementsService) Get ¶
func (ss *SettlementsService) Get(ctx context.Context, settlement string) (res *Response, s *Settlement, err error)
Get returns a settlement by its id or the bank reference id
func (*SettlementsService) GetCaptures ¶
func (ss *SettlementsService) GetCaptures(ctx context.Context, settlement string, slo *ListSettlementsOptions) ( res *Response, cl *CapturesList, err error, )
GetCaptures retrieves all captures included in a settlement.
See: https://docs.mollie.com/reference/get-settlement-captures
func (*SettlementsService) GetChargebacks ¶
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.
See: https://docs.mollie.com/reference/get-settlement-chargebacks
func (*SettlementsService) GetRefunds ¶
func (ss *SettlementsService) GetRefunds(ctx context.Context, settlement string, slo *ListSettlementsOptions) ( res *Response, rl *RefundsList, err error, )
GetRefunds retrieves all refunds included in a settlement.
See: https://docs.mollie.com/reference/get-settlement-refunds
func (*SettlementsService) List ¶
func (ss *SettlementsService) List(ctx context.Context, slo *ListSettlementsOptions) ( res *Response, sl *SettlementsList, err error, )
List retrieves all settlements, ordered from new to old
func (*SettlementsService) ListPayments ¶
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.
See: https://docs.mollie.com/reference/get-settlement-payments
func (*SettlementsService) Next ¶
func (ss *SettlementsService) Next(ctx context.Context) (res *Response, s *Settlement, err error)
Next retrieves the details of the current settlement that has not yet been paid out.
func (*SettlementsService) Open ¶
func (ss *SettlementsService) Open(ctx context.Context) (res *Response, s *Settlement, err error)
Open retrieves the details of the open balance of the organization. This will return a settlement object representing your organization’s balance.
type Shipment ¶
type Shipment struct { Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` OrderID string `json:"orderId,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` Tracking *ShipmentTracking `json:"tracking,omitempty"` Lines []*OrderLine `json:"lines,omitempty"` Links ShipmentLinks `json:"_links,omitempty"` ShipmentAccessTokenFields }
Shipment contains information about a user service/product delivery and is used in the figurative sense here. It can also mean that a service was provided or digital content was delivered.
type ShipmentAccessTokenFields ¶
type ShipmentAccessTokenFields struct {
Testmode bool `json:"testmode,omitempty"`
}
ShipmentAccessTokenFields describes the fields available when using an access token.
type ShipmentLinks ¶
type ShipmentLinks struct { Self *URL `json:"self,omitempty"` Order *URL `json:"order,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
ShipmentLinks contains URL objects with shipment relevant information for the user.
type ShipmentTracking ¶
type ShipmentTracking struct { Carrier string `json:"carrier,omitempty"` Code string `json:"code,omitempty"` URL string `json:"url,omitempty"` }
ShipmentTracking contains shipment tracking details.
type ShipmentsList ¶
type ShipmentsList struct { Count int `json:"count,omitempty"` Embedded struct { Shipments []Shipment } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
ShipmentsList describes how a list of payments will be retrieved by Mollie.
type ShipmentsService ¶
type ShipmentsService service
ShipmentsService operates on shipments endpoints.
func (*ShipmentsService) Create ¶
func (ss *ShipmentsService) Create(ctx context.Context, order string, cs CreateShipment) ( res *Response, s *Shipment, err error, )
Create can be used to ship order lines.
func (*ShipmentsService) Get ¶
func (ss *ShipmentsService) Get(ctx context.Context, order string, shipment string) ( res *Response, s *Shipment, err error, )
Get retrieves a single shipment and the order lines shipped by a shipment’s ID.
func (*ShipmentsService) List ¶
func (ss *ShipmentsService) List(ctx context.Context, order string) (res *Response, sl *ShipmentsList, err error)
List retrieves all shipments for an order.
type ShortDate ¶
ShortDate is a string representing a date in YYYY-MM-DD format.
func (*ShortDate) MarshalJSON ¶
MarshalJSON overrides the default marshal action for the Date struct. Returns date as YYYY-MM-DD formatted string.
func (*ShortDate) UnmarshalJSON ¶
UnmarshalJSON overrides the default unmarshal action for the Date struct, as we need links to be pointers to the time.Time struct.
type SortDirection ¶ added in v4.5.0
type SortDirection string
SortDirection describes the direction of sorting when querying a list of resources.
const ( Ascending SortDirection = "asc" Descending SortDirection = "desc" )
Supported sort directions.
type Subscription ¶
type Subscription struct { Times int `json:"times,omitempty"` TimesRemaining int `json:"timesRemaining,omitempty"` Resource string `json:"resource,omitempty"` ID string `json:"id,omitempty"` Interval string `json:"interval,omitempty"` Description string `json:"description,omitempty"` MandateID string `json:"mandateId,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` Amount *Amount `json:"amount,omitempty"` ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"` StartDate *ShortDate `json:"startDate,omitempty"` NextPaymentDate *ShortDate `json:"nextPaymentDate,omitempty"` CreatedAT *time.Time `json:"createdAt,omitempty"` CanceledAt *time.Time `json:"canceledAt,omitempty"` Mode Mode `json:"mode,omitempty"` Status SubscriptionStatus `json:"status,omitempty"` Method PaymentMethod `json:"method,omitempty"` Metadata any `json:"metadata,omitempty"` Links SubscriptionLinks `json:"_links,omitempty"` }
Subscription contains information about a customer subscription.
type SubscriptionAccessTokenFields ¶
type SubscriptionAccessTokenFields struct { Testmode bool `json:"testmode,omitempty"` ProfileID string `json:"profileId,omitempty"` ApplicationFee *ApplicationFee `json:"applicationFee,omitempty"` }
SubscriptionAccessTokenFields contains the fields that are available when using an access token.
type SubscriptionLinks ¶
type SubscriptionLinks struct { Self *URL `json:"self,omitempty"` Customer *URL `json:"customer,omitempty"` Profile *URL `json:"profile,omitempty"` Payments *URL `json:"payments,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
SubscriptionLinks contains several URL objects relevant to the subscription.
type SubscriptionStatus ¶
type SubscriptionStatus string
SubscriptionStatus contains references to valid subscription statuses.
const ( SubscriptionStatusPending SubscriptionStatus = "pending" SubscriptionStatusActive SubscriptionStatus = "active" SubscriptionStatusCanceled SubscriptionStatus = "canceled" SubscriptionStatusSuspended SubscriptionStatus = "suspended" SubscriptionStatusCompleted SubscriptionStatus = "completed" )
Available subscription statuses.
type SubscriptionsList ¶
type SubscriptionsList struct { Count int `json:"count,omitempty"` Embedded struct { Subscriptions []*Subscription } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
SubscriptionsList describes the response for subscription list endpoints.
type SubscriptionsService ¶
type SubscriptionsService service
SubscriptionsService operates over subscriptions resource.
func (*SubscriptionsService) All ¶
func (ss *SubscriptionsService) All(ctx context.Context, opts *ListSubscriptionsOptions) ( res *Response, sl *SubscriptionsList, err error, )
All retrieves all subscriptions, ordered from newest to oldest. By using an API key all the subscriptions created with the current website profile will be returned. In the case of an OAuth Access Token relies the website profile on the profileId field
See: https://docs.mollie.com/reference/list-all-subscriptions
func (*SubscriptionsService) Cancel ¶
func (ss *SubscriptionsService) Cancel(ctx context.Context, customer, subscription string) ( res *Response, s *Subscription, err error, )
Cancel cancels a subscription.
func (*SubscriptionsService) Create ¶
func (ss *SubscriptionsService) Create(ctx context.Context, customer string, sc CreateSubscription) ( res *Response, s *Subscription, err error, )
Create stores a new subscription for a given customer
func (*SubscriptionsService) Get ¶
func (ss *SubscriptionsService) Get(ctx context.Context, customer, subscription string) ( res *Response, s *Subscription, err error, )
Get retrieves a customer's subscription
func (*SubscriptionsService) List ¶
func (ss *SubscriptionsService) List(ctx context.Context, customer string, opts *ListSubscriptionsOptions) ( res *Response, sl *SubscriptionsList, err error, )
List retrieves all subscriptions of a customer
func (*SubscriptionsService) ListPayments ¶
func (ss *SubscriptionsService) ListPayments( ctx context.Context, customer, subscription string, opts *ListSubscriptionsOptions, ) ( res *Response, sl *PaymentList, err error, )
ListPayments retrieves all payments of a specific subscriptions of a customer
See: https://docs.mollie.com/reference/list-subscription-payments
func (*SubscriptionsService) Update ¶
func (ss *SubscriptionsService) Update(ctx context.Context, customer, subscription string, sc UpdateSubscription) ( res *Response, s *Subscription, err error, )
Update changes fields on a subscription object
type Subtotal ¶
type Subtotal struct { TransactionType string `json:"transactionType,omitempty"` Count int `json:"count,omitempty"` Amount *Amount `json:"amount,omitempty"` Subtotals []*Subtotal `json:"subtotals,omitempty"` }
Subtotal balance descriptor.
type Terminal ¶
type Terminal struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` ProfileID string `json:"profileID,omitempty"` Brand string `json:"brand,omitempty"` Model string `json:"model,omitempty"` SerialNumber string `json:"serialNumber,omitempty"` Currency string `json:"currency,omitempty"` Description string `json:"description,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` Status TerminalStatus `json:"status,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
Terminal symbolizes a physical device to receive payments.
type TerminalList ¶
type TerminalList struct { Count int `json:"count,omitempty"` Embedded struct { Terminals []*Terminal `json:"terminals,omitempty"` } `json:"_embedded,omitempty"` Links PaginationLinks `json:"_links,omitempty"` }
TerminalList describes the response for terminals list endpoints.
type TerminalStatus ¶
type TerminalStatus string
TerminalStatus is the status of the terminal, which is a read-only value determined by Mollie.
const ( TerminalPending TerminalStatus = "pending" TerminalActive TerminalStatus = "active" TerminalInactive TerminalStatus = "inactive" )
Possible terminal statuses.
type TerminalsService ¶
type TerminalsService service
TerminalsService operates over terminals resource.
func (*TerminalsService) Get ¶
func (ts *TerminalsService) Get(ctx context.Context, id string) (res *Response, t *Terminal, err error)
Get terminal retrieves a single terminal object by its terminal ID.
func (*TerminalsService) List ¶
func (ts *TerminalsService) List(ctx context.Context, options *ListTerminalsOptions) ( res *Response, tl *TerminalList, err error, )
List retrieves a list of terminals symbolizing the physical devices to receive payments.
type TransactionType ¶
type TransactionType string
TransactionType specifies the reason for the movement.
const ( PaymentTransaction TransactionType = "payment" CaptureTransaction TransactionType = "capture" FailedPaymentTransaction TransactionType = "failed-payment" RefundTransaction TransactionType = "refund-transaction" ReturnedRefundTransaction TransactionType = "returned-refund" ChargebackTransaction TransactionType = "chargeback" ChargebackReversalTransaction TransactionType = "chargeback-reversal" OutgoingTransferTransaction TransactionType = "outgoing-transfer" CanceledOutgoingTransfer TransactionType = "canceled-outgoing-transfer" ReturnedTransferTransaction TransactionType = "returned-transfer" InvoiceCompensationTransferTransaction TransactionType = "invoice-compensation" BalanceCorrectionTransaction TransactionType = "balance-correction" ApplicationFeeTransaction TransactionType = "application-fee" SplitPaymentTransaction TransactionType = "split-payment" PlatformPaymentRefundTransaction TransactionType = "platform-payment-refund" PlatformPaymentChargeback TransactionType = "platform-payment-chargeback" )
Known and supported transaction types.
type TransferDestination ¶
type TransferDestination struct { Type string `json:"type,omitempty"` BankAccount string `json:"bankAccount,omitempty"` BeneficiaryName string `json:"beneficiaryName,omitempty"` }
TransferDestination where the available amount will be automatically transferred.
type TransferFrequency ¶
type TransferFrequency string
TransferFrequency reflects the frequency at which the available amount on the balance will be settled to the configured transfer destination.
const ( TransferDaily TransferFrequency = "daily" TransferTwiceAWeek TransferFrequency = "twice-a-week" TransferEveryMonday TransferFrequency = "every-monday" TransferEveryTuesday TransferFrequency = "every-tuesday" TransferEveryWednesday TransferFrequency = "every-wednesday" TransferEveryThursday TransferFrequency = "every-thursday" TransferEveryFriday TransferFrequency = "every-friday" TransferTwiceAMonth TransferFrequency = "twice-a-month" TransferMonthly TransferFrequency = "monthly" TransferNever TransferFrequency = "never" )
Possible values for type TransferFrequency.
type UpdateCustomer ¶
type UpdateCustomer struct { Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Locale Locale `json:"locale,omitempty"` Metadata any `json:"metadata,omitempty"` }
UpdateCustomer contains the parameters to update a customer.
type UpdateOrder ¶
type UpdateOrder struct { OrderNumber string `json:"orderNumber,omitempty"` RedirectURL string `json:"redirectUrl,omitempty"` CancelURL string `json:"cancelUrl,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` BillingAddress *OrderAddress `json:"billingAddress,omitempty"` ShippingAddress *OrderAddress `json:"shippingAddress,omitempty"` OrderAccessTokenFields }
UpdateOrder contains the parameters to update an order.
type UpdateOrderLine ¶
type UpdateOrderLine struct { Quantity int `json:"quantity,omitempty"` Name string `json:"name,omitempty"` ImageURL string `json:"imageUrl,omitempty"` ProductURL string `json:"productUrl,omitempty"` SKU string `json:"sku,omitempty"` VATRate string `json:"vatRate,omitempty"` UnitPrice *Amount `json:"unitPrice,omitempty"` DiscountAmount *Amount `json:"discountAmount,omitempty"` TotalAmount *Amount `json:"totalAmount,omitempty"` VATAmount *Amount `json:"vatAmount,omitempty"` Metadata any `json:"metadata,omitempty"` OrderAccessTokenFields }
UpdateOrderLine contains the parameters to update an order line.
type UpdatePayment ¶
type UpdatePayment struct { Description string `json:"description,omitempty"` RedirectURL string `json:"redirectUrl,omitempty"` CancelURL string `json:"cancelUrl,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` Metadata any `json:"metadata,omitempty"` Method PaymentMethod `json:"method,omitempty"` Locale Locale `json:"locale,omitempty"` RestrictPaymentMethodsToCountry string `json:"restrictPaymentMethodsToCountry,omitempty"` // PaymentMethods specific fields BillingEmail string `json:"billingEmail,omitempty"` DueDate *ShortDate `json:"dueDate,omitempty"` Issuer string `json:"issuer,omitempty"` }
UpdatePayment describes the payload to be sent to the Mollie API when updating a payment.
See: https://docs.mollie.com/reference/update-payment See: https://docs.mollie.com/reference/update-payment#payment-method-specific-parameters
type UpdatePaymentLinks ¶ added in v4.2.0
type UpdatePaymentLinks struct { Description string `json:"description,omitempty"` Archived bool `json:"archived,omitempty"` }
UpdatePaymentLinks describes certain details of an existing payment link that can be updated.
type UpdateShipment ¶
type UpdateShipment struct { Tracking *ShipmentTracking `json:"tracking,omitempty"` ShipmentAccessTokenFields }
UpdateShipment contains information required to update a shipment.
type UpdateSubscription ¶
type UpdateSubscription struct { Times int `json:"times,omitempty"` Interval string `json:"interval,omitempty"` Description string `json:"description,omitempty"` MandateID string `json:"mandateId,omitempty"` WebhookURL string `json:"webhookUrl,omitempty"` Amount *Amount `json:"amount,omitempty"` StartDate *ShortDate `json:"startDate,omitempty"` Method PaymentMethod `json:"method,omitempty"` Metadata any `json:"metadata,omitempty"` SubscriptionAccessTokenFields }
UpdateSubscription contains the fields that are required to create a subscription.
type UsedGiftCard ¶
type UsedGiftCard struct { Issuer string `json:"issuer,omitempty"` Amount *Amount `json:"amount,omitempty"` VoucherNumber string `json:"voucherNumber,omitempty"` }
UsedGiftCard describes a used gift card.
type UserAgentToken ¶
UserAgentToken are time limited valid access tokens.
type VoucherContractor ¶
type VoucherContractor struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` ContractorID string `json:"contractorId,omitempty"` }
VoucherContractor represents a contractor for a voucher.
type VoucherIssuer ¶
type VoucherIssuer string
VoucherIssuer represents the issuer of a voucher.
const ( EdenredBelgiumCadeauVoucher VoucherIssuer = "edenred-belgium-cadeau" EdenredBelgiumEcoVoucher VoucherIssuer = "edenred-belgium-eco" EdenredBelgiumMealVoucher VoucherIssuer = "edenred-belgium-meal" EdenredBelgiumSportsVoucher VoucherIssuer = "edenred-belgium-sports" EdenredBelgiumAdditionalVoucher VoucherIssuer = "edenred-belgium-additional" EdenredBelgiumConsumeVoucher VoucherIssuer = "edenred-belgium-consume" MonizzeCadeauVoucher VoucherIssuer = "monizze-cadeau" MonizzeEcoVoucher VoucherIssuer = "monizze-eco" MonizzeMealVoucher VoucherIssuer = "monizze-meal" PluxeeCadeauVoucher VoucherIssuer = "sodexo-cadeau" PluxeeEcoVoucher VoucherIssuer = "sodexo-ecopass" PluxeeLunchVoucher VoucherIssuer = "sodexo-lunchpass" )
List of known voucher issuers.
type VoucherIssuerEnabled ¶
type VoucherIssuerEnabled struct { ID string `json:"id,omitempty"` Description string `json:"description,omitempty"` Status IssuerStatus `json:"status,omitempty"` Contractor VoucherContractor `json:"contractor,omitempty"` Links VoucherLinks `json:"_links,omitempty"` }
VoucherIssuerEnabled describes the response of a voucher enable operation.
type VoucherLinks ¶
type VoucherLinks struct { Self *URL `json:"self,omitempty"` Documentation *URL `json:"documentation,omitempty"` }
VoucherLinks are links embedded when a voucher is enabled.
type Wallet ¶
type Wallet string
Wallet describes the wallet types that Mollie supports.
const (
ApplePayWallet Wallet = "applepay"
)
Available wallet types.
type WalletsService ¶
type WalletsService service
WalletsService operates over the resources described in Mollie's wallets API endpoints section.
func (*WalletsService) ApplePaymentSession ¶
func (ms *WalletsService) ApplePaymentSession(ctx context.Context, asr *ApplePaymentSessionRequest) ( res *Response, aps *ApplePaymentSession, err error, )
ApplePaymentSession returns an Apple Payment Session object valid for one transaction.
See: https://docs.mollie.com/reference/request-apple-pay-payment-session
Source Files
¶
- app_fee.go
- balances.go
- captures.go
- chargebacks.go
- client_links.go
- clients.go
- common_types.go
- config.go
- custom_types.go
- customers.go
- doc.go
- errors.go
- gift_cards.go
- invoices.go
- mandates.go
- mollie.go
- onboarding.go
- orders.go
- organizations.go
- payment_details.go
- payment_links.go
- payment_methods.go
- payments.go
- permissions.go
- profiles.go
- refunds.go
- settlements.go
- shipments.go
- subscriptions.go
- terminals.go
- vouchers.go
- wallets.go