mollie

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mollie is a wrapper around Mollie's REST API.

See: https://www.mollie.com/en/developers

The Mollie API implements a Representational state transfer (REST) architecture.

Sounds technical, but it’s really quite easy. It mainly breaks down to HTTP-methods GET, PATCH, POST and DELETE matching the operations to read, update, create and delete.

REST also implies a nice and clean structure for URLs or endpoints. This means you can reach any part of the Mollie API on https://api.mollie.com/v2/ adding the name of the resource you want to interact with.

Index

Examples

Constants

View Source
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

func CheckResponse(r *Response) error

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 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 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/v2/balances-api/overview

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.

See: https://docs.mollie.com/reference/v2/balances-api/get-balance

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.

See: https://docs.mollie.com/reference/v2/balances-api/get-primary-balance-report

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.

See: https://docs.mollie.com/reference/v2/balances-api/list-primary-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.

See: https://docs.mollie.com/reference/v2/balances-api/get-balance-report

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/v2/balances-api/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.

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

func (*BalancesService) Primary

func (bs *BalancesService) Primary(ctx context.Context) (res *Response, b *Balance, err error)

Primary retrieves the primary balance. This is the balance of your account’s primary currency, where all payments are settled to by default.

See: https://docs.mollie.com/reference/v2/balances-api/get-primary-balance

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.

func (*BaseError) Error

func (be *BaseError) Error() string

Error interface compliance.

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 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/v2/captures-api/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.

See: https://docs.mollie.com/reference/v2/captures-api/create-capture

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.

See: https://docs.mollie.com/reference/v2/captures-api/get-capture

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.

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

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 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.

See: https://docs.mollie.com/reference/v2/chargebacks-api/get-chargeback

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.

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

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.

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

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

func NewClient(baseClient *http.Client, conf *Config) (mollie *Client, err error)

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

func (c *Client) Do(req *http.Request) (*Response, error)

Do sends an API request and returns the API response or returned as an error if an API error has occurred.

func (*Client) HasAccessToken

func (c *Client) HasAccessToken() bool

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

func (c *Client) WithAuthenticationValue(k string) error

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 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 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.

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

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.

See: https://docs.mollie.com/reference/v2/partners-api/get-client

func (*ClientsService) List

func (ps *ClientsService) List(ctx context.Context, opts *ListLinkedClientsOptions) (
	res *Response,
	pc *LinkedClientList,
	err error,
)

List retrieves all clients.

See: https://docs.mollie.com/reference/v2/partners-api/list-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

func NewAPIConfig(reqIdem bool) *Config

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

func NewAPITestingConfig(reqIdem bool) *Config

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

func NewConfig(t bool, auth string) *Config

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

func NewOrgConfig(reqIdem bool) *Config

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

func NewOrgTestingConfig(reqIdem bool) *Config

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

func (c *Config) SwitchAuthStrategy(auth string) string

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

func (c *Config) ToggleIdempotency() bool

ToggleIdempotency enables/disables the request idempotency feature in the current Config.

func (*Config) ToggleTesting

func (c *Config) ToggleTesting() bool

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 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/v2/payments-api/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"`

	// 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/v2/payments-api/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/v2/payments-api/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/v2/payments-api/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/v2/payments-api/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 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.

See: https://docs.mollie.com/reference/v2/customers-api/create-customer

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/v2/customers-api/create-customer-payment

func (*CustomersService) Delete

func (cs *CustomersService) Delete(ctx context.Context, id string) (res *Response, err error)

Delete a customer.

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

See: https://docs.mollie.com/reference/v2/customers-api/delete-customer

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.

See: https://docs.mollie.com/reference/v2/customers-api/get-customer

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/v2/customers-api/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.

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

func (*CustomersService) Update

func (cs *CustomersService) Update(ctx context.Context, id string, c UpdateCustomer) (
	res *Response,
	cc *Customer,
	err error,
)

Update an existing customer.

See: https://docs.mollie.com/reference/v2/customers-api/update-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 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"
	ReasonAuthenticationUnavailableACS FailureReason = "authentication_unavailable_acs"
	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 FeeRegion

type FeeRegion string

FeeRegion contains the fee region for the payment.

const (
	AmericanExpress FeeRegion = "american-express"
	CarteBancaire   FeeRegion = "carte-bancaire"
	IntraEU         FeeRegion = "intra-eu"
	MaestroRegion   FeeRegion = "maestro"
	Other           FeeRegion = "other"
)

Valid Fee regions.

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 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 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 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 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.

See: https://docs.mollie.com/reference/v2/mandates-api/create-mandate

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.

See: https://docs.mollie.com/reference/v2/mandates-api/get-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.

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

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.

See: https://docs.mollie.com/reference/v2/mandates-api/revoke-mandate

type MethodsLinks struct {
	Self          *URL `json:"self,omitempty"`
	Documentation *URL `json:"documentation,omitempty"`
}

MethodsLinks describes links attached to methods service responses.

type Mode

type Mode string

Mode contains information about the creation environment.

const (
	LiveMode Mode = "live"
	TestMode Mode = "test"
)

Valid modes.

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 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/v2/onboarding-api/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/v2/onboarding-api/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 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 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"
	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.

See https://docs.mollie.com/reference/v2/orders-api/cancel-order

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.

See https://docs.mollie.com/reference/v2/orders-api/cancel-order-lines

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.

See https://docs.mollie.com/reference/v2/orders-api/create-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.

See https://docs.mollie.com/reference/v2/orders-api/create-order-payment

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.

See https://docs.mollie.com/reference/v2/orders-api/create-order-refund

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.

See https://docs.mollie.com/reference/v2/orders-api/get-order

func (*OrdersService) List

func (ors *OrdersService) List(ctx context.Context, opts *ListOrdersOptions) (
	res *Response,
	ordList *OrdersList,
	err error,
)

List is to retrieve all orders.

See https://docs.mollie.com/reference/v2/orders-api/list-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.

See https://docs.mollie.com/reference/v2/orders-api/list-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.

See: https://docs.mollie.com/reference/v2/orders-api/manage-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.

See https://docs.mollie.com/reference/v2/orders-api/update-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.

See https://docs.mollie.com/reference/v2/orders-api/update-orderline

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 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 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"`
	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.

See: https://docs.mollie.com/reference/v2/organizations-api/get-partner

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 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:"amountChargeback,omitempty"`
	SettlementAmount                *Amount       `json:"settlementAmount,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 PaymentLink struct {
	ID          string           `json:"id,omitempty"`
	Resource    string           `json:"resource,omitempty"`
	Description string           `json:"description,omitempty"`
	ProfileID   string           `json:"profileId,omitempty"`
	RedirectURL string           `json:"redirectUrl,omitempty"`
	WebhookURL  string           `json:"webhookUrl,omitempty"`
	Mode        Mode             `json:"mode,omitempty"`
	Amount      Amount           `json:"amount,omitempty"`
	CreatedAt   *time.Time       `json:"createdAt,omitempty"`
	PaidAt      *time.Time       `json:"paidAt,omitempty"`
	UpdatedAt   *time.Time       `json:"updatedAt,omitempty"`
	ExpiresAt   *time.Time       `json:"expiresAt,omitempty"`
	Links       PaymentLinkLinks `json:"_links,omitempty"`
}

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

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

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

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

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

type PaymentLinkOptions

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 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 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.

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

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.

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

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.

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

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

All retrieves all the payment methods enabled for your account/organization.

See: https://docs.mollie.com/reference/v2/methods-api/list-all-methods

func (*PaymentMethodsService) Get

Get returns information about the payment method specified by id, it also receives a pointer to the method options containing applicable query string parameters.

See: https://docs.mollie.com/reference/v2/methods-api/get-method

func (*PaymentMethodsService) List

List retrieves all enabled payment methods.

The results are not paginated.

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

type PaymentOptions

type PaymentOptions struct {
	Include []IncludeValue `url:"include,omitempty"`
	Embed   []EmbedValue   `url:"embed,omitempty"`
}

PaymentOptions describes payments endpoint valid query string parameters.

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

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.

See: https://docs.mollie.com/reference/v2/payments-api/cancel-payment

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.

See: https://docs.mollie.com/reference/v2/payments-api/create-payment#

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.

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

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.

See: https://docs.mollie.com/reference/v2/payments-api/update-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 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.

See: https://docs.mollie.com/reference/v2/permissions-api/get-permission

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.

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

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 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

func (ps *ProfilesService) Current(ctx context.Context) (res *Response, p *Profile, err error)

Current returns the profile belonging to the API key. This method only works when using API keys.

func (*ProfilesService) Delete

func (ps *ProfilesService) Delete(ctx context.Context, id string) (res *Response, err error)

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/v2/profiles-api/disable-gift-card-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/v2/profiles-api/disable-gift-card-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/v2/profiles-api/disable-voucher-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.

See: https://docs.mollie.com/reference/v2/profiles-api/enable-gift-card-issuer

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.

See: https://docs.mollie.com/reference/v2/profiles-api/enable-gift-card-issuer

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.

See: https://docs.mollie.com/reference/v2/profiles-api/enable-voucher-issuer

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 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.

See https://docs.mollie.com/reference/v2/refunds-api/cancel-payment-refund

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.

See https://docs.mollie.com/reference/v2/refunds-api/create-order-refund

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.

See https://docs.mollie.com/reference/v2/refunds-api/create-payment-refund

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.

See: https://docs.mollie.com/reference/v2/refunds-api/get-payment-refund

func (*RefundsService) List

func (rs *RefundsService) List(ctx context.Context, opts *ListRefundsOptions) (
	res *Response,
	rl *RefundsList,
	err error,
)

List retrieves all refunds.

See https://docs.mollie.com/reference/v2/refunds-api/list-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.

See https://docs.mollie.com/reference/v2/refunds-api/list-order-refunds

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.

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

type Response

type Response struct {
	*http.Response
	// contains filtered or unexported fields
}

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 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

See: https://docs.mollie.com/reference/v2/settlements-api/get-settlement

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/v2/settlements-api/list-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/v2/settlements-api/list-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/v2/settlements-api/list-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

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

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/v2/settlements-api/list-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.

See: https://docs.mollie.com/reference/v2/settlements-api/get-next-settlement

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.

See: https://docs.mollie.com/reference/v2/settlements-api/get-open-settlement

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 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.

See: https://docs.mollie.com/reference/v2/shipments-api/create-shipment

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.

See: https://docs.mollie.com/reference/v2/shipments-api/get-shipment#

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.

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

func (*ShipmentsService) Update

func (ss *ShipmentsService) Update(ctx context.Context, order string, shipment string, us UpdateShipment) (
	res *Response,
	s *Shipment,
	err error,
)

Update can be used to update the tracking information of a shipment

See: https://docs.mollie.com/reference/v2/shipments-api/update-shipment

type ShortDate

type ShortDate struct {
	time.Time
}

ShortDate is a string representing a date in YYYY-MM-DD format.

func (*ShortDate) MarshalJSON

func (d *ShortDate) MarshalJSON() ([]byte, error)

MarshalJSON overrides the default marshal action for the Date struct. Returns date as YYYY-MM-DD formatted string.

func (*ShortDate) UnmarshalJSON

func (d *ShortDate) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the default unmarshal action for the Date struct, as we need links to be pointers to the time.Time struct.

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 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

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/v2/subscriptions-api/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.

See: https://docs.mollie.com/reference/v2/subscriptions-api/cancel-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

See: https://docs.mollie.com/reference/v2/subscriptions-api/create-subscription

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

See: https://docs.mollie.com/reference/v2/subscriptions-api/get-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

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

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/v2/subscriptions-api/list-subscriptions-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

See: https://docs.mollie.com/reference/v2/subscriptions-api/update-subscription

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"
	UnauthorizedDirectDebitTransaction     TransactionType = "unauthorized-direct-debit"
	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 URL

type URL struct {
	Href string `json:"href,omitempty"`
	Type string `json:"type,omitempty"`
}

URL in Mollie are commonly represented as objects with an href and type field.

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/v2/payments-api/update-payment See: https://docs.mollie.com/reference/v2/payments-api/update-payment#payment-method-specific-parameters

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

type UserAgentToken struct {
	Token    string
	StartsAt *time.Time
	EndsAt   *time.Time
}

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 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/v2/wallets-api/request-apple-pay-payment-session

Jump to

Keyboard shortcuts

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