Skip to content

Files

Latest commit

fcdbc10 · Mar 27, 2025

History

History
6652 lines (5223 loc) · 225 KB

DOCUMENTATION.md

File metadata and controls

6652 lines (5223 loc) · 225 KB

sumup

import "github.com/sumup/sumup-go"

Index

Variables

OAuth2Endpoint is SumUp's OAuth 2.0 endpoint.

var OAuth2Endpoint = oauth2.Endpoint{
    AuthURL:  "https://api.sumup.com/authorize",
    TokenURL: "https://api.sumup.com/token",
}

type Client

type Client struct {
    ApiKeys      *api_keys.ApiKeysService
    Checkouts    *checkouts.CheckoutsService
    Customers    *customers.CustomersService
    Members      *members.MembersService
    Memberships  *memberships.MembershipsService
    Merchant     *merchant.MerchantService
    Payouts      *payouts.PayoutsService
    Readers      *readers.ReadersService
    Receipts     *receipts.ReceiptsService
    Roles        *roles.RolesService
    Subaccounts  *subaccounts.SubaccountsService
    Transactions *transactions.TransactionsService
    // contains filtered or unexported fields
}
Example

client := sumup.NewClient()

account, err := client.Merchant.Get(context.Background(), merchant.GetAccountParams{})
if err != nil {
	log.Printf("[ERROR] get merchant account: %v", err)
	return
}

log.Printf("[INFO] merchant profile: %+v", *account.MerchantProfile)

func NewClient

func NewClient(opts ...client.ClientOption) *Client

NewClient creates new SumUp API client. The client is by default configured environment variables (`SUMUP_API_KEY`). To override the default configuration use [ClientOption]s.

api_keys

import "github.com/sumup/sumup-go/api_keys"

Index

type ApiKeysService

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

func NewApiKeysService

func NewApiKeysService(c *client.Client) *ApiKeysService

func (*ApiKeysService) Create

func (s *ApiKeysService) Create(ctx context.Context, merchantCode string, body CreateApikeyBody) (*Apikey, error)

Create: Create an API key Create a new API key.

func (*ApiKeysService) Delete

func (s *ApiKeysService) Delete(ctx context.Context, merchantCode string, keyId string) error

Delete: Delete an API key Delete an API key.

func (*ApiKeysService) Get

func (s *ApiKeysService) Get(ctx context.Context, merchantCode string, keyId string) (*Apikey, error)

Get: Retrieve an API Key Retrieve an API key.

func (*ApiKeysService) List

func (s *ApiKeysService) List(ctx context.Context, merchantCode string, params ListApikeysParams) (*ApikeysList, error)

List: List API keys List merchant's API keys.

func (*ApiKeysService) Update

func (s *ApiKeysService) Update(ctx context.Context, merchantCode string, keyId string, body UpdateApikeyBody) error

Update: Update an API key Update an API key.

type Apikey

Apikey: An API key is a static token that allows you to authorize with SumUp APIs. Keep your API keys secret and safe. Do not share your API keys or expose them in a publicly accessible areas such as client-side code (browser or apps) or in the GitHub.

type Apikey struct {
    // The timestamp of when the API key was created.
    CreatedAt time.Time `json:"created_at"`
    // Unique identifier of the API Key.
    Id  string `json:"id"`
    // User-assigned name of the API Key.
    Name string `json:"name"`
    // The plaintext value of the API key. This field is returned only in the response to API key creation and is
    // never again available in the plaintext form.
    Plaintext *string `json:"plaintext,omitempty"`
    // Last 8 characters of the API key.
    Preview string `json:"preview"`
    // Max items: 128
    Scopes Oauth2Scopes `json:"scopes"`
    Type   ApikeyType   `json:"type"`
    // The timestamp of when the API key was last updated.
    UpdatedAt time.Time `json:"updated_at"`
}

type ApikeyType

ApikeyType is a schema definition.

type ApikeyType string

const (
    ApikeyTypePublic ApikeyType = "public"
    ApikeyTypeSecret ApikeyType = "secret"
)

type ApikeysList

ApikeysList: List of API keys.

type ApikeysList struct {
    // List of API keys.
    Items []Apikey `json:"items"`
    // Total number of API keys.
    TotalCount int `json:"total_count"`
}

type CreateApikeyBody

CreateApikeyBody is a schema definition.

type CreateApikeyBody struct {
    // Name of the API key.
    // Max length: 255
    Name string `json:"name"`
    // Max items: 128
    Scopes Oauth2Scopes `json:"scopes"`
}

type ListApikeysParams

ListApikeysParams: query parameters for ListAPIKeys

type ListApikeysParams struct {
    // Maximum number of API Keys to return.
    Limit *int
    // Offset of the first API Key to return.
    Offset *int
}

func (*ListApikeysParams) QueryValues

func (p *ListApikeysParams) QueryValues() url.Values

QueryValues converts ListApikeysParams into [url.Values].

type Oauth2Scope

Oauth2Scope is a schema definition.

type Oauth2Scope string

const (
    Oauth2ScopeAccountingRead      Oauth2Scope = "accounting.read"
    Oauth2ScopeAccountingWrite     Oauth2Scope = "accounting.write"
    Oauth2ScopeEmail               Oauth2Scope = "email"
    Oauth2ScopeInvoicesRead        Oauth2Scope = "invoices.read"
    Oauth2ScopeInvoicesWrite       Oauth2Scope = "invoices.write"
    Oauth2ScopePaymentInstruments  Oauth2Scope = "payment_instruments"
    Oauth2ScopePayments            Oauth2Scope = "payments"
    Oauth2ScopeProducts            Oauth2Scope = "products"
    Oauth2ScopeProfile             Oauth2Scope = "profile"
    Oauth2ScopeReadersRead         Oauth2Scope = "readers.read"
    Oauth2ScopeReadersWrite        Oauth2Scope = "readers.write"
    Oauth2ScopeTransactionsHistory Oauth2Scope = "transactions.history"
    Oauth2ScopeUserAppSettings     Oauth2Scope = "user.app-settings"
    Oauth2ScopeUserPayoutSettings  Oauth2Scope = "user.payout-settings"
    Oauth2ScopeUserProfile         Oauth2Scope = "user.profile"
    Oauth2ScopeUserProfileReadonly Oauth2Scope = "user.profile_readonly"
    Oauth2ScopeUserSubaccounts     Oauth2Scope = "user.subaccounts"
)

type Oauth2Scopes

Oauth2Scopes is a schema definition. Max items: 128

type Oauth2Scopes []Oauth2Scope

type UpdateApikeyBody

UpdateApikeyBody is a schema definition.

type UpdateApikeyBody struct {
    // New name for the API key.
    // Max length: 255
    Name string `json:"name"`
    // Max items: 128
    Scopes Oauth2Scopes `json:"scopes"`
}

checkouts

import "github.com/sumup/sumup-go/checkouts"

Index

type Card

Card: __Required when payment type is `card`.__ Details of the payment card.

type Card struct {
    // Three or four-digit card verification value (security code) of the payment card.
    // Write only
    // Min length: 3
    // Max length: 4
    Cvv string `json:"cvv"`
    // Month from the expiration time of the payment card. Accepted format is `MM`.
    // Write only
    ExpiryMonth CardExpiryMonth `json:"expiry_month"`
    // Year from the expiration time of the payment card. Accepted formats are `YY` and `YYYY`.
    // Write only
    // Min length: 2
    // Max length: 4
    ExpiryYear string `json:"expiry_year"`
    // Last 4 digits of the payment card number.
    // Read only
    // Min length: 4
    // Max length: 4
    Last4Digits string `json:"last_4_digits"`
    // Name of the cardholder as it appears on the payment card.
    // Write only
    Name string `json:"name"`
    // Number of the payment card (without spaces).
    // Write only
    Number string `json:"number"`
    // Issuing card network of the payment card.
    // Read only
    Type CardType `json:"type"`
    // Required five-digit ZIP code. Applicable only to merchant users in the USA.
    // Write only
    // Min length: 5
    // Max length: 5
    ZipCode *string `json:"zip_code,omitempty"`
}

type CardExpiryMonth

CardExpiryMonth: Month from the expiration time of the payment card. Accepted format is `MM`. Write only

type CardExpiryMonth string

const (
    CardExpiryMonth01 CardExpiryMonth = "01"
    CardExpiryMonth02 CardExpiryMonth = "02"
    CardExpiryMonth03 CardExpiryMonth = "03"
    CardExpiryMonth04 CardExpiryMonth = "04"
    CardExpiryMonth05 CardExpiryMonth = "05"
    CardExpiryMonth06 CardExpiryMonth = "06"
    CardExpiryMonth07 CardExpiryMonth = "07"
    CardExpiryMonth08 CardExpiryMonth = "08"
    CardExpiryMonth09 CardExpiryMonth = "09"
    CardExpiryMonth10 CardExpiryMonth = "10"
    CardExpiryMonth11 CardExpiryMonth = "11"
    CardExpiryMonth12 CardExpiryMonth = "12"
)

type CardType

CardType: Issuing card network of the payment card. Read only

type CardType string

const (
    CardTypeAmex         CardType = "AMEX"
    CardTypeCup          CardType = "CUP"
    CardTypeDiners       CardType = "DINERS"
    CardTypeDiscover     CardType = "DISCOVER"
    CardTypeElo          CardType = "ELO"
    CardTypeElv          CardType = "ELV"
    CardTypeHipercard    CardType = "HIPERCARD"
    CardTypeJcb          CardType = "JCB"
    CardTypeMaestro      CardType = "MAESTRO"
    CardTypeMastercard   CardType = "MASTERCARD"
    CardTypeUnknown      CardType = "UNKNOWN"
    CardTypeVisa         CardType = "VISA"
    CardTypeVisaElectron CardType = "VISA_ELECTRON"
    CardTypeVisaVpay     CardType = "VISA_VPAY"
)

type Checkout

Checkout: Details of the payment checkout.

type Checkout struct {
    // Amount of the payment.
    Amount *float64 `json:"amount,omitempty"`
    // Unique ID of the payment checkout specified by the client application when creating the checkout resource.
    // Max length: 90
    CheckoutReference *string `json:"checkout_reference,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
    // the referenced customer.
    CustomerId *string `json:"customer_id,omitempty"`
    // Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Date *time.Time `json:"date,omitempty"`
    // Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
    // easier identification of a checkout.
    Description *string `json:"description,omitempty"`
    // Unique ID of the checkout resource.
    // Read only
    Id  *string `json:"id,omitempty"`
    // Created mandate
    Mandate *shared.MandateResponse `json:"mandate,omitempty"`
    // Unique identifying code of the merchant profile.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    // Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
    PayToEmail *string `json:"pay_to_email,omitempty"`
    // URL to which the SumUp platform sends the processing status of the payment checkout.
    // Format: uri
    ReturnUrl *string `json:"return_url,omitempty"`
    // Current status of the checkout.
    Status *CheckoutStatus `json:"status,omitempty"`
    // List of transactions related to the payment.
    // Unique items only
    Transactions *[]CheckoutTransaction `json:"transactions,omitempty"`
    // Date and time of the checkout expiration before which the client application needs to send a processing request.
    // If no value is present, the checkout does not have an expiration time.
    ValidUntil *time.Time `json:"valid_until,omitempty"`
}

type CheckoutAccepted

CheckoutAccepted: 3DS Response

type CheckoutAccepted struct {
    // Required action processing 3D Secure payments.
    NextStep *CheckoutAcceptedNextStep `json:"next_step,omitempty"`
}

type CheckoutAcceptedNextStep

CheckoutAcceptedNextStep: Required action processing 3D Secure payments.

type CheckoutAcceptedNextStep struct {
    // Indicates allowed mechanisms for redirecting an end user. If both values are provided to ensure a redirect takes
    // place in either.
    Mechanism *[]CheckoutAcceptedNextStepMechanism `json:"mechanism,omitempty"`
    // Method used to complete the redirect.
    Method *string `json:"method,omitempty"`
    // Contains parameters essential for form redirection. Number of object keys and their content can vary.
    Payload *CheckoutAcceptedNextStepPayload `json:"payload,omitempty"`
    // Refers to a url where the end user is redirected once the payment processing completes.
    RedirectUrl *string `json:"redirect_url,omitempty"`
    // Where the end user is redirected.
    Url *string `json:"url,omitempty"`
}

type CheckoutAcceptedNextStepMechanism

CheckoutAcceptedNextStepMechanism is a schema definition.

type CheckoutAcceptedNextStepMechanism string

const (
    CheckoutAcceptedNextStepMechanismBrowser CheckoutAcceptedNextStepMechanism = "browser"
    CheckoutAcceptedNextStepMechanismIframe  CheckoutAcceptedNextStepMechanism = "iframe"
)

type CheckoutAcceptedNextStepPayload

CheckoutAcceptedNextStepPayload: Contains parameters essential for form redirection. Number of object keys and their content can vary.

type CheckoutAcceptedNextStepPayload struct {
    Md      *interface{} `json:"md,omitempty"`
    PaReq   *interface{} `json:"pa_req,omitempty"`
    TermUrl *interface{} `json:"term_url,omitempty"`
}

type CheckoutCreateRequest

CheckoutCreateRequest: Details of the payment checkout.

type CheckoutCreateRequest struct {
    // Amount of the payment.
    Amount float64 `json:"amount"`
    // Unique ID of the payment checkout specified by the client application when creating the checkout resource.
    // Max length: 90
    CheckoutReference string `json:"checkout_reference"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency shared.Currency `json:"currency"`
    // Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
    // the referenced customer.
    CustomerId *string `json:"customer_id,omitempty"`
    // Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    //
    // Read only
    Date *time.Time `json:"date,omitempty"`
    // Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
    // easier identification of a checkout.
    Description *string `json:"description,omitempty"`
    // Unique ID of the checkout resource.
    // Read only
    Id  *string `json:"id,omitempty"`
    // Unique identifying code of the merchant profile.
    MerchantCode string `json:"merchant_code"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    // Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
    PayToEmail *string `json:"pay_to_email,omitempty"`
    // Purpose of the checkout.
    // Default: CHECKOUT
    Purpose *CheckoutCreateRequestPurpose `json:"purpose,omitempty"`
    // __Required__ for [APMs](https://developer.sumup.com/online-payments/apm/introduction) and __recommended__ for
    // card payments. Refers to a url where the end user is redirected once the payment processing completes. If
    // not specified, the [Payment Widget](https://developer.sumup.com/online-payments/tools/card-widget) renders [3DS
    // challenge](https://developer.sumup.com/online-payments/features/3ds) within an iframe instead of performing a
    // full-page redirect.
    RedirectUrl *string `json:"redirect_url,omitempty"`
    // URL to which the SumUp platform sends the processing status of the payment checkout.
    // Format: uri
    ReturnUrl *string `json:"return_url,omitempty"`
    // Current status of the checkout.
    // Read only
    Status *CheckoutCreateRequestStatus `json:"status,omitempty"`
    // List of transactions related to the payment.
    // Read only
    // Unique items only
    Transactions *[]CheckoutCreateRequestTransaction `json:"transactions,omitempty"`
    // Date and time of the checkout expiration before which the client application needs to send a processing request.
    // If no value is present, the checkout does not have an expiration time.
    ValidUntil *time.Time `json:"valid_until,omitempty"`
}

type CheckoutCreateRequestPurpose

CheckoutCreateRequestPurpose: Purpose of the checkout. Default: CHECKOUT

type CheckoutCreateRequestPurpose string

const (
    CheckoutCreateRequestPurposeCheckout              CheckoutCreateRequestPurpose = "CHECKOUT"
    CheckoutCreateRequestPurposeSetupRecurringPayment CheckoutCreateRequestPurpose = "SETUP_RECURRING_PAYMENT"
)

type CheckoutCreateRequestStatus

CheckoutCreateRequestStatus: Current status of the checkout. Read only

type CheckoutCreateRequestStatus string

const (
    CheckoutCreateRequestStatusFailed  CheckoutCreateRequestStatus = "FAILED"
    CheckoutCreateRequestStatusPaid    CheckoutCreateRequestStatus = "PAID"
    CheckoutCreateRequestStatusPending CheckoutCreateRequestStatus = "PENDING"
)

type CheckoutCreateRequestTransaction

CheckoutCreateRequestTransaction is a schema definition.

type CheckoutCreateRequestTransaction struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Entry mode of the payment details.
    EntryMode *CheckoutCreateRequestTransactionEntryMode `json:"entry_mode,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Payment type used for the transaction.
    PaymentType *CheckoutCreateRequestTransactionPaymentType `json:"payment_type,omitempty"`
    // Current status of the transaction.
    Status *CheckoutCreateRequestTransactionStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
}

type CheckoutCreateRequestTransactionEntryMode

CheckoutCreateRequestTransactionEntryMode: Entry mode of the payment details.

type CheckoutCreateRequestTransactionEntryMode string

const (
    CheckoutCreateRequestTransactionEntryModeBoleto        CheckoutCreateRequestTransactionEntryMode = "BOLETO"
    CheckoutCreateRequestTransactionEntryModeCustomerEntry CheckoutCreateRequestTransactionEntryMode = "CUSTOMER_ENTRY"
)

type CheckoutCreateRequestTransactionPaymentType

CheckoutCreateRequestTransactionPaymentType: Payment type used for the transaction.

type CheckoutCreateRequestTransactionPaymentType string

const (
    CheckoutCreateRequestTransactionPaymentTypeBoleto    CheckoutCreateRequestTransactionPaymentType = "BOLETO"
    CheckoutCreateRequestTransactionPaymentTypeEcom      CheckoutCreateRequestTransactionPaymentType = "ECOM"
    CheckoutCreateRequestTransactionPaymentTypeRecurring CheckoutCreateRequestTransactionPaymentType = "RECURRING"
)

type CheckoutCreateRequestTransactionStatus

CheckoutCreateRequestTransactionStatus: Current status of the transaction.

type CheckoutCreateRequestTransactionStatus string

const (
    CheckoutCreateRequestTransactionStatusCancelled  CheckoutCreateRequestTransactionStatus = "CANCELLED"
    CheckoutCreateRequestTransactionStatusFailed     CheckoutCreateRequestTransactionStatus = "FAILED"
    CheckoutCreateRequestTransactionStatusPending    CheckoutCreateRequestTransactionStatus = "PENDING"
    CheckoutCreateRequestTransactionStatusSuccessful CheckoutCreateRequestTransactionStatus = "SUCCESSFUL"
)

type CheckoutProcessMixin

CheckoutProcessMixin: Details of the payment instrument for processing the checkout.

type CheckoutProcessMixin struct {
    // __Required when payment type is `card`.__ Details of the payment card.
    Card *Card `json:"card,omitempty"`
    // __Required when `token` is provided.__ Unique ID of the customer.
    CustomerId *string `json:"customer_id,omitempty"`
    // Number of installments for deferred payments. Available only to merchant users in Brazil.
    // Min: 1
    // Max: 12
    Installments *int `json:"installments,omitempty"`
    // Mandate is passed when a card is to be tokenized
    Mandate *MandatePayload `json:"mandate,omitempty"`
    // Describes the payment method used to attempt processing
    PaymentType CheckoutProcessMixinPaymentType `json:"payment_type"`
    // Personal details for the customer.
    PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
    // __Required when using a tokenized card to process a checkout.__ Unique token identifying the saved payment card
    // for a customer.
    Token *string `json:"token,omitempty"`
}

type CheckoutProcessMixinPaymentType

CheckoutProcessMixinPaymentType: Describes the payment method used to attempt processing

type CheckoutProcessMixinPaymentType string

const (
    CheckoutProcessMixinPaymentTypeBancontact CheckoutProcessMixinPaymentType = "bancontact"
    CheckoutProcessMixinPaymentTypeBlik       CheckoutProcessMixinPaymentType = "blik"
    CheckoutProcessMixinPaymentTypeBoleto     CheckoutProcessMixinPaymentType = "boleto"
    CheckoutProcessMixinPaymentTypeCard       CheckoutProcessMixinPaymentType = "card"
    CheckoutProcessMixinPaymentTypeIdeal      CheckoutProcessMixinPaymentType = "ideal"
)

type CheckoutStatus

CheckoutStatus: Current status of the checkout.

type CheckoutStatus string

const (
    CheckoutStatusFailed  CheckoutStatus = "FAILED"
    CheckoutStatusPaid    CheckoutStatus = "PAID"
    CheckoutStatusPending CheckoutStatus = "PENDING"
)

type CheckoutSuccess

CheckoutSuccess is a schema definition.

type CheckoutSuccess struct {
    // Amount of the payment.
    Amount *float64 `json:"amount,omitempty"`
    // Unique ID of the payment checkout specified by the client application when creating the checkout resource.
    // Max length: 90
    CheckoutReference *string `json:"checkout_reference,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
    // the referenced customer.
    CustomerId *string `json:"customer_id,omitempty"`
    // Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Date *time.Time `json:"date,omitempty"`
    // Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
    // easier identification of a checkout.
    Description *string `json:"description,omitempty"`
    // Unique ID of the checkout resource.
    // Read only
    Id  *string `json:"id,omitempty"`
    // Created mandate
    Mandate *shared.MandateResponse `json:"mandate,omitempty"`
    // Unique identifying code of the merchant profile.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Name of the merchant
    MerchantName *string `json:"merchant_name,omitempty"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    // Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
    PayToEmail *string `json:"pay_to_email,omitempty"`
    // Object containing token information for the specified payment instrument
    PaymentInstrument *CheckoutSuccessPaymentInstrument `json:"payment_instrument,omitempty"`
    // Refers to a url where the end user is redirected once the payment processing completes.
    RedirectUrl *string `json:"redirect_url,omitempty"`
    // URL to which the SumUp platform sends the processing status of the payment checkout.
    // Format: uri
    ReturnUrl *string `json:"return_url,omitempty"`
    // Current status of the checkout.
    Status *CheckoutSuccessStatus `json:"status,omitempty"`
    // Transaction code of the successful transaction with which the payment for the checkout is completed.
    // Read only
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Transaction ID of the successful transaction with which the payment for the checkout is completed.
    // Read only
    TransactionId *string `json:"transaction_id,omitempty"`
    // List of transactions related to the payment.
    // Unique items only
    Transactions *[]CheckoutSuccessTransaction `json:"transactions,omitempty"`
    // Date and time of the checkout expiration before which the client application needs to send a processing request.
    // If no value is present, the checkout does not have an expiration time.
    ValidUntil *time.Time `json:"valid_until,omitempty"`
}

type CheckoutSuccessPaymentInstrument

CheckoutSuccessPaymentInstrument: Object containing token information for the specified payment instrument

type CheckoutSuccessPaymentInstrument struct {
    // Token value
    Token *string `json:"token,omitempty"`
}

type CheckoutSuccessStatus

CheckoutSuccessStatus: Current status of the checkout.

type CheckoutSuccessStatus string

const (
    CheckoutSuccessStatusFailed  CheckoutSuccessStatus = "FAILED"
    CheckoutSuccessStatusPaid    CheckoutSuccessStatus = "PAID"
    CheckoutSuccessStatusPending CheckoutSuccessStatus = "PENDING"
)

type CheckoutSuccessTransaction

CheckoutSuccessTransaction is a schema definition.

type CheckoutSuccessTransaction struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Entry mode of the payment details.
    EntryMode *CheckoutSuccessTransactionEntryMode `json:"entry_mode,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Payment type used for the transaction.
    PaymentType *CheckoutSuccessTransactionPaymentType `json:"payment_type,omitempty"`
    // Current status of the transaction.
    Status *CheckoutSuccessTransactionStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
}

type CheckoutSuccessTransactionEntryMode

CheckoutSuccessTransactionEntryMode: Entry mode of the payment details.

type CheckoutSuccessTransactionEntryMode string

const (
    CheckoutSuccessTransactionEntryModeBoleto        CheckoutSuccessTransactionEntryMode = "BOLETO"
    CheckoutSuccessTransactionEntryModeCustomerEntry CheckoutSuccessTransactionEntryMode = "CUSTOMER_ENTRY"
)

type CheckoutSuccessTransactionPaymentType

CheckoutSuccessTransactionPaymentType: Payment type used for the transaction.

type CheckoutSuccessTransactionPaymentType string

const (
    CheckoutSuccessTransactionPaymentTypeBoleto    CheckoutSuccessTransactionPaymentType = "BOLETO"
    CheckoutSuccessTransactionPaymentTypeEcom      CheckoutSuccessTransactionPaymentType = "ECOM"
    CheckoutSuccessTransactionPaymentTypeRecurring CheckoutSuccessTransactionPaymentType = "RECURRING"
)

type CheckoutSuccessTransactionStatus

CheckoutSuccessTransactionStatus: Current status of the transaction.

type CheckoutSuccessTransactionStatus string

const (
    CheckoutSuccessTransactionStatusCancelled  CheckoutSuccessTransactionStatus = "CANCELLED"
    CheckoutSuccessTransactionStatusFailed     CheckoutSuccessTransactionStatus = "FAILED"
    CheckoutSuccessTransactionStatusPending    CheckoutSuccessTransactionStatus = "PENDING"
    CheckoutSuccessTransactionStatusSuccessful CheckoutSuccessTransactionStatus = "SUCCESSFUL"
)

type CheckoutTransaction

CheckoutTransaction is a schema definition.

type CheckoutTransaction struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Entry mode of the payment details.
    EntryMode *CheckoutTransactionEntryMode `json:"entry_mode,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Payment type used for the transaction.
    PaymentType *CheckoutTransactionPaymentType `json:"payment_type,omitempty"`
    // Current status of the transaction.
    Status *CheckoutTransactionStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
}

type CheckoutTransactionEntryMode

CheckoutTransactionEntryMode: Entry mode of the payment details.

type CheckoutTransactionEntryMode string

const (
    CheckoutTransactionEntryModeBoleto        CheckoutTransactionEntryMode = "BOLETO"
    CheckoutTransactionEntryModeCustomerEntry CheckoutTransactionEntryMode = "CUSTOMER_ENTRY"
)

type CheckoutTransactionPaymentType

CheckoutTransactionPaymentType: Payment type used for the transaction.

type CheckoutTransactionPaymentType string

const (
    CheckoutTransactionPaymentTypeBoleto    CheckoutTransactionPaymentType = "BOLETO"
    CheckoutTransactionPaymentTypeEcom      CheckoutTransactionPaymentType = "ECOM"
    CheckoutTransactionPaymentTypeRecurring CheckoutTransactionPaymentType = "RECURRING"
)

type CheckoutTransactionStatus

CheckoutTransactionStatus: Current status of the transaction.

type CheckoutTransactionStatus string

const (
    CheckoutTransactionStatusCancelled  CheckoutTransactionStatus = "CANCELLED"
    CheckoutTransactionStatusFailed     CheckoutTransactionStatus = "FAILED"
    CheckoutTransactionStatusPending    CheckoutTransactionStatus = "PENDING"
    CheckoutTransactionStatusSuccessful CheckoutTransactionStatus = "SUCCESSFUL"
)

type CheckoutsService

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

func NewCheckoutsService

func NewCheckoutsService(c *client.Client) *CheckoutsService

func (*CheckoutsService) Create

func (s *CheckoutsService) Create(ctx context.Context, body CreateCheckoutBody) (*Checkout, error)

Create: Create a checkout Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.

For 3DS checkouts, add the `redirect_url` parameter to your request body schema.

Follow by processing a checkout to charge the provided payment instrument.

func (*CheckoutsService) Deactivate

func (s *CheckoutsService) Deactivate(ctx context.Context, id string) (*DeactivateCheckout200Response, error)

Deactivate: Deactivate a checkout Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.

func (*CheckoutsService) Get

func (s *CheckoutsService) Get(ctx context.Context, id string) (*CheckoutSuccess, error)

Get: Retrieve a checkout Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.

func (*CheckoutsService) List

func (s *CheckoutsService) List(ctx context.Context, params ListCheckoutsParams) (*ListCheckouts200Response, error)

List: List checkouts Lists created checkout resources according to the applied `checkout_reference`.

func (*CheckoutsService) ListAvailablePaymentMethods

func (s *CheckoutsService) ListAvailablePaymentMethods(ctx context.Context, merchantCode string, params GetPaymentMethodsParams) (*GetPaymentMethods200Response, error)

ListAvailablePaymentMethods: Get available payment methods Get payment methods available for the given merchant to use with a checkout.

func (*CheckoutsService) Process

func (s *CheckoutsService) Process(ctx context.Context, id string, body ProcessCheckoutBody) (*ProcessCheckoutResponse, error)

Process: Process a checkout Processing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the `Create a checkout` endpoint.

Follow this request with `Retrieve a checkout` to confirm its status.

type CreateCheckoutBody

CreateCheckoutBody: Details of the payment checkout.

type CreateCheckoutBody struct {
    // Amount of the payment.
    Amount float64 `json:"amount"`
    // Unique ID of the payment checkout specified by the client application when creating the checkout resource.
    // Max length: 90
    CheckoutReference string `json:"checkout_reference"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency shared.Currency `json:"currency"`
    // Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
    // the referenced customer.
    CustomerId *string `json:"customer_id,omitempty"`
    // Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    //
    // Read only
    Date *time.Time `json:"date,omitempty"`
    // Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
    // easier identification of a checkout.
    Description *string `json:"description,omitempty"`
    // Unique ID of the checkout resource.
    // Read only
    Id  *string `json:"id,omitempty"`
    // Unique identifying code of the merchant profile.
    MerchantCode string `json:"merchant_code"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    // Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
    PayToEmail *string `json:"pay_to_email,omitempty"`
    // Purpose of the checkout.
    // Default: CHECKOUT
    Purpose *CreateCheckoutBodyPurpose `json:"purpose,omitempty"`
    // __Required__ for [APMs](https://developer.sumup.com/online-payments/apm/introduction) and __recommended__ for
    // card payments. Refers to a url where the end user is redirected once the payment processing completes. If
    // not specified, the [Payment Widget](https://developer.sumup.com/online-payments/tools/card-widget) renders [3DS
    // challenge](https://developer.sumup.com/online-payments/features/3ds) within an iframe instead of performing a
    // full-page redirect.
    RedirectUrl *string `json:"redirect_url,omitempty"`
    // URL to which the SumUp platform sends the processing status of the payment checkout.
    // Format: uri
    ReturnUrl *string `json:"return_url,omitempty"`
    // Current status of the checkout.
    // Read only
    Status *CreateCheckoutBodyStatus `json:"status,omitempty"`
    // List of transactions related to the payment.
    // Read only
    // Unique items only
    Transactions *[]CreateCheckoutBodyTransaction `json:"transactions,omitempty"`
    // Date and time of the checkout expiration before which the client application needs to send a processing request.
    // If no value is present, the checkout does not have an expiration time.
    ValidUntil *time.Time `json:"valid_until,omitempty"`
}

type CreateCheckoutBodyPurpose

CreateCheckoutBodyPurpose: Purpose of the checkout. Default: CHECKOUT

type CreateCheckoutBodyPurpose string

const (
    CreateCheckoutBodyPurposeCheckout              CreateCheckoutBodyPurpose = "CHECKOUT"
    CreateCheckoutBodyPurposeSetupRecurringPayment CreateCheckoutBodyPurpose = "SETUP_RECURRING_PAYMENT"
)

type CreateCheckoutBodyStatus

CreateCheckoutBodyStatus: Current status of the checkout. Read only

type CreateCheckoutBodyStatus string

const (
    CreateCheckoutBodyStatusFailed  CreateCheckoutBodyStatus = "FAILED"
    CreateCheckoutBodyStatusPaid    CreateCheckoutBodyStatus = "PAID"
    CreateCheckoutBodyStatusPending CreateCheckoutBodyStatus = "PENDING"
)

type CreateCheckoutBodyTransaction

CreateCheckoutBodyTransaction is a schema definition.

type CreateCheckoutBodyTransaction struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Entry mode of the payment details.
    EntryMode *CreateCheckoutBodyTransactionEntryMode `json:"entry_mode,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Payment type used for the transaction.
    PaymentType *CreateCheckoutBodyTransactionPaymentType `json:"payment_type,omitempty"`
    // Current status of the transaction.
    Status *CreateCheckoutBodyTransactionStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
}

type CreateCheckoutBodyTransactionEntryMode

CreateCheckoutBodyTransactionEntryMode: Entry mode of the payment details.

type CreateCheckoutBodyTransactionEntryMode string

const (
    CreateCheckoutBodyTransactionEntryModeBoleto        CreateCheckoutBodyTransactionEntryMode = "BOLETO"
    CreateCheckoutBodyTransactionEntryModeCustomerEntry CreateCheckoutBodyTransactionEntryMode = "CUSTOMER_ENTRY"
)

type CreateCheckoutBodyTransactionPaymentType

CreateCheckoutBodyTransactionPaymentType: Payment type used for the transaction.

type CreateCheckoutBodyTransactionPaymentType string

const (
    CreateCheckoutBodyTransactionPaymentTypeBoleto    CreateCheckoutBodyTransactionPaymentType = "BOLETO"
    CreateCheckoutBodyTransactionPaymentTypeEcom      CreateCheckoutBodyTransactionPaymentType = "ECOM"
    CreateCheckoutBodyTransactionPaymentTypeRecurring CreateCheckoutBodyTransactionPaymentType = "RECURRING"
)

type CreateCheckoutBodyTransactionStatus

CreateCheckoutBodyTransactionStatus: Current status of the transaction.

type CreateCheckoutBodyTransactionStatus string

const (
    CreateCheckoutBodyTransactionStatusCancelled  CreateCheckoutBodyTransactionStatus = "CANCELLED"
    CreateCheckoutBodyTransactionStatusFailed     CreateCheckoutBodyTransactionStatus = "FAILED"
    CreateCheckoutBodyTransactionStatusPending    CreateCheckoutBodyTransactionStatus = "PENDING"
    CreateCheckoutBodyTransactionStatusSuccessful CreateCheckoutBodyTransactionStatus = "SUCCESSFUL"
)

type DeactivateCheckout200Response

DeactivateCheckout200Response: Details of the deleted checkout.

type DeactivateCheckout200Response struct {
    // Amount of the payment.
    Amount *float64 `json:"amount,omitempty"`
    // Unique ID of the payment checkout specified by the client application when creating the checkout resource.
    // Max length: 90
    CheckoutReference *string `json:"checkout_reference,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    //
    // Read only
    Date *time.Time `json:"date,omitempty"`
    // Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
    // easier identification of a checkout.
    Description *string `json:"description,omitempty"`
    // Unique ID of the checkout resource.
    // Read only
    Id  *string `json:"id,omitempty"`
    // Unique identifying code of the merchant profile.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // The merchant's country
    MerchantCountry *string `json:"merchant_country,omitempty"`
    // Merchant name
    MerchantName *string `json:"merchant_name,omitempty"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    // Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
    PayToEmail *string `json:"pay_to_email,omitempty"`
    // Purpose of the checkout creation initially
    Purpose *DeactivateCheckout200ResponsePurpose `json:"purpose,omitempty"`
    // Current status of the checkout.
    // Read only
    Status *DeactivateCheckout200ResponseStatus `json:"status,omitempty"`
    // List of transactions related to the payment.
    // Read only
    // Unique items only
    Transactions *[]DeactivateCheckout200ResponseTransaction `json:"transactions,omitempty"`
    // Date and time of the checkout expiration before which the client application needs to send a processing request.
    // If no value is present, the checkout does not have an expiration time.
    // Read only
    ValidUntil *time.Time `json:"valid_until,omitempty"`
}

type DeactivateCheckout200ResponsePurpose

DeactivateCheckout200ResponsePurpose: Purpose of the checkout creation initially

type DeactivateCheckout200ResponsePurpose string

const (
    DeactivateCheckout200ResponsePurposeCheckout              DeactivateCheckout200ResponsePurpose = "CHECKOUT"
    DeactivateCheckout200ResponsePurposeSetupRecurringPayment DeactivateCheckout200ResponsePurpose = "SETUP_RECURRING_PAYMENT"
)

type DeactivateCheckout200ResponseStatus

DeactivateCheckout200ResponseStatus: Current status of the checkout. Read only

type DeactivateCheckout200ResponseStatus string

const (
    DeactivateCheckout200ResponseStatusExpired DeactivateCheckout200ResponseStatus = "EXPIRED"
)

type DeactivateCheckout200ResponseTransaction

DeactivateCheckout200ResponseTransaction is a schema definition.

type DeactivateCheckout200ResponseTransaction struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Entry mode of the payment details.
    EntryMode *DeactivateCheckout200ResponseTransactionEntryMode `json:"entry_mode,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Payment type used for the transaction.
    PaymentType *DeactivateCheckout200ResponseTransactionPaymentType `json:"payment_type,omitempty"`
    // Current status of the transaction.
    Status *DeactivateCheckout200ResponseTransactionStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
}

type DeactivateCheckout200ResponseTransactionEntryMode

DeactivateCheckout200ResponseTransactionEntryMode: Entry mode of the payment details.

type DeactivateCheckout200ResponseTransactionEntryMode string

const (
    DeactivateCheckout200ResponseTransactionEntryModeBoleto        DeactivateCheckout200ResponseTransactionEntryMode = "BOLETO"
    DeactivateCheckout200ResponseTransactionEntryModeCustomerEntry DeactivateCheckout200ResponseTransactionEntryMode = "CUSTOMER_ENTRY"
)

type DeactivateCheckout200ResponseTransactionPaymentType

DeactivateCheckout200ResponseTransactionPaymentType: Payment type used for the transaction.

type DeactivateCheckout200ResponseTransactionPaymentType string

const (
    DeactivateCheckout200ResponseTransactionPaymentTypeBoleto    DeactivateCheckout200ResponseTransactionPaymentType = "BOLETO"
    DeactivateCheckout200ResponseTransactionPaymentTypeEcom      DeactivateCheckout200ResponseTransactionPaymentType = "ECOM"
    DeactivateCheckout200ResponseTransactionPaymentTypeRecurring DeactivateCheckout200ResponseTransactionPaymentType = "RECURRING"
)

type DeactivateCheckout200ResponseTransactionStatus

DeactivateCheckout200ResponseTransactionStatus: Current status of the transaction.

type DeactivateCheckout200ResponseTransactionStatus string

const (
    DeactivateCheckout200ResponseTransactionStatusCancelled  DeactivateCheckout200ResponseTransactionStatus = "CANCELLED"
    DeactivateCheckout200ResponseTransactionStatusFailed     DeactivateCheckout200ResponseTransactionStatus = "FAILED"
    DeactivateCheckout200ResponseTransactionStatusPending    DeactivateCheckout200ResponseTransactionStatus = "PENDING"
    DeactivateCheckout200ResponseTransactionStatusSuccessful DeactivateCheckout200ResponseTransactionStatus = "SUCCESSFUL"
)

type DetailsError

DetailsError: Error message structure.

type DetailsError struct {
    // Details of the error.
    Details           *string                         `json:"details,omitempty"`
    FailedConstraints *[]DetailsErrorFailedConstraint `json:"failed_constraints,omitempty"`
    // The status code.
    Status *float64 `json:"status,omitempty"`
    // Short title of the error.
    Title *string `json:"title,omitempty"`
}

func (*DetailsError) Error

func (e *DetailsError) Error() string

type DetailsErrorFailedConstraint

DetailsErrorFailedConstraint is a schema definition.

type DetailsErrorFailedConstraint struct {
    Message   *string `json:"message,omitempty"`
    Reference *string `json:"reference,omitempty"`
}

type ErrorExtended

ErrorExtended is a schema definition.

type ErrorExtended struct {
    // Platform code for the error.
    ErrorCode *string `json:"error_code,omitempty"`
    // Short description of the error.
    Message *string `json:"message,omitempty"`
    // Parameter name (with relative location) to which the error applies. Parameters from embedded resources are
    // displayed using dot notation. For example, `card.name` refers to the `name` parameter embedded in the `card`
    // object.
    Param *string `json:"param,omitempty"`
}

func (*ErrorExtended) Error

func (e *ErrorExtended) Error() string

type GetPaymentMethods200Response

GetPaymentMethods200Response is a schema definition.

type GetPaymentMethods200Response struct {
    AvailablePaymentMethods *[]GetPaymentMethods200ResponseAvailablePaymentMethod `json:"available_payment_methods,omitempty"`
}

type GetPaymentMethods200ResponseAvailablePaymentMethod

GetPaymentMethods200ResponseAvailablePaymentMethod is a schema definition.

type GetPaymentMethods200ResponseAvailablePaymentMethod struct {
    // The ID of the payment method.
    Id string `json:"id"`
}

type GetPaymentMethodsParams

GetPaymentMethodsParams: query parameters for GetPaymentMethods

type GetPaymentMethodsParams struct {
    // The amount for which the payment methods should be eligible, in major units. Note that currency must also
    // be provided when filtering by amount.
    Amount *float64
    // The currency for which the payment methods should be eligible.
    Currency *string
}

func (*GetPaymentMethodsParams) QueryValues

func (p *GetPaymentMethodsParams) QueryValues() url.Values

QueryValues converts GetPaymentMethodsParams into [url.Values].

type ListCheckouts200Response

ListCheckouts200Response is a schema definition.

type ListCheckouts200Response []CheckoutSuccess

type ListCheckoutsParams

ListCheckoutsParams: query parameters for ListCheckouts

type ListCheckoutsParams struct {
    // Filters the list of checkout resources by the unique ID of the checkout.
    CheckoutReference *string
}

func (*ListCheckoutsParams) QueryValues

func (p *ListCheckoutsParams) QueryValues() url.Values

QueryValues converts ListCheckoutsParams into [url.Values].

type MandatePayload

MandatePayload: Mandate is passed when a card is to be tokenized

type MandatePayload struct {
    // Indicates the mandate type
    Type MandatePayloadType `json:"type"`
    // Operating system and web client used by the end-user
    UserAgent string `json:"user_agent"`
    // IP address of the end user. Supports IPv4 and IPv6
    UserIp *string `json:"user_ip,omitempty"`
}

type MandatePayloadType

MandatePayloadType: Indicates the mandate type

type MandatePayloadType string

const (
    MandatePayloadTypeRecurrent MandatePayloadType = "recurrent"
)

type ProcessCheckout400Response

ProcessCheckout400Response is a schema definition.

type ProcessCheckout400Response json.RawMessage

func (*ProcessCheckout400Response) Error

func (e *ProcessCheckout400Response) Error() string

type ProcessCheckoutBody

ProcessCheckoutBody: Details of the payment instrument for processing the checkout.

type ProcessCheckoutBody struct {
    // __Required when payment type is `card`.__ Details of the payment card.
    Card *Card `json:"card,omitempty"`
    // __Required when `token` is provided.__ Unique ID of the customer.
    CustomerId *string `json:"customer_id,omitempty"`
    // Number of installments for deferred payments. Available only to merchant users in Brazil.
    // Min: 1
    // Max: 12
    Installments *int `json:"installments,omitempty"`
    // Mandate is passed when a card is to be tokenized
    Mandate *MandatePayload `json:"mandate,omitempty"`
    // Describes the payment method used to attempt processing
    PaymentType ProcessCheckoutBodyPaymentType `json:"payment_type"`
    // Personal details for the customer.
    PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
    // __Required when using a tokenized card to process a checkout.__ Unique token identifying the saved payment card
    // for a customer.
    Token *string `json:"token,omitempty"`
}

type ProcessCheckoutBodyPaymentType

ProcessCheckoutBodyPaymentType: Describes the payment method used to attempt processing

type ProcessCheckoutBodyPaymentType string

const (
    ProcessCheckoutBodyPaymentTypeBancontact ProcessCheckoutBodyPaymentType = "bancontact"
    ProcessCheckoutBodyPaymentTypeBlik       ProcessCheckoutBodyPaymentType = "blik"
    ProcessCheckoutBodyPaymentTypeBoleto     ProcessCheckoutBodyPaymentType = "boleto"
    ProcessCheckoutBodyPaymentTypeCard       ProcessCheckoutBodyPaymentType = "card"
    ProcessCheckoutBodyPaymentTypeIdeal      ProcessCheckoutBodyPaymentType = "ideal"
)

type ProcessCheckoutResponse

type ProcessCheckoutResponse struct {
    CheckoutSuccess  *CheckoutSuccess
    CheckoutAccepted *CheckoutAccepted
}

func (*ProcessCheckoutResponse) AsCheckoutAccepted

func (r *ProcessCheckoutResponse) AsCheckoutAccepted() (*CheckoutAccepted, bool)

func (*ProcessCheckoutResponse) AsCheckoutSuccess

func (r *ProcessCheckoutResponse) AsCheckoutSuccess() (*CheckoutSuccess, bool)

client

import "github.com/sumup/sumup-go/client"

Index

Constants

const (
    // APIUrl is the URL of our API.
    APIUrl = "https://api.sumup.com"
)

type Client

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

func New

func New(opts ...ClientOption) *Client

New creates new HTTP API client. The client is by default configured with environment variables (e.g. `SUMUP_API_KEY`). To override the default configuration use [ClientOption]s.

func (*Client) Call

func (c *Client) Call(ctx context.Context, method, path string, opts ...RequestOption) (*http.Response, error)

Call executes a SumUp API call. Use [RequestOption]s to configure the request.

func (*Client) Do

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

Do sends an HTTP request and returns an HTTP response, following policy (such as redirects, cookies, auth) as configured on the HTTP client.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error)

NewRequest returns a new [http.Request] given a method, URL, and optional body.

NewRequest returns a Request suitable for use with Client.Do.

func (*Client) WithAPIKey

func (c *Client) WithAPIKey(key string) ClientOption

WithAPIKey returns a ClientOption that configures the client with an API key for authorization.

func (*Client) WithBaseURL

func (c *Client) WithBaseURL(base string) ClientOption

WithBaseURL returns a ClientOption that configures the client with a base URL that the individual API call paths will be resolved against.

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(client *http.Client) ClientOption

WithClient returns a ClientOption that configures the client to use a specific http client for underlying requests.

type ClientOption

ClientOption is an option for the SumUp API client.

type ClientOption func(c *Client) error

type RequestOption

RequestOption is an option for the request made by the SumUp Client.

type RequestOption func(req *request) error

func WithHTTPClient

func WithHTTPClient(client *http.Client) RequestOption

WithHTTPClient returns a RequestOption that overrides the underlying [http.Client] of the service used to make the request.

func WithHeader

func WithHeader(key, value string) RequestOption

WithHeader returns a RequestOption that sets a header key-value pair. Any previously set value will be overwritten.

func WithJSONBody

func WithJSONBody(v any) RequestOption

WithBody returns a RequestOption that sets the request body as a JSON of the value v.

func WithQueryValues

func WithQueryValues(q url.Values) RequestOption

WithQueryValues returns a RequestOption that sets the request query params.

customers

import "github.com/sumup/sumup-go/customers"

Index

type CreateCustomerBody

CreateCustomerBody is a schema definition.

type CreateCustomerBody struct {
    // Unique ID of the customer.
    CustomerId string `json:"customer_id"`
    // Personal details for the customer.
    PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}

type Customer

Customer is a schema definition.

type Customer struct {
    // Unique ID of the customer.
    CustomerId string `json:"customer_id"`
    // Personal details for the customer.
    PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}

type CustomersService

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

func NewCustomersService

func NewCustomersService(c *client.Client) *CustomersService

func (*CustomersService) Create

func (s *CustomersService) Create(ctx context.Context, body CreateCustomerBody) (*Customer, error)

Create: Create a customer Creates a new saved customer resource which you can later manipulate and save payment instruments to.

func (*CustomersService) DeactivatePaymentInstrument

func (s *CustomersService) DeactivatePaymentInstrument(ctx context.Context, customerId string, token string) (*DeactivatePaymentInstrument204Response, error)

DeactivatePaymentInstrument: Deactivate a payment instrument Deactivates an identified card payment instrument resource for a customer.

func (*CustomersService) Get

func (s *CustomersService) Get(ctx context.Context, customerId string) (*Customer, error)

Get: Retrieve a customer Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.

func (*CustomersService) ListPaymentInstruments

func (s *CustomersService) ListPaymentInstruments(ctx context.Context, customerId string) (*ListPaymentInstruments200Response, error)

ListPaymentInstruments: List payment instruments Lists all payment instrument resources that are saved for an identified customer.

func (*CustomersService) Update

func (s *CustomersService) Update(ctx context.Context, customerId string, body UpdateCustomerBody) (*Customer, error)

Update: Update a customer Updates an identified saved customer resource's personal details.

The request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.

type DeactivatePaymentInstrument204Response

DeactivatePaymentInstrument204Response is a schema definition.

type DeactivatePaymentInstrument204Response struct {
}

type ListPaymentInstruments200Response

ListPaymentInstruments200Response is a schema definition.

type ListPaymentInstruments200Response []PaymentInstrumentResponse

type PaymentInstrumentResponse

PaymentInstrumentResponse: Payment Instrument Response

type PaymentInstrumentResponse struct {
    // Indicates whether the payment instrument is active and can be used for payments. To deactivate it, send a
    // `DELETE` request to the resource endpoint.
    // Read only
    // Default: true
    Active *bool `json:"active,omitempty"`
    // Details of the payment card.
    Card *PaymentInstrumentResponseCard `json:"card,omitempty"`
    // Creation date of payment instrument. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    CreatedAt *time.Time `json:"created_at,omitempty"`
    // Created mandate
    Mandate *shared.MandateResponse `json:"mandate,omitempty"`
    // Unique token identifying the saved payment card for a customer.
    // Read only
    Token *string `json:"token,omitempty"`
    // Type of the payment instrument.
    Type *PaymentInstrumentResponseType `json:"type,omitempty"`
}

type PaymentInstrumentResponseCard

PaymentInstrumentResponseCard: Details of the payment card.

type PaymentInstrumentResponseCard struct {
    // Last 4 digits of the payment card number.
    // Read only
    // Min length: 4
    // Max length: 4
    Last4Digits *string `json:"last_4_digits,omitempty"`
    // Issuing card network of the payment card.
    // Read only
    Type *PaymentInstrumentResponseCardType `json:"type,omitempty"`
}

type PaymentInstrumentResponseCardType

PaymentInstrumentResponseCardType: Issuing card network of the payment card. Read only

type PaymentInstrumentResponseCardType string

const (
    PaymentInstrumentResponseCardTypeAmex         PaymentInstrumentResponseCardType = "AMEX"
    PaymentInstrumentResponseCardTypeCup          PaymentInstrumentResponseCardType = "CUP"
    PaymentInstrumentResponseCardTypeDiners       PaymentInstrumentResponseCardType = "DINERS"
    PaymentInstrumentResponseCardTypeDiscover     PaymentInstrumentResponseCardType = "DISCOVER"
    PaymentInstrumentResponseCardTypeElo          PaymentInstrumentResponseCardType = "ELO"
    PaymentInstrumentResponseCardTypeElv          PaymentInstrumentResponseCardType = "ELV"
    PaymentInstrumentResponseCardTypeHipercard    PaymentInstrumentResponseCardType = "HIPERCARD"
    PaymentInstrumentResponseCardTypeJcb          PaymentInstrumentResponseCardType = "JCB"
    PaymentInstrumentResponseCardTypeMaestro      PaymentInstrumentResponseCardType = "MAESTRO"
    PaymentInstrumentResponseCardTypeMastercard   PaymentInstrumentResponseCardType = "MASTERCARD"
    PaymentInstrumentResponseCardTypeUnknown      PaymentInstrumentResponseCardType = "UNKNOWN"
    PaymentInstrumentResponseCardTypeVisa         PaymentInstrumentResponseCardType = "VISA"
    PaymentInstrumentResponseCardTypeVisaElectron PaymentInstrumentResponseCardType = "VISA_ELECTRON"
    PaymentInstrumentResponseCardTypeVisaVpay     PaymentInstrumentResponseCardType = "VISA_VPAY"
)

type PaymentInstrumentResponseType

PaymentInstrumentResponseType: Type of the payment instrument.

type PaymentInstrumentResponseType string

const (
    PaymentInstrumentResponseTypeCard PaymentInstrumentResponseType = "card"
)

type UpdateCustomerBody

UpdateCustomerBody is a schema definition.

type UpdateCustomerBody struct {
    // Personal details for the customer.
    PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}

members

import "github.com/sumup/sumup-go/members"

Index

type CreateMerchantMemberBody

CreateMerchantMemberBody is a schema definition.

type CreateMerchantMemberBody struct {
    // Object attributes that modifiable only by SumUp applications.
    Attributes *shared.Attributes `json:"attributes,omitempty"`
    // Email address of the member to add.
    // Format: email
    Email string `json:"email"`
    // True if the user is managed by the merchant. In this case, we'll created a virtual user with the provided password
    // and nickname.
    IsManagedUser *bool `json:"is_managed_user,omitempty"`
    // True if the user is a service account. It can later be used to create OAuth2 clients.
    IsServiceAccount *bool `json:"is_service_account,omitempty"`
    // Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
    // submit whole metadata.
    Metadata *shared.Metadata `json:"metadata,omitempty"`
    // Nickname of the member to add. Only used if `is_managed_user` is true. Used for display purposes only.
    Nickname *string `json:"nickname,omitempty"`
    // Password of the member to add. Only used if `is_managed_user` is true. In the case of service accounts, the
    // password is not used and can not be defined by the caller.
    // Format: password
    // Min length: 8
    Password *string `json:"password,omitempty"`
    // List of roles to assign to the new member. In the case of service accounts, the roles are predefined.
    Roles []string `json:"roles"`
}

type ListMerchantMembers200Response

ListMerchantMembers200Response is a schema definition.

type ListMerchantMembers200Response struct {
    Items      []Member `json:"items"`
    TotalCount *int     `json:"total_count,omitempty"`
}

type ListMerchantMembersParams

ListMerchantMembersParams: query parameters for ListMerchantMembers

type ListMerchantMembersParams struct {
    // Filter the returned members by email address prefix.
    Email *string
    // Maximum number of members to return.
    Limit *int
    // Offset of the first member to return.
    Offset *int
    // Filter the returned members by role.
    Roles *[]string
    // Indicates to skip count query.
    Scroll *bool
    // Filter the returned members by the membership status.
    Status *shared.MembershipStatus
}

func (*ListMerchantMembersParams) QueryValues

func (p *ListMerchantMembersParams) QueryValues() url.Values

QueryValues converts ListMerchantMembersParams into [url.Values].

type Member

Member: A member is user within specific resource identified by resource id, resource type, and associated roles.

type Member struct {
    // Object attributes that modifiable only by SumUp applications.
    Attributes *shared.Attributes `json:"attributes,omitempty"`
    // The timestamp of when the member was created.
    CreatedAt time.Time `json:"created_at"`
    // ID of the member.
    Id  string `json:"id"`
    // Pending invitation for membership.
    Invite *shared.Invite `json:"invite,omitempty"`
    // Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
    // submit whole metadata.
    Metadata *shared.Metadata `json:"metadata,omitempty"`
    // User's permissions.
    Permissions []string `json:"permissions"`
    // User's roles.
    Roles []string `json:"roles"`
    // The status of the membership.
    Status shared.MembershipStatus `json:"status"`
    // The timestamp of when the member was last updated.
    UpdatedAt time.Time `json:"updated_at"`
    // Information about the user associated with the membership.
    User *MembershipUser `json:"user,omitempty"`
}

type MembersService

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

func NewMembersService

func NewMembersService(c *client.Client) *MembersService

func (*MembersService) Create

func (s *MembersService) Create(ctx context.Context, merchantCode string, body CreateMerchantMemberBody) (*Member, error)

Create: Create a member Create a merchant member.

func (*MembersService) Delete

func (s *MembersService) Delete(ctx context.Context, merchantCode string, memberId string) error

Delete: Delete a member Deletes a merchant member.

func (*MembersService) Get

func (s *MembersService) Get(ctx context.Context, merchantCode string, memberId string) (*Member, error)

Get: Retrieve a member Retrieve a merchant member.

func (*MembersService) List

func (s *MembersService) List(ctx context.Context, merchantCode string, params ListMerchantMembersParams) (*ListMerchantMembers200Response, error)

List: List members Lists merchant members.

func (*MembersService) Update

func (s *MembersService) Update(ctx context.Context, merchantCode string, memberId string, body UpdateMerchantMemberBody) (*Member, error)

Update: Update a member Update the merchant member.

type MembershipUser

MembershipUser: Information about the user associated with the membership.

type MembershipUser struct {
    // Classic identifiers of the user.
    // Deprecated: this operation is deprecated
    Classic *MembershipUserClassic `json:"classic,omitempty"`
    // Time when the user has been disabled. Applies only to virtual users (`virtual_user: true`).
    DisabledAt *time.Time `json:"disabled_at,omitempty"`
    // End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The
    // RP MUST NOT rely upon this value being unique, for unique identification use ID instead.
    Email string `json:"email"`
    // Identifier for the End-User (also called Subject).
    Id  string `json:"id"`
    // True if the user has enabled MFA on login.
    MfaOnLoginEnabled bool `json:"mfa_on_login_enabled"`
    // User's preferred name. Used for display purposes only.
    Nickname *string `json:"nickname,omitempty"`
    // URL of the End-User's profile picture. This URL refers to an image file (for example, a PNG, JPEG, or GIF
    // image file), rather than to a Web page containing an image.
    // Format: uri
    Picture *string `json:"picture,omitempty"`
    // True if the user is a service account.
    ServiceAccountUser bool `json:"service_account_user"`
    // True if the user is a virtual user (operator).
    VirtualUser bool `json:"virtual_user"`
}

type MembershipUserClassic

MembershipUserClassic: Classic identifiers of the user. Deprecated: this operation is deprecated

type MembershipUserClassic struct {
    // Format: int32
    UserId int `json:"user_id"`
}

type UpdateMerchantMemberBody

UpdateMerchantMemberBody is a schema definition.

type UpdateMerchantMemberBody struct {
    // Object attributes that modifiable only by SumUp applications.
    Attributes *shared.Attributes `json:"attributes,omitempty"`
    // Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
    // submit whole metadata.
    Metadata *shared.Metadata `json:"metadata,omitempty"`
    Roles    *[]string        `json:"roles,omitempty"`
    // Allows you to update user data of managed users.
    User *UpdateMerchantMemberBodyUser `json:"user,omitempty"`
}

type UpdateMerchantMemberBodyUser

UpdateMerchantMemberBodyUser: Allows you to update user data of managed users.

type UpdateMerchantMemberBodyUser struct {
    // User's preferred name. Used for display purposes only.
    Nickname *string `json:"nickname,omitempty"`
    // Password of the member to add. Only used if `is_managed_user` is true.
    // Format: password
    // Min length: 8
    Password *string `json:"password,omitempty"`
}

memberships

import "github.com/sumup/sumup-go/memberships"

Index

type ListMemberships200Response

ListMemberships200Response is a schema definition.

type ListMemberships200Response struct {
    Items      []Membership `json:"items"`
    TotalCount int          `json:"total_count"`
}

type ListMembershipsParams

ListMembershipsParams: query parameters for ListMemberships

type ListMembershipsParams struct {
    // Filter memberships by resource kind.
    Kind *string
    // Maximum number of members to return.
    Limit *int
    // Offset of the first member to return.
    Offset *int
    // Filter memberships by the sandbox status of the resource the membership is in.
    ResourceAttributesSandbox *bool
}

func (*ListMembershipsParams) QueryValues

func (p *ListMembershipsParams) QueryValues() url.Values

QueryValues converts ListMembershipsParams into [url.Values].

type Membership

Membership: A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.

type Membership struct {
    // Object attributes that modifiable only by SumUp applications.
    Attributes *shared.Attributes `json:"attributes,omitempty"`
    // The timestamp of when the membership was created.
    CreatedAt time.Time `json:"created_at"`
    // ID of the membership.
    Id  string `json:"id"`
    // Pending invitation for membership.
    Invite *shared.Invite `json:"invite,omitempty"`
    // Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
    // submit whole metadata.
    Metadata *shared.Metadata `json:"metadata,omitempty"`
    // User's permissions.
    Permissions []string `json:"permissions"`
    // Information about the resource the membership is in.
    Resource MembershipResource `json:"resource"`
    // ID of the resource the membership is in.
    ResourceId string `json:"resource_id"`
    // User's roles.
    Roles []string `json:"roles"`
    // The status of the membership.
    Status shared.MembershipStatus `json:"status"`
    // Type of the resource the membership is in.
    Type MembershipType `json:"type"`
    // The timestamp of when the membership was last updated.
    UpdatedAt time.Time `json:"updated_at"`
}

type MembershipResource

MembershipResource: Information about the resource the membership is in.

type MembershipResource struct {
    // Object attributes that modifiable only by SumUp applications.
    Attributes shared.Attributes `json:"attributes"`
    // The timestamp of when the membership resource was created.
    CreatedAt time.Time `json:"created_at"`
    // ID of the resource the membership is in.
    Id  string `json:"id"`
    // Logo fo the resource.
    // Format: uri
    // Max length: 256
    Logo *string `json:"logo,omitempty"`
    // Display name of the resource.
    Name string                 `json:"name"`
    Type MembershipResourceType `json:"type"`
    // The timestamp of when the membership resource was last updated.
    UpdatedAt time.Time `json:"updated_at"`
}

type MembershipResourceType

MembershipResourceType is a schema definition.

type MembershipResourceType string

const (
    MembershipResourceTypeMerchant MembershipResourceType = "merchant"
)

type MembershipType

MembershipType: Type of the resource the membership is in.

type MembershipType string

const (
    MembershipTypeMerchant MembershipType = "merchant"
)

type MembershipsService

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

func NewMembershipsService

func NewMembershipsService(c *client.Client) *MembershipsService

func (*MembershipsService) List

func (s *MembershipsService) List(ctx context.Context, params ListMembershipsParams) (*ListMemberships200Response, error)

List: List memberships List memberships of the current user.

merchant

import "github.com/sumup/sumup-go/merchant"

Index

type Account

Account: Profile information.

type Account struct {
    // The role of the user.
    Type *AccountType `json:"type,omitempty"`
    // Username of the user profile.
    Username *string `json:"username,omitempty"`
}

type AccountType

AccountType: The role of the user.

type AccountType string

const (
    AccountTypeNormal   AccountType = "normal"
    AccountTypeOperator AccountType = "operator"
)

type AddressWithDetails

AddressWithDetails: Details of the registered address.

type AddressWithDetails struct {
    // Address line 1
    AddressLine1 *string `json:"address_line_1,omitempty"`
    // Address line 2
    AddressLine2 *string `json:"address_line_2,omitempty"`
    // City
    City *string `json:"city,omitempty"`
    // undefined
    Company *string `json:"company,omitempty"`
    // Country ISO 3166-1 code
    Country *string `json:"country,omitempty"`
    // Country Details
    CountryDetails *CountryDetails `json:"country_details,omitempty"`
    // undefined
    FirstName *string `json:"first_name,omitempty"`
    // Landline number
    Landline *string `json:"landline,omitempty"`
    // undefined
    LastName *string `json:"last_name,omitempty"`
    // Postal code
    PostCode *string `json:"post_code,omitempty"`
    // Region code
    RegionCode *string `json:"region_code,omitempty"`
    // Country region id
    RegionId *float64 `json:"region_id,omitempty"`
    // Region name
    RegionName *string `json:"region_name,omitempty"`
    // undefined
    StateId *string `json:"state_id,omitempty"`
    // TimeOffset Details
    TimeoffsetDetails *TimeoffsetDetails `json:"timeoffset_details,omitempty"`
}

type AppSettings

AppSettings: Mobile app settings

type AppSettings struct {
    // Advanced mode.
    AdvancedMode *string `json:"advanced_mode,omitempty"`
    // Barcode scanner.
    BarcodeScanner *string `json:"barcode_scanner,omitempty"`
    // Cash payment.
    CashPayment *string `json:"cash_payment,omitempty"`
    // Checkout preference
    CheckoutPreference *string `json:"checkout_preference,omitempty"`
    // Expected max transaction amount.
    ExpectedMaxTransactionAmount *float64 `json:"expected_max_transaction_amount,omitempty"`
    // Include vat.
    IncludeVat *bool `json:"include_vat,omitempty"`
    // Manual entry.
    ManualEntry *string `json:"manual_entry,omitempty"`
    // Manual entry tutorial.
    ManualEntryTutorial *bool `json:"manual_entry_tutorial,omitempty"`
    // Mobile payment.
    MobilePayment *string `json:"mobile_payment,omitempty"`
    // Mobile payment tutorial.
    MobilePaymentTutorial *bool `json:"mobile_payment_tutorial,omitempty"`
    // Reader payment.
    ReaderPayment *string `json:"reader_payment,omitempty"`
    // Referral.
    Referral *string `json:"referral,omitempty"`
    // Tax enabled.
    TaxEnabled *bool `json:"tax_enabled,omitempty"`
    // Terminal mode tutorial.
    TerminalModeTutorial *bool `json:"terminal_mode_tutorial,omitempty"`
    // Tip rates.
    TipRates *[]float64 `json:"tip_rates,omitempty"`
    // Tipping.
    Tipping *string `json:"tipping,omitempty"`
}

type BankAccount

BankAccount is a schema definition.

type BankAccount struct {
    // Account category - business or personal
    AccountCategory   *string `json:"account_category,omitempty"`
    AccountHolderName *string `json:"account_holder_name,omitempty"`
    // Account number
    AccountNumber *string `json:"account_number,omitempty"`
    // Type of the account
    AccountType *string `json:"account_type,omitempty"`
    // Bank code
    BankCode *string `json:"bank_code,omitempty"`
    // Bank name
    BankName *string `json:"bank_name,omitempty"`
    // Branch code
    BranchCode *string `json:"branch_code,omitempty"`
    // Creation date of the bank account
    CreatedAt *string `json:"created_at,omitempty"`
    // IBAN
    Iban *string `json:"iban,omitempty"`
    // The primary bank account is the one used for payouts
    Primary *bool `json:"primary,omitempty"`
    // Status in the verification process
    Status *string `json:"status,omitempty"`
    // SWIFT code
    Swift *string `json:"swift,omitempty"`
}

type BusinessOwner

BusinessOwner is a schema definition.

type BusinessOwner struct {
    // Date of birth
    DateOfBirth *string `json:"date_of_birth,omitempty"`
    // BO's first name
    FirstName *string `json:"first_name,omitempty"`
    // BO's Landline
    Landline *string `json:"landline,omitempty"`
    // BO's last name of the user
    LastName *string `json:"last_name,omitempty"`
    // Mobile phone number
    MobilePhone *string `json:"mobile_phone,omitempty"`
    // Ownership percentage
    Ownership *float64 `json:"ownership,omitempty"`
}

type BusinessOwners

BusinessOwners: Business owners information.

type BusinessOwners []BusinessOwner

type CountryDetails

CountryDetails: Country Details

type CountryDetails struct {
    // Currency ISO 4217 code
    Currency *string `json:"currency,omitempty"`
    // Country EN name
    EnName *string `json:"en_name,omitempty"`
    // Country ISO code
    IsoCode *string `json:"iso_code,omitempty"`
    // Country native name
    NativeName *string `json:"native_name,omitempty"`
}

type DoingBusinessAs

DoingBusinessAs: Doing Business As information

type DoingBusinessAs struct {
    Address *DoingBusinessAsAddress `json:"address,omitempty"`
    // Doing business as name
    BusinessName *string `json:"business_name,omitempty"`
    // Doing business as company registration number
    CompanyRegistrationNumber *string `json:"company_registration_number,omitempty"`
    // Doing business as email
    Email *string `json:"email,omitempty"`
    // Doing business as VAT ID
    VatId *string `json:"vat_id,omitempty"`
    // Doing business as website
    Website *string `json:"website,omitempty"`
}

type DoingBusinessAsAddress

DoingBusinessAsAddress is a schema definition.

type DoingBusinessAsAddress struct {
    // Address line 1
    AddressLine1 *string `json:"address_line_1,omitempty"`
    // Address line 2
    AddressLine2 *string `json:"address_line_2,omitempty"`
    // City
    City *string `json:"city,omitempty"`
    // Country ISO 3166-1 code
    Country *string `json:"country,omitempty"`
    // Postal code
    PostCode *string `json:"post_code,omitempty"`
    // Country region ID
    RegionId *float64 `json:"region_id,omitempty"`
    // Country region name
    RegionName *string `json:"region_name,omitempty"`
}

type GetAccountParams

GetAccountParams: query parameters for GetAccount

type GetAccountParams struct {
    // A list of additional information you want to receive for the user. By default only personal and merchant profile
    // information will be returned.
    Include *[]string
}

func (*GetAccountParams) QueryValues

func (p *GetAccountParams) QueryValues() url.Values

QueryValues converts GetAccountParams into [url.Values].

type LegalType

LegalType: Id of the legal type of the merchant profile

type LegalType struct {
    // Legal type short description
    Description *string `json:"description,omitempty"`
    // Legal type description
    FullDescription *string `json:"full_description,omitempty"`
    // Unique id
    Id  *float64 `json:"id,omitempty"`
    // Sole trader legal type if true
    SoleTrader *bool `json:"sole_trader,omitempty"`
}

type ListBankAccounts200Response

ListBankAccounts200Response is a schema definition.

type ListBankAccounts200Response []BankAccount

type ListBankAccountsParams

ListBankAccountsParams: query parameters for ListBankAccounts

type ListBankAccountsParams struct {
    // If true only the primary bank account (the one used for payouts) will be returned.
    Primary *bool
}

func (*ListBankAccountsParams) QueryValues

func (p *ListBankAccountsParams) QueryValues() url.Values

QueryValues converts ListBankAccountsParams into [url.Values].

type ListBankAccountsV11200Response

ListBankAccountsV11200Response is a schema definition.

type ListBankAccountsV11200Response []BankAccount

type ListBankAccountsV11Params

ListBankAccountsV11Params: query parameters for ListBankAccountsV11

type ListBankAccountsV11Params struct {
    // If true only the primary bank account (the one used for payouts) will be returned.
    Primary *bool
}

func (*ListBankAccountsV11Params) QueryValues

func (p *ListBankAccountsV11Params) QueryValues() url.Values

QueryValues converts ListBankAccountsV11Params into [url.Values].

type MerchantAccount

MerchantAccount: Details of the merchant account.

type MerchantAccount struct {
    // Profile information.
    Account *Account `json:"account,omitempty"`
    // Mobile app settings
    AppSettings *AppSettings `json:"app_settings,omitempty"`
    // Merchant comes from payleven BR migration
    IsMigratedPaylevenBr *bool `json:"is_migrated_payleven_br,omitempty"`
    // Account's merchant profile
    MerchantProfile *MerchantProfile `json:"merchant_profile,omitempty"`
    // User permissions
    Permissions *shared.Permissions `json:"permissions,omitempty"`
    // Account's personal profile.
    PersonalProfile *PersonalProfile `json:"personal_profile,omitempty"`
}

type MerchantProfile

MerchantProfile: Account's merchant profile

type MerchantProfile struct {
    // Details of the registered address.
    Address      *AddressWithDetails `json:"address,omitempty"`
    BankAccounts *[]BankAccount      `json:"bank_accounts,omitempty"`
    // Business owners information.
    BusinessOwners *BusinessOwners `json:"business_owners,omitempty"`
    // Company name
    CompanyName *string `json:"company_name,omitempty"`
    // Company registration number
    CompanyRegistrationNumber *string `json:"company_registration_number,omitempty"`
    // Merchant country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) (for
    // internal usage only)
    Country *string `json:"country,omitempty"`
    // Doing Business As information
    DoingBusinessAs *DoingBusinessAs `json:"doing_business_as,omitempty"`
    // True if the merchant is extdev
    Extdev *bool `json:"extdev,omitempty"`
    // Id of the legal type of the merchant profile
    LegalType *LegalType `json:"legal_type,omitempty"`
    // Merchant locale (for internal usage only)
    Locale *string `json:"locale,omitempty"`
    // Merchant category code
    MerchantCategoryCode *string `json:"merchant_category_code,omitempty"`
    // Unique identifying code of the merchant profile
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Mobile phone number
    MobilePhone *string `json:"mobile_phone,omitempty"`
    // Nature and purpose of the business
    NatureAndPurpose *string `json:"nature_and_purpose,omitempty"`
    // True if the payout zone of this merchant is migrated
    PayoutZoneMigrated *bool `json:"payout_zone_migrated,omitempty"`
    // Permanent certificate access code (Portugal)
    PermanentCertificateAccessCode *string `json:"permanent_certificate_access_code,omitempty"`
    // Merchant settings (like \"payout_type\", \"payout_period\")
    Settings *MerchantSettings `json:"settings,omitempty"`
    // Vat ID
    VatId *string `json:"vat_id,omitempty"`
    // Merchant VAT rates
    VatRates *VatRates `json:"vat_rates,omitempty"`
    // Website
    Website *string `json:"website,omitempty"`
}

type MerchantService

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

func NewMerchantService

func NewMerchantService(c *client.Client) *MerchantService

func (*MerchantService) Get

func (s *MerchantService) Get(ctx context.Context, params GetAccountParams) (*MerchantAccount, error)

Get: Retrieve a profile Returns user profile information.

func (*MerchantService) GetDoingBusinessAs

func (s *MerchantService) GetDoingBusinessAs(ctx context.Context) (*DoingBusinessAs, error)

GetDoingBusinessAs: Retrieve DBA Retrieves Doing Business As profile.

func (*MerchantService) GetMerchantProfile

func (s *MerchantService) GetMerchantProfile(ctx context.Context) (*MerchantProfile, error)

GetMerchantProfile: Retrieve a merchant profile Retrieves merchant profile data.

func (*MerchantService) GetPersonalProfile

func (s *MerchantService) GetPersonalProfile(ctx context.Context) (*PersonalProfile, error)

GetPersonalProfile: Retrieve a personal profile Retrieves personal profile data.

func (*MerchantService) GetSettings

func (s *MerchantService) GetSettings(ctx context.Context) (*MerchantSettings, error)

GetSettings: Get settings Retrieves merchant settings.

func (*MerchantService) ListBankAccounts

func (s *MerchantService) ListBankAccounts(ctx context.Context, merchantCode string, params ListBankAccountsV11Params) (*ListBankAccountsV11200Response, error)

ListBankAccounts: List bank accounts Retrieves bank accounts of the merchant.

func (*MerchantService) ListBankAccountsDeprecated

func (s *MerchantService) ListBankAccountsDeprecated(ctx context.Context, params ListBankAccountsParams) (*ListBankAccounts200Response, error)

ListBankAccountsDeprecated: List bank accounts Retrieves bank accounts of the merchant. Deprecated: this operation is deprecated

type MerchantSettings

MerchantSettings: Merchant settings (like \"payout_type\", \"payout_period\")

type MerchantSettings struct {
    // Whether merchant will receive daily payout emails
    DailyPayoutEmail *bool `json:"daily_payout_email,omitempty"`
    // Whether merchant has gross settlement enabled
    GrossSettlement *bool `json:"gross_settlement,omitempty"`
    // Whether merchant will receive monthly payout emails
    MonthlyPayoutEmail *bool `json:"monthly_payout_email,omitempty"`
    // Whether merchant can make MOTO payments
    MotoPayment *MerchantSettingsMotoPayment `json:"moto_payment,omitempty"`
    // Payout Instrument
    PayoutInstrument *string `json:"payout_instrument,omitempty"`
    // Whether merchant will receive payouts on demand
    PayoutOnDemand *bool `json:"payout_on_demand,omitempty"`
    // Whether merchant can edit payouts on demand
    PayoutOnDemandAvailable *bool `json:"payout_on_demand_available,omitempty"`
    // Payout frequency
    PayoutPeriod *string `json:"payout_period,omitempty"`
    // Payout type
    PayoutType *string `json:"payout_type,omitempty"`
    // Whether to show printers in mobile app
    PrintersEnabled *bool `json:"printers_enabled,omitempty"`
    // Stone merchant code
    StoneMerchantCode *string `json:"stone_merchant_code,omitempty"`
    // Whether to show tax in receipts (saved per transaction)
    TaxEnabled *bool `json:"tax_enabled,omitempty"`
}

type MerchantSettingsMotoPayment

MerchantSettingsMotoPayment: Whether merchant can make MOTO payments

type MerchantSettingsMotoPayment string

const (
    MerchantSettingsMotoPaymentEnforced    MerchantSettingsMotoPayment = "ENFORCED"
    MerchantSettingsMotoPaymentOff         MerchantSettingsMotoPayment = "OFF"
    MerchantSettingsMotoPaymentOn          MerchantSettingsMotoPayment = "ON"
    MerchantSettingsMotoPaymentUnavailable MerchantSettingsMotoPayment = "UNAVAILABLE"
)

type PersonalProfile

PersonalProfile: Account's personal profile.

type PersonalProfile struct {
    // Details of the registered address.
    Address  *AddressWithDetails `json:"address,omitempty"`
    Complete *bool               `json:"complete,omitempty"`
    // Date of birth
    DateOfBirth *string `json:"date_of_birth,omitempty"`
    // First name of the user
    FirstName *string `json:"first_name,omitempty"`
    // Last name of the user
    LastName *string `json:"last_name,omitempty"`
    // Mobile phone number
    MobilePhone *string `json:"mobile_phone,omitempty"`
}

type TimeoffsetDetails

TimeoffsetDetails: TimeOffset Details

type TimeoffsetDetails struct {
    // Daylight Saving Time
    Dst *bool `json:"dst,omitempty"`
    // UTC offset
    Offset *float64 `json:"offset,omitempty"`
    // Postal code
    PostCode *string `json:"post_code,omitempty"`
}

type VatRates

VatRates: Merchant VAT rates

type VatRates struct {
    // Country ISO code
    Country *string `json:"country,omitempty"`
    // Description
    Description *string `json:"description,omitempty"`
    // Internal ID
    Id  *float64 `json:"id,omitempty"`
    // Ordering
    Ordering *float64 `json:"ordering,omitempty"`
    // Rate
    Rate *float64 `json:"rate,omitempty"`
}

payouts

import "github.com/sumup/sumup-go/payouts"

Index

type FinancialPayout

FinancialPayout is a schema definition.

type FinancialPayout struct {
    Amount   *float64 `json:"amount,omitempty"`
    Currency *string  `json:"currency,omitempty"`
    // Format: date
    Date            *shared.Date           `json:"date,omitempty"`
    Fee             *float64               `json:"fee,omitempty"`
    Id              *int                   `json:"id,omitempty"`
    Reference       *string                `json:"reference,omitempty"`
    Status          *FinancialPayoutStatus `json:"status,omitempty"`
    TransactionCode *string                `json:"transaction_code,omitempty"`
    Type            *FinancialPayoutType   `json:"type,omitempty"`
}

type FinancialPayoutStatus

FinancialPayoutStatus is a schema definition.

type FinancialPayoutStatus string

const (
    FinancialPayoutStatusFailed     FinancialPayoutStatus = "FAILED"
    FinancialPayoutStatusSuccessful FinancialPayoutStatus = "SUCCESSFUL"
)

type FinancialPayoutType

FinancialPayoutType is a schema definition.

type FinancialPayoutType string

const (
    FinancialPayoutTypeBalanceDeduction    FinancialPayoutType = "BALANCE_DEDUCTION"
    FinancialPayoutTypeChargeBackDeduction FinancialPayoutType = "CHARGE_BACK_DEDUCTION"
    FinancialPayoutTypeDdReturnDeduction   FinancialPayoutType = "DD_RETURN_DEDUCTION"
    FinancialPayoutTypePayout              FinancialPayoutType = "PAYOUT"
    FinancialPayoutTypeRefundDeduction     FinancialPayoutType = "REFUND_DEDUCTION"
)

type FinancialPayouts

FinancialPayouts is a schema definition.

type FinancialPayouts []FinancialPayout

type ListPayoutsParams

ListPayoutsParams: query parameters for ListPayouts

type ListPayoutsParams struct {
    // End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    EndDate shared.Date
    Format  *string
    Limit   *int
    Order   *string
    // Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    StartDate shared.Date
}

func (*ListPayoutsParams) QueryValues

func (p *ListPayoutsParams) QueryValues() url.Values

QueryValues converts ListPayoutsParams into [url.Values].

type ListPayoutsV1Params

ListPayoutsV1Params: query parameters for ListPayoutsV1

type ListPayoutsV1Params struct {
    // End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    EndDate shared.Date
    Format  *string
    Limit   *int
    Order   *string
    // Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    StartDate shared.Date
}

func (*ListPayoutsV1Params) QueryValues

func (p *ListPayoutsV1Params) QueryValues() url.Values

QueryValues converts ListPayoutsV1Params into [url.Values].

type PayoutsService

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

func NewPayoutsService

func NewPayoutsService(c *client.Client) *PayoutsService

func (*PayoutsService) List

func (s *PayoutsService) List(ctx context.Context, merchantCode string, params ListPayoutsV1Params) (*FinancialPayouts, error)

List: List payouts Lists ordered payouts for the merchant profile.

func (*PayoutsService) ListDeprecated

func (s *PayoutsService) ListDeprecated(ctx context.Context, params ListPayoutsParams) (*FinancialPayouts, error)

ListDeprecated: List payouts Lists ordered payouts for the merchant profile. Deprecated: this operation is deprecated

readers

import "github.com/sumup/sumup-go/readers"

Index

type Affiliate

Affiliate: Affiliate metadata for the transaction. It is an optional field that allow for integrators to track the source of the transaction.

type Affiliate struct {
    // Application ID of the affiliate.
    // It is a unique identifier for the application and should be set by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.
    AppId string `json:"app_id"`
    // Foreign transaction ID of the affiliate.
    // It is a unique identifier for the transaction.
    // It can be used later to fetch the transaction details via the [Transactions API](https://developer.sumup.com/api/transactions/get).
    ForeignTransactionId string `json:"foreign_transaction_id"`
    // Key of the affiliate.
    // It is a unique identifier for the key  and should be generated by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.
    //
    // Format: uuid
    Key string `json:"key"`
    // Additional metadata for the transaction.
    // It is key-value object that can be associated with the transaction.
    Tags *AffiliateTags `json:"tags,omitempty"`
}

type AffiliateTags

AffiliateTags: Additional metadata for the transaction. It is key-value object that can be associated with the transaction.

type AffiliateTags map[string]any

type CreateReaderBody

CreateReaderBody is a schema definition.

type CreateReaderBody struct {
    // Set of user-defined key-value pairs attached to the object.
    // Max properties: 50
    Meta *Meta `json:"meta,omitempty"`
    // Custom human-readable, user-defined name for easier identification of the reader.
    // Max length: 500
    Name *ReaderName `json:"name,omitempty"`
    // The pairing code is a 8 or 9 character alphanumeric string that is displayed on a SumUp Device after initiating
    // the pairing. It is used to link the physical device to the created pairing.
    // Min length: 8
    // Max length: 9
    PairingCode ReaderPairingCode `json:"pairing_code"`
}

type CreateReaderCheckout

CreateReaderCheckout: Reader Checkout

type CreateReaderCheckout struct {
    // Affiliate metadata for the transaction.
    // It is an optional field that allow for integrators to track the source of the transaction.
    Affiliate *Affiliate `json:"affiliate,omitempty"`
    // The card type of the card used for the transaction.
    // Is is required only for some countries (e.g: Brazil).
    CardType *CreateReaderCheckoutCardType `json:"card_type,omitempty"`
    // Description of the checkout to be shown in the Merchant Sales
    Description *string `json:"description,omitempty"`
    // Number of installments for the transaction.
    // It may vary according to the merchant country.
    // For example, in Brazil, the maximum number of installments is 12.
    Installments *int `json:"installments,omitempty"`
    // Webhook URL to which the payment result will be sent.
    // It must be a HTTPS url.
    // Format: uri
    ReturnUrl *string `json:"return_url,omitempty"`
    // List of tipping rates to be displayed to the cardholder.
    // The rates are in percentage and should be between 0.01 and 0.99.
    // The list should be sorted in ascending order.
    TipRates *[]float64 `json:"tip_rates,omitempty"`
    // Amount of the transaction.
    // The amount is represented as an integer value altogether with the currency and the minor unit.
    // For example, EUR 1.00 is represented as value 100 with minor unit of 2.
    TotalAmount CreateReaderCheckoutAmount `json:"total_amount"`
}

type CreateReaderCheckout201Response

CreateReaderCheckout201Response is a schema definition.

type CreateReaderCheckout201Response struct {
    Data *CreateReaderCheckout201ResponseData `json:"data,omitempty"`
}

type CreateReaderCheckout201ResponseData

CreateReaderCheckout201ResponseData is a schema definition.

type CreateReaderCheckout201ResponseData struct {
    // The client transaction ID is a unique identifier for the transaction that is generated for the client.
    // It can be used later to fetch the transaction details via the [Transactions API](https://developer.sumup.com/api/transactions/get).
    // Format: uuid
    ClientTransactionId *string `json:"client_transaction_id,omitempty"`
}

type CreateReaderCheckout400Response

CreateReaderCheckout400Response is a schema definition.

type CreateReaderCheckout400Response struct {
    Errors *CreateReaderCheckout400ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderCheckout400Response) Error

func (e *CreateReaderCheckout400Response) Error() string

type CreateReaderCheckout400ResponseErrors

CreateReaderCheckout400ResponseErrors is a schema definition.

type CreateReaderCheckout400ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type CreateReaderCheckout422Response

CreateReaderCheckout422Response is a schema definition.

type CreateReaderCheckout422Response struct {
    Errors *CreateReaderCheckout422ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderCheckout422Response) Error

func (e *CreateReaderCheckout422Response) Error() string

type CreateReaderCheckout422ResponseErrors

CreateReaderCheckout422ResponseErrors is a schema definition.

type CreateReaderCheckout422ResponseErrors map[string]any

type CreateReaderCheckout500Response

CreateReaderCheckout500Response is a schema definition.

type CreateReaderCheckout500Response struct {
    Errors *CreateReaderCheckout500ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderCheckout500Response) Error

func (e *CreateReaderCheckout500Response) Error() string

type CreateReaderCheckout500ResponseErrors

CreateReaderCheckout500ResponseErrors is a schema definition.

type CreateReaderCheckout500ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type CreateReaderCheckout502Response

CreateReaderCheckout502Response is a schema definition.

type CreateReaderCheckout502Response struct {
    Errors *CreateReaderCheckout502ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderCheckout502Response) Error

func (e *CreateReaderCheckout502Response) Error() string

type CreateReaderCheckout502ResponseErrors

CreateReaderCheckout502ResponseErrors is a schema definition.

type CreateReaderCheckout502ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type CreateReaderCheckout504Response

CreateReaderCheckout504Response is a schema definition.

type CreateReaderCheckout504Response struct {
    Errors *CreateReaderCheckout504ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderCheckout504Response) Error

func (e *CreateReaderCheckout504Response) Error() string

type CreateReaderCheckout504ResponseErrors

CreateReaderCheckout504ResponseErrors is a schema definition.

type CreateReaderCheckout504ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type CreateReaderCheckoutAmount

CreateReaderCheckoutAmount: Amount of the transaction. The amount is represented as an integer value altogether with the currency and the minor unit. For example, EUR 1.00 is represented as value 100 with minor unit of 2.

type CreateReaderCheckoutAmount struct {
    // Currency ISO 4217 code
    Currency string `json:"currency"`
    // The minor units of the currency. It represents the number of decimals of the currency.
    // For the currencies CLP, COP and HUF, the minor unit is 0.
    MinorUnit int `json:"minor_unit"`
    // Total amount of the transaction.
    // It must be a positive integer.
    Value int `json:"value"`
}

type CreateReaderCheckoutBody

CreateReaderCheckoutBody: Reader Checkout

type CreateReaderCheckoutBody struct {
    // Affiliate metadata for the transaction.
    // It is an optional field that allow for integrators to track the source of the transaction.
    Affiliate *Affiliate `json:"affiliate,omitempty"`
    // The card type of the card used for the transaction.
    // Is is required only for some countries (e.g: Brazil).
    CardType *CreateReaderCheckoutBodyCardType `json:"card_type,omitempty"`
    // Description of the checkout to be shown in the Merchant Sales
    Description *string `json:"description,omitempty"`
    // Number of installments for the transaction.
    // It may vary according to the merchant country.
    // For example, in Brazil, the maximum number of installments is 12.
    Installments *int `json:"installments,omitempty"`
    // Webhook URL to which the payment result will be sent.
    // It must be a HTTPS url.
    // Format: uri
    ReturnUrl *string `json:"return_url,omitempty"`
    // List of tipping rates to be displayed to the cardholder.
    // The rates are in percentage and should be between 0.01 and 0.99.
    // The list should be sorted in ascending order.
    TipRates *[]float64 `json:"tip_rates,omitempty"`
    // Amount of the transaction.
    // The amount is represented as an integer value altogether with the currency and the minor unit.
    // For example, EUR 1.00 is represented as value 100 with minor unit of 2.
    TotalAmount CreateReaderCheckoutAmount `json:"total_amount"`
}

type CreateReaderCheckoutBodyCardType

CreateReaderCheckoutBodyCardType: The card type of the card used for the transaction. Is is required only for some countries (e.g: Brazil).

type CreateReaderCheckoutBodyCardType string

const (
    CreateReaderCheckoutBodyCardTypeCredit CreateReaderCheckoutBodyCardType = "credit"
    CreateReaderCheckoutBodyCardTypeDebit  CreateReaderCheckoutBodyCardType = "debit"
)

type CreateReaderCheckoutCardType

CreateReaderCheckoutCardType: The card type of the card used for the transaction. Is is required only for some countries (e.g: Brazil).

type CreateReaderCheckoutCardType string

const (
    CreateReaderCheckoutCardTypeCredit CreateReaderCheckoutCardType = "credit"
    CreateReaderCheckoutCardTypeDebit  CreateReaderCheckoutCardType = "debit"
)

type CreateReaderTerminate422Response

CreateReaderTerminate422Response is a schema definition.

type CreateReaderTerminate422Response struct {
    Errors *CreateReaderTerminate422ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderTerminate422Response) Error

func (e *CreateReaderTerminate422Response) Error() string

type CreateReaderTerminate422ResponseErrors

CreateReaderTerminate422ResponseErrors is a schema definition.

type CreateReaderTerminate422ResponseErrors map[string]any

type CreateReaderTerminate500Response

CreateReaderTerminate500Response is a schema definition.

type CreateReaderTerminate500Response struct {
    Errors *CreateReaderTerminate500ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderTerminate500Response) Error

func (e *CreateReaderTerminate500Response) Error() string

type CreateReaderTerminate500ResponseErrors

CreateReaderTerminate500ResponseErrors is a schema definition.

type CreateReaderTerminate500ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type CreateReaderTerminate502Response

CreateReaderTerminate502Response is a schema definition.

type CreateReaderTerminate502Response struct {
    Errors *CreateReaderTerminate502ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderTerminate502Response) Error

func (e *CreateReaderTerminate502Response) Error() string

type CreateReaderTerminate502ResponseErrors

CreateReaderTerminate502ResponseErrors is a schema definition.

type CreateReaderTerminate502ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type CreateReaderTerminate504Response

CreateReaderTerminate504Response is a schema definition.

type CreateReaderTerminate504Response struct {
    Errors *CreateReaderTerminate504ResponseErrors `json:"errors,omitempty"`
}

func (*CreateReaderTerminate504Response) Error

func (e *CreateReaderTerminate504Response) Error() string

type CreateReaderTerminate504ResponseErrors

CreateReaderTerminate504ResponseErrors is a schema definition.

type CreateReaderTerminate504ResponseErrors struct {
    Detail *string `json:"detail,omitempty"`
}

type GetReaderParams

GetReaderParams: query parameters for GetReader

type GetReaderParams struct {
    // Return the reader only if it has been modified after the specified timestamp given in the headers.
    //
    // Timestamps are accepted in the following formats:
    //
    //  - HTTP Standard: [IMF format (RFC 5322)](https://www.rfc-editor.org/rfc/rfc5322#section-3.3), sometimes also
    // referred to as [RFC 7231](https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1).
    //  - RFC 3339: Used for timestamps in JSON payloads on this API.
    IfModifiedSince *string
}

func (*GetReaderParams) QueryValues

func (p *GetReaderParams) QueryValues() url.Values

QueryValues converts GetReaderParams into [url.Values].

type ListReaders200Response

ListReaders200Response is a schema definition.

type ListReaders200Response struct {
    Items []Reader `json:"items"`
}

type Meta

Meta: Set of user-defined key-value pairs attached to the object. Max properties: 50

type Meta map[string]any

type Reader

Reader: A physical card reader device that can accept in-person payments.

type Reader struct {
    // The timestamp of when the reader was created.
    CreatedAt time.Time `json:"created_at"`
    // Information about the underlying physical device.
    Device ReaderDevice `json:"device"`
    // Unique identifier of the object.
    // Note that this identifies the instance of the physical devices pairing with your SumUp account.
    // If you DELETE a reader, and pair the device again, the ID will be different. Do not use this ID to refer to
    // a physical device.
    // Min length: 30
    // Max length: 30
    Id  ReaderId `json:"id"`
    // Set of user-defined key-value pairs attached to the object.
    // Max properties: 50
    Meta *Meta `json:"meta,omitempty"`
    // Custom human-readable, user-defined name for easier identification of the reader.
    // Max length: 500
    Name ReaderName `json:"name"`
    // The status of the reader object gives information about the current state of the reader.
    //
    // Possible values:
    //
    // - `unknown` - The reader status is unknown.
    // - `processing` - The reader is created and waits for the physical device to confirm the pairing.
    // - `paired` - The reader is paired with a merchant account and can be used with SumUp APIs.
    // - `expired` - The pairing is expired and no longer usable with the account. The resource needs to get recreated
    Status ReaderStatus `json:"status"`
    // The timestamp of when the reader was last updated.
    UpdatedAt time.Time `json:"updated_at"`
}

type ReaderDevice

ReaderDevice: Information about the underlying physical device.

type ReaderDevice struct {
    // A unique identifier of the physical device (e.g. serial number).
    Identifier string `json:"identifier"`
    // Identifier of the model of the device.
    Model ReaderDeviceModel `json:"model"`
}

type ReaderDeviceModel

ReaderDeviceModel: Identifier of the model of the device.

type ReaderDeviceModel string

const (
    ReaderDeviceModelSolo        ReaderDeviceModel = "solo"
    ReaderDeviceModelVirtualSolo ReaderDeviceModel = "virtual-solo"
)

type ReaderId

ReaderId: Unique identifier of the object. Note that this identifies the instance of the physical devices pairing with your SumUp account. If you DELETE a reader, and pair the device again, the ID will be different. Do not use this ID to refer to a physical device. Min length: 30 Max length: 30

type ReaderId string

type ReaderName

ReaderName: Custom human-readable, user-defined name for easier identification of the reader. Max length: 500

type ReaderName string

type ReaderPairingCode

ReaderPairingCode: The pairing code is a 8 or 9 character alphanumeric string that is displayed on a SumUp Device after initiating the pairing. It is used to link the physical device to the created pairing. Min length: 8 Max length: 9

type ReaderPairingCode string

type ReaderStatus

ReaderStatus: The status of the reader object gives information about the current state of the reader.

Possible values:

- `unknown` - The reader status is unknown. - `processing` - The reader is created and waits for the physical device to confirm the pairing. - `paired` - The reader is paired with a merchant account and can be used with SumUp APIs. - `expired` - The pairing is expired and no longer usable with the account. The resource needs to get recreated

type ReaderStatus string

const (
    ReaderStatusExpired    ReaderStatus = "expired"
    ReaderStatusPaired     ReaderStatus = "paired"
    ReaderStatusProcessing ReaderStatus = "processing"
    ReaderStatusUnknown    ReaderStatus = "unknown"
)

type ReadersService

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

func NewReadersService

func NewReadersService(c *client.Client) *ReadersService

func (*ReadersService) Create

func (s *ReadersService) Create(ctx context.Context, merchantCode string, body CreateReaderBody) (*Reader, error)

Create: Create a Reader Create a new Reader for the merchant account.

func (*ReadersService) CreateCheckout

func (s *ReadersService) CreateCheckout(ctx context.Context, merchantCode string, id string, body CreateReaderCheckoutBody) (*CreateReaderCheckout201Response, error)

CreateCheckout: Create a Reader Checkout Create a Checkout for a Reader.

This process is asynchronous and the actual transaction may take some time to be stared on the device.

There are some caveats when using this endpoint: * The target device must be online, otherwise checkout won't be accepted * After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.

**Note**: If the target device is a Solo, it must be in version 3.3.24.3 or higher.

func (*ReadersService) DeleteReader

func (s *ReadersService) DeleteReader(ctx context.Context, merchantCode string, id ReaderId) error

DeleteReader: Delete a reader Delete a reader.

func (*ReadersService) Get

func (s *ReadersService) Get(ctx context.Context, merchantCode string, id ReaderId, params GetReaderParams) (*Reader, error)

Get: Retrieve a Reader Retrieve a Reader.

func (*ReadersService) List

func (s *ReadersService) List(ctx context.Context, merchantCode string) (*ListReaders200Response, error)

List: List Readers List all readers of the merchant.

func (*ReadersService) TerminateCheckout

func (s *ReadersService) TerminateCheckout(ctx context.Context, merchantCode string, id string) error

TerminateCheckout: Create a Reader Terminate action Create a Terminate action for a Reader.

It stops the current transaction on the target device.

This process is asynchronous and the actual termination may take some time to be performed on the device.

There are some caveats when using this endpoint: * The target device must be online, otherwise terminate won't be accepted * The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of the termination.

If a transaction is successfully terminated and `return_url` was provided on Checkout, the transaction status will be sent as `failed` to the provided URL.

**Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.

func (*ReadersService) Update

func (s *ReadersService) Update(ctx context.Context, merchantCode string, id ReaderId, body UpdateReaderBody) error

Update: Update a Reader Update a Reader.

type UpdateReaderBody

UpdateReaderBody is a schema definition.

type UpdateReaderBody struct {
    // Set of user-defined key-value pairs attached to the object.
    // Max properties: 50
    Meta *Meta `json:"meta,omitempty"`
    // Custom human-readable, user-defined name for easier identification of the reader.
    // Max length: 500
    Name *ReaderName `json:"name,omitempty"`
}

receipts

import "github.com/sumup/sumup-go/receipts"

Index

type GetReceiptParams

GetReceiptParams: query parameters for GetReceipt

type GetReceiptParams struct {
    // Merchant code.
    Mid string
    // The ID of the transaction event (refund).
    TxEventId *int
}

func (*GetReceiptParams) QueryValues

func (p *GetReceiptParams) QueryValues() url.Values

QueryValues converts GetReceiptParams into [url.Values].

type Receipt

Receipt is a schema definition.

type Receipt struct {
    AcquirerData *ReceiptAcquirerData `json:"acquirer_data,omitempty"`
    EmvData      *ReceiptEmvData      `json:"emv_data,omitempty"`
    // Receipt merchant data
    MerchantData *ReceiptMerchantData `json:"merchant_data,omitempty"`
    // Transaction information.
    TransactionData *ReceiptTransaction `json:"transaction_data,omitempty"`
}

type ReceiptAcquirerData

ReceiptAcquirerData is a schema definition.

type ReceiptAcquirerData struct {
    AuthorizationCode *string `json:"authorization_code,omitempty"`
    LocalTime         *string `json:"local_time,omitempty"`
    ReturnCode        *string `json:"return_code,omitempty"`
    Tid               *string `json:"tid,omitempty"`
}

type ReceiptCard

ReceiptCard is a schema definition.

type ReceiptCard struct {
    // Card last 4 digits.
    Last4Digits *string `json:"last_4_digits,omitempty"`
    // Card Scheme.
    Type *string `json:"type,omitempty"`
}

type ReceiptEmvData

ReceiptEmvData is a schema definition.

type ReceiptEmvData struct {
}

type ReceiptEvent

ReceiptEvent is a schema definition.

type ReceiptEvent struct {
    // Amount of the event.
    Amount *shared.AmountEvent `json:"amount,omitempty"`
    // Unique ID of the transaction event.
    // Format: int64
    Id        *shared.EventId `json:"id,omitempty"`
    ReceiptNo *string         `json:"receipt_no,omitempty"`
    // Status of the transaction event.
    Status *shared.EventStatus `json:"status,omitempty"`
    // Date and time of the transaction event.
    Timestamp *shared.TimestampEvent `json:"timestamp,omitempty"`
    // Unique ID of the transaction.
    TransactionId *shared.TransactionId `json:"transaction_id,omitempty"`
    // Type of the transaction event.
    Type *shared.EventType `json:"type,omitempty"`
}

type ReceiptMerchantData

ReceiptMerchantData: Receipt merchant data

type ReceiptMerchantData struct {
    Locale          *string                             `json:"locale,omitempty"`
    MerchantProfile *ReceiptMerchantDataMerchantProfile `json:"merchant_profile,omitempty"`
}

type ReceiptMerchantDataMerchantProfile

ReceiptMerchantDataMerchantProfile is a schema definition.

type ReceiptMerchantDataMerchantProfile struct {
    Address      *ReceiptMerchantDataMerchantProfileAddress `json:"address,omitempty"`
    BusinessName *string                                    `json:"business_name,omitempty"`
    Email        *string                                    `json:"email,omitempty"`
    MerchantCode *string                                    `json:"merchant_code,omitempty"`
}

type ReceiptMerchantDataMerchantProfileAddress

ReceiptMerchantDataMerchantProfileAddress is a schema definition.

type ReceiptMerchantDataMerchantProfileAddress struct {
    AddressLine1      *string `json:"address_line_1,omitempty"`
    City              *string `json:"city,omitempty"`
    Country           *string `json:"country,omitempty"`
    CountryEnName     *string `json:"country_en_name,omitempty"`
    CountryNativeName *string `json:"country_native_name,omitempty"`
    Landline          *string `json:"landline,omitempty"`
    PostCode          *string `json:"post_code,omitempty"`
}

type ReceiptTransaction

ReceiptTransaction: Transaction information.

type ReceiptTransaction struct {
    // Transaction amount.
    Amount *string      `json:"amount,omitempty"`
    Card   *ReceiptCard `json:"card,omitempty"`
    // Transaction currency.
    Currency *string `json:"currency,omitempty"`
    // Transaction entry mode.
    EntryMode *string `json:"entry_mode,omitempty"`
    // Events
    Events *[]ReceiptEvent `json:"events,omitempty"`
    // Number of installments.
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Transaction type.
    PaymentType *string `json:"payment_type,omitempty"`
    // Products
    Products *[]ReceiptTransactionProduct `json:"products,omitempty"`
    // Receipt number
    ReceiptNo *string `json:"receipt_no,omitempty"`
    // Transaction processing status.
    Status *string `json:"status,omitempty"`
    // Time created at.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Tip amount (included in transaction amount).
    TipAmount *string `json:"tip_amount,omitempty"`
    // Transaction code.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Transaction VAT amount.
    VatAmount *string `json:"vat_amount,omitempty"`
    // Vat rates.
    VatRates *[]ReceiptTransactionVatRate `json:"vat_rates,omitempty"`
    // Cardholder verification method.
    VerificationMethod *string `json:"verification_method,omitempty"`
}

type ReceiptTransactionProduct

ReceiptTransactionProduct is a schema definition.

type ReceiptTransactionProduct struct {
    // Product description.
    Description *string `json:"description,omitempty"`
    // Product name.
    Name *string `json:"name,omitempty"`
    // Product price.
    Price *float64 `json:"price,omitempty"`
    // Product quantity.
    Quantity *int `json:"quantity,omitempty"`
    // Quantity x product price.
    TotalPrice *float64 `json:"total_price,omitempty"`
}

type ReceiptTransactionVatRate

ReceiptTransactionVatRate is a schema definition.

type ReceiptTransactionVatRate struct {
    // Gross
    Gross *float64 `json:"gross,omitempty"`
    // Net
    Net *float64 `json:"net,omitempty"`
    // Rate
    Rate *float64 `json:"rate,omitempty"`
    // Vat
    Vat *float64 `json:"vat,omitempty"`
}

type ReceiptsService

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

func NewReceiptsService

func NewReceiptsService(c *client.Client) *ReceiptsService

func (*ReceiptsService) Get

func (s *ReceiptsService) Get(ctx context.Context, id string, params GetReceiptParams) (*Receipt, error)

Get: Retrieve receipt details Retrieves receipt specific data for a transaction.

roles

import "github.com/sumup/sumup-go/roles"

Index

type CreateMerchantRoleBody

CreateMerchantRoleBody is a schema definition.

type CreateMerchantRoleBody struct {
    // User-defined description of the role.
    Description *string `json:"description,omitempty"`
    // Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
    // submit whole metadata.
    Metadata *shared.Metadata `json:"metadata,omitempty"`
    // User-defined name of the role.
    Name string `json:"name"`
    // User's permissions.
    // Max items: 100
    Permissions []string `json:"permissions"`
}

type ListMerchantRoles200Response

ListMerchantRoles200Response is a schema definition.

type ListMerchantRoles200Response struct {
    Items []Role `json:"items"`
}

type Role

Role: A custom role that can be used to assign set of permissions to members.

type Role struct {
    // The timestamp of when the role was created.
    CreatedAt time.Time `json:"created_at"`
    // User-defined description of the role.
    Description *string `json:"description,omitempty"`
    // Unique identifier of the role.
    Id  string `json:"id"`
    // True if the role is provided by SumUp.
    IsPredefined bool `json:"is_predefined"`
    // Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
    // submit whole metadata.
    Metadata *shared.Metadata `json:"metadata,omitempty"`
    // User-defined name of the role.
    Name string `json:"name"`
    // List of permission granted by this role.
    // Max items: 100
    Permissions []string `json:"permissions"`
    // The timestamp of when the role was last updated.
    UpdatedAt time.Time `json:"updated_at"`
}

type RolesService

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

func NewRolesService

func NewRolesService(c *client.Client) *RolesService

func (*RolesService) Create

func (s *RolesService) Create(ctx context.Context, merchantCode string, body CreateMerchantRoleBody) (*Role, error)

Create: Create a role Create a custom role for the merchant. Roles are defined by the set of permissions that they grant to the members that they are assigned to.

func (*RolesService) Delete

func (s *RolesService) Delete(ctx context.Context, merchantCode string, roleId string) error

Delete: Delete a role Delete a custom role.

func (*RolesService) Get

func (s *RolesService) Get(ctx context.Context, merchantCode string, roleId string) (*Role, error)

Get: Retrieve a role Retrieve a custom role by ID.

func (*RolesService) List

func (s *RolesService) List(ctx context.Context, merchantCode string) (*ListMerchantRoles200Response, error)

List: List roles List merchant's custom roles.

func (*RolesService) Update

func (s *RolesService) Update(ctx context.Context, merchantCode string, roleId string, body UpdateMerchantRoleBody) (*Role, error)

Update: Update a role Update a custom role.

type UpdateMerchantRoleBody

UpdateMerchantRoleBody is a schema definition.

type UpdateMerchantRoleBody struct {
    // User-defined description of the role.
    Description *string `json:"description,omitempty"`
    // User-defined name of the role.
    Name *string `json:"name,omitempty"`
    // User's permissions.
    // Max items: 100
    Permissions *[]string `json:"permissions,omitempty"`
}

shared

import "github.com/sumup/sumup-go/shared"

Index

type Address

Address: Profile's personal address information.

type Address struct {
    // City name from the address.
    City *string `json:"city,omitempty"`
    // Two letter country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
    Country *string `json:"country,omitempty"`
    // First line of the address with details of the street name and number.
    Line1 *string `json:"line_1,omitempty"`
    // Second line of the address with details of the building, unit, apartment, and floor numbers.
    Line2 *string `json:"line_2,omitempty"`
    // Postal code from the address.
    PostalCode *string `json:"postal_code,omitempty"`
    // State name or abbreviation from the address.
    State *string `json:"state,omitempty"`
}

type AmountEvent

AmountEvent: Amount of the event.

type AmountEvent float64

type Attributes

Attributes: Object attributes that modifiable only by SumUp applications.

type Attributes map[string]any

type Currency

Currency: Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217\) code of the currency for the amount. Currently supported currency values are enumerated above.

type Currency string

const (
    CurrencyBgn Currency = "BGN"
    CurrencyBrl Currency = "BRL"
    CurrencyChf Currency = "CHF"
    CurrencyClp Currency = "CLP"
    CurrencyCzk Currency = "CZK"
    CurrencyDkk Currency = "DKK"
    CurrencyEur Currency = "EUR"
    CurrencyGbp Currency = "GBP"
    CurrencyHrk Currency = "HRK"
    CurrencyHuf Currency = "HUF"
    CurrencyNok Currency = "NOK"
    CurrencyPln Currency = "PLN"
    CurrencyRon Currency = "RON"
    CurrencySek Currency = "SEK"
    CurrencyUsd Currency = "USD"
)

type Date

type Date struct{ time.Time }

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) (err error)

type Error

Error: Error message structure.

type Error struct {
    // Platform code for the error.
    ErrorCode *string `json:"error_code,omitempty"`
    // Short description of the error.
    Message *string `json:"message,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

type ErrorForbidden

ErrorForbidden: Error message for forbidden requests.

type ErrorForbidden struct {
    // Platform code for the error.
    ErrorCode *string `json:"error_code,omitempty"`
    // Short description of the error.
    ErrorMessage *string `json:"error_message,omitempty"`
    // HTTP status code for the error.
    StatusCode *string `json:"status_code,omitempty"`
}

func (*ErrorForbidden) Error

func (e *ErrorForbidden) Error() string

type EventId

EventId: Unique ID of the transaction event. Format: int64

type EventId int64

type EventStatus

EventStatus: Status of the transaction event.

type EventStatus string

const (
    EventStatusFailed     EventStatus = "FAILED"
    EventStatusPaidOut    EventStatus = "PAID_OUT"
    EventStatusPending    EventStatus = "PENDING"
    EventStatusRefunded   EventStatus = "REFUNDED"
    EventStatusScheduled  EventStatus = "SCHEDULED"
    EventStatusSuccessful EventStatus = "SUCCESSFUL"
)

type EventType

EventType: Type of the transaction event.

type EventType string

const (
    EventTypeChargeBack      EventType = "CHARGE_BACK"
    EventTypePayout          EventType = "PAYOUT"
    EventTypePayoutDeduction EventType = "PAYOUT_DEDUCTION"
    EventTypeRefund          EventType = "REFUND"
)

type Invite

Invite: Pending invitation for membership.

type Invite struct {
    // Email address of the invited user.
    // Format: email
    Email     string    `json:"email"`
    ExpiresAt time.Time `json:"expires_at"`
}

type MandateResponse

MandateResponse: Created mandate

type MandateResponse struct {
    // Merchant code which has the mandate
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Mandate status
    Status *string `json:"status,omitempty"`
    // Indicates the mandate type
    Type *string `json:"type,omitempty"`
}

type MembershipStatus

MembershipStatus: The status of the membership.

type MembershipStatus string

const (
    MembershipStatusAccepted MembershipStatus = "accepted"
    MembershipStatusDisabled MembershipStatus = "disabled"
    MembershipStatusExpired  MembershipStatus = "expired"
    MembershipStatusPending  MembershipStatus = "pending"
    MembershipStatusUnknown  MembershipStatus = "unknown"
)

type Metadata

Metadata: Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata.

type Metadata map[string]any

type Permissions

Permissions: User permissions

type Permissions struct {
    // Create MOTO payments
    CreateMotoPayments *bool `json:"create_moto_payments,omitempty"`
    // Create referral
    CreateReferral *bool `json:"create_referral,omitempty"`
    // Can view full merchant transaction history
    FullTransactionHistoryView *bool `json:"full_transaction_history_view,omitempty"`
    // Refund transactions
    RefundTransactions *bool `json:"refund_transactions,omitempty"`
}

type PersonalDetails

PersonalDetails: Personal details for the customer.

type PersonalDetails struct {
    // Profile's personal address information.
    Address *Address `json:"address,omitempty"`
    // Date of birth of the customer.
    // Format: date
    BirthDate *Date `json:"birth_date,omitempty"`
    // Email address of the customer.
    Email *string `json:"email,omitempty"`
    // First name of the customer.
    FirstName *string `json:"first_name,omitempty"`
    // Last name of the customer.
    LastName *string `json:"last_name,omitempty"`
    // Phone number of the customer.
    Phone *string `json:"phone,omitempty"`
    // An identification number user for tax purposes (e.g. CPF)
    // Max length: 255
    TaxId *string `json:"tax_id,omitempty"`
}

type Time

type Time struct{ time.Time }

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) (err error)

type TimestampEvent

TimestampEvent: Date and time of the transaction event.

type TimestampEvent string

type TransactionId

TransactionId: Unique ID of the transaction.

type TransactionId string

type TransactionMixinBase

TransactionMixinBase: Details of the transaction.

type TransactionMixinBase struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *Currency `json:"currency,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Payment type used for the transaction.
    PaymentType *TransactionMixinBasePaymentType `json:"payment_type,omitempty"`
    // Current status of the transaction.
    Status *TransactionMixinBaseStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
}

type TransactionMixinBasePaymentType

TransactionMixinBasePaymentType: Payment type used for the transaction.

type TransactionMixinBasePaymentType string

const (
    TransactionMixinBasePaymentTypeBoleto    TransactionMixinBasePaymentType = "BOLETO"
    TransactionMixinBasePaymentTypeEcom      TransactionMixinBasePaymentType = "ECOM"
    TransactionMixinBasePaymentTypeRecurring TransactionMixinBasePaymentType = "RECURRING"
)

type TransactionMixinBaseStatus

TransactionMixinBaseStatus: Current status of the transaction.

type TransactionMixinBaseStatus string

const (
    TransactionMixinBaseStatusCancelled  TransactionMixinBaseStatus = "CANCELLED"
    TransactionMixinBaseStatusFailed     TransactionMixinBaseStatus = "FAILED"
    TransactionMixinBaseStatusPending    TransactionMixinBaseStatus = "PENDING"
    TransactionMixinBaseStatusSuccessful TransactionMixinBaseStatus = "SUCCESSFUL"
)

type TransactionMixinCheckout

TransactionMixinCheckout is a schema definition.

type TransactionMixinCheckout struct {
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Entry mode of the payment details.
    EntryMode *TransactionMixinCheckoutEntryMode `json:"entry_mode,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
}

type TransactionMixinCheckoutEntryMode

TransactionMixinCheckoutEntryMode: Entry mode of the payment details.

type TransactionMixinCheckoutEntryMode string

const (
    TransactionMixinCheckoutEntryModeBoleto        TransactionMixinCheckoutEntryMode = "BOLETO"
    TransactionMixinCheckoutEntryModeCustomerEntry TransactionMixinCheckoutEntryMode = "CUSTOMER_ENTRY"
)

subaccounts

import "github.com/sumup/sumup-go/subaccounts"

Index

type CompatError

CompatError: Error

type CompatError struct {
    ErrorCode string `json:"error_code"`
    Message   string `json:"message"`
}

func (*CompatError) Error

func (e *CompatError) Error() string

type CreateSubAccountBody

CreateSubAccountBody is a schema definition.

type CreateSubAccountBody struct {
    Nickname *string `json:"nickname,omitempty"`
    // Min length: 8
    Password    string                           `json:"password"`
    Permissions *CreateSubAccountBodyPermissions `json:"permissions,omitempty"`
    // Format: email
    Username string `json:"username"`
}

type CreateSubAccountBodyPermissions

CreateSubAccountBodyPermissions is a schema definition.

type CreateSubAccountBodyPermissions struct {
    CreateMotoPayments         *bool `json:"create_moto_payments,omitempty"`
    CreateReferral             *bool `json:"create_referral,omitempty"`
    FullTransactionHistoryView *bool `json:"full_transaction_history_view,omitempty"`
    RefundTransactions         *bool `json:"refund_transactions,omitempty"`
}

type ListSubAccounts200Response

ListSubAccounts200Response is a schema definition.

type ListSubAccounts200Response []Operator

type ListSubAccountsParams

ListSubAccountsParams: query parameters for ListSubAccounts

type ListSubAccountsParams struct {
    // If true the list of operators will include also the primary user.
    IncludePrimary *bool
    // Search query used to filter users that match given query term.
    //
    // Current implementation allow querying only over the email address.
    // All operators whos email address contains the query string are returned.
    Query *string
}

func (*ListSubAccountsParams) QueryValues

func (p *ListSubAccountsParams) QueryValues() url.Values

QueryValues converts ListSubAccountsParams into [url.Values].

type Operator

Operator is a schema definition.

type Operator struct {
    AccountType OperatorAccountType `json:"account_type"`
    // The timestamp of when the operator was created.
    CreatedAt time.Time `json:"created_at"`
    Disabled  bool      `json:"disabled"`
    // Format: int32
    Id       int     `json:"id"`
    Nickname *string `json:"nickname,omitempty"`
    // User permissions
    Permissions shared.Permissions `json:"permissions"`
    // The timestamp of when the operator was last updated.
    UpdatedAt time.Time `json:"updated_at"`
    Username  string    `json:"username"`
}

type OperatorAccountType

OperatorAccountType is a schema definition.

type OperatorAccountType string

const (
    OperatorAccountTypeNormal   OperatorAccountType = "normal"
    OperatorAccountTypeOperator OperatorAccountType = "operator"
)

type SubaccountsService

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

func NewSubaccountsService

func NewSubaccountsService(c *client.Client) *SubaccountsService

func (*SubaccountsService) CompatGetOperator

func (s *SubaccountsService) CompatGetOperator(ctx context.Context, operatorId int) (*Operator, error)

CompatGetOperator: Get operator Returns specific operator. Deprecated: Subaccounts API is deprecated, to get an user that's a member of your merchant account please use [Get member](https://developer.sumup.com/api/members/get\) instead.

func (*SubaccountsService) CreateSubAccount

func (s *SubaccountsService) CreateSubAccount(ctx context.Context, body CreateSubAccountBody) (*Operator, error)

CreateSubAccount: Create operator. Creates new operator for currently authorized users' merchant. Deprecated: Subaccounts API is deprecated, to create an user in your merchant account please use [Create member](https://developer.sumup.com/api/members/create\) instead.

func (*SubaccountsService) DeactivateSubAccount

func (s *SubaccountsService) DeactivateSubAccount(ctx context.Context, operatorId int) (*Operator, error)

DeactivateSubAccount: Disable operator.

Deprecated: Subaccounts API is deprecated, to remove an user that's a member of your merchant account please use [Delete member](https://developer.sumup.com/api/members/delete\) instead.

func (*SubaccountsService) ListSubAccounts

func (s *SubaccountsService) ListSubAccounts(ctx context.Context, params ListSubAccountsParams) (*ListSubAccounts200Response, error)

ListSubAccounts: List operators. Returns list of operators for currently authorized user's merchant. Deprecated: Subaccounts API is deprecated, to list users in your merchant account please use [List members](https://developer.sumup.com/api/members/list\) instead.

func (*SubaccountsService) UpdateSubAccount

func (s *SubaccountsService) UpdateSubAccount(ctx context.Context, operatorId int, body UpdateSubAccountBody) (*Operator, error)

UpdateSubAccount: Update operator. Updates operator. If the operator was disabled and their password is updated they will be unblocked. Deprecated: Subaccounts API is deprecated, to update an user that's a member of your merchant account please use [Update member](https://developer.sumup.com/api/members/update\) instead.

type UpdateSubAccountBody

UpdateSubAccountBody is a schema definition.

type UpdateSubAccountBody struct {
    Disabled *bool   `json:"disabled,omitempty"`
    Nickname *string `json:"nickname,omitempty"`
    // Min length: 8
    Password    *string                          `json:"password,omitempty"`
    Permissions *UpdateSubAccountBodyPermissions `json:"permissions,omitempty"`
    // Format: email
    // Max length: 256
    Username *string `json:"username,omitempty"`
}

type UpdateSubAccountBodyPermissions

UpdateSubAccountBodyPermissions is a schema definition.

type UpdateSubAccountBodyPermissions struct {
    CreateMotoPayments         *bool `json:"create_moto_payments,omitempty"`
    CreateReferral             *bool `json:"create_referral,omitempty"`
    FullTransactionHistoryView *bool `json:"full_transaction_history_view,omitempty"`
    RefundTransactions         *bool `json:"refund_transactions,omitempty"`
}

transactions

import "github.com/sumup/sumup-go/transactions"

Index

type CardResponse

CardResponse: Details of the payment card.

type CardResponse struct {
    // Last 4 digits of the payment card number.
    // Read only
    // Min length: 4
    // Max length: 4
    Last4Digits *string `json:"last_4_digits,omitempty"`
    // Issuing card network of the payment card.
    // Read only
    Type *CardResponseType `json:"type,omitempty"`
}

type CardResponseType

CardResponseType: Issuing card network of the payment card. Read only

type CardResponseType string

const (
    CardResponseTypeAmex         CardResponseType = "AMEX"
    CardResponseTypeCup          CardResponseType = "CUP"
    CardResponseTypeDiners       CardResponseType = "DINERS"
    CardResponseTypeDiscover     CardResponseType = "DISCOVER"
    CardResponseTypeElo          CardResponseType = "ELO"
    CardResponseTypeElv          CardResponseType = "ELV"
    CardResponseTypeHipercard    CardResponseType = "HIPERCARD"
    CardResponseTypeJcb          CardResponseType = "JCB"
    CardResponseTypeMaestro      CardResponseType = "MAESTRO"
    CardResponseTypeMastercard   CardResponseType = "MASTERCARD"
    CardResponseTypeUnknown      CardResponseType = "UNKNOWN"
    CardResponseTypeVisa         CardResponseType = "VISA"
    CardResponseTypeVisaElectron CardResponseType = "VISA_ELECTRON"
    CardResponseTypeVisaVpay     CardResponseType = "VISA_VPAY"
)

type Event

Event is a schema definition.

type Event struct {
    // Amount of the event.
    Amount *shared.AmountEvent `json:"amount,omitempty"`
    // Amount deducted for the event.
    DeductedAmount *float64 `json:"deducted_amount,omitempty"`
    // Amount of the fee deducted for the event.
    DeductedFeeAmount *float64 `json:"deducted_fee_amount,omitempty"`
    // Amount of the fee related to the event.
    FeeAmount *float64 `json:"fee_amount,omitempty"`
    // Unique ID of the transaction event.
    // Format: int64
    Id  *shared.EventId `json:"id,omitempty"`
    // Consecutive number of the installment.
    InstallmentNumber *int `json:"installment_number,omitempty"`
    // Status of the transaction event.
    Status *shared.EventStatus `json:"status,omitempty"`
    // Date and time of the transaction event.
    Timestamp *shared.TimestampEvent `json:"timestamp,omitempty"`
    // Unique ID of the transaction.
    TransactionId *shared.TransactionId `json:"transaction_id,omitempty"`
    // Type of the transaction event.
    Type *shared.EventType `json:"type,omitempty"`
}

type GetTransactionParams

GetTransactionParams: query parameters for GetTransaction

type GetTransactionParams struct {
    // Retrieves the transaction resource with the specified transaction ID (the `id` parameter in the transaction resource).
    Id  *string
    // Retrieves the transaction resource with the specified internal transaction ID (the `internal_id` parameter in
    // the transaction resource).
    InternalId *string
    // Retrieves the transaction resource with the specified transaction code.
    TransactionCode *string
}

func (*GetTransactionParams) QueryValues

func (p *GetTransactionParams) QueryValues() url.Values

QueryValues converts GetTransactionParams into [url.Values].

type GetTransactionV21Params

GetTransactionV21Params: query parameters for GetTransactionV2.1

type GetTransactionV21Params struct {
    // Retrieves the transaction resource with the specified transaction ID (the `id` parameter in the transaction resource).
    Id  *string
    // Retrieves the transaction resource with the specified internal transaction ID (the `internal_id` parameter in
    // the transaction resource).
    InternalId *string
    // Retrieves the transaction resource with the specified transaction code.
    TransactionCode *string
}

func (*GetTransactionV21Params) QueryValues

func (p *GetTransactionV21Params) QueryValues() url.Values

QueryValues converts GetTransactionV21Params into [url.Values].

type HorizontalAccuracy

HorizontalAccuracy: Indication of the precision of the geographical position received from the payment terminal.

type HorizontalAccuracy float64

type Lat

Lat: Latitude value from the coordinates of the payment location (as received from the payment terminal reader).

Min: 0 Max: 90

type Lat float64

type Link

Link: Details of a link to a related resource.

type Link struct {
    // URL for accessing the related resource.
    // Format: uri
    Href *string `json:"href,omitempty"`
    // Specifies the relation to the current resource.
    Rel *string `json:"rel,omitempty"`
    // Specifies the media type of the related resource.
    Type *string `json:"type,omitempty"`
}

type LinkRefund

LinkRefund is a schema definition.

type LinkRefund struct {
    // URL for accessing the related resource.
    // Format: uri
    Href *string `json:"href,omitempty"`
    // Maximum allowed amount for the refund.
    MaxAmount *float64 `json:"max_amount,omitempty"`
    // Minimum allowed amount for the refund.
    MinAmount *float64 `json:"min_amount,omitempty"`
    // Specifies the relation to the current resource.
    Rel *string `json:"rel,omitempty"`
    // Specifies the media type of the related resource.
    Type *string `json:"type,omitempty"`
}

type ListTransactions200Response

ListTransactions200Response is a schema definition.

type ListTransactions200Response struct {
    Items *[]TransactionHistory `json:"items,omitempty"`
    Links *[]Link               `json:"links,omitempty"`
}

type ListTransactionsParams

ListTransactionsParams: query parameters for ListTransactions

type ListTransactionsParams struct {
    // Filters the results by the latest modification time of resources and returns only transactions that are modified
    // *at or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    ChangesSince *time.Time
    // Specifies the maximum number of results per page. Value must be a positive integer and if not specified, will
    // return 10 results.
    Limit *int
    // Filters the results by the reference ID of transaction events and returns only transactions with events whose
    // IDs are *smaller* than the specified value. This parameters supersedes the `newest_time` parameter (if both
    // are provided in the request).
    NewestRef *string
    // Filters the results by the creation time of resources and returns only transactions that are created *before*
    // the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    NewestTime *time.Time
    // Filters the results by the reference ID of transaction events and returns only transactions with events whose
    // IDs are *greater* than the specified value. This parameters supersedes the `oldest_time` parameter (if both
    // are provided in the request).
    OldestRef *string
    // Filters the results by the creation time of resources and returns only transactions that are created *at
    // or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    OldestTime *time.Time
    // Specifies the order in which the returned results are displayed.
    Order *string
    // Filters the returned results by the specified list of payment types used for the transactions.
    PaymentTypes *[]string
    // Filters the returned results by the specified list of final statuses of the transactions.
    Statuses *[]string
    // Retrieves the transaction resource with the specified transaction code.
    TransactionCode *string
    // Filters the returned results by the specified list of transaction types.
    Types *[]string
    // Filters the returned results by user email.
    Users *[]string
}

func (*ListTransactionsParams) QueryValues

func (p *ListTransactionsParams) QueryValues() url.Values

QueryValues converts ListTransactionsParams into [url.Values].

type ListTransactionsV21200Response

ListTransactionsV21200Response is a schema definition.

type ListTransactionsV21200Response struct {
    Items *[]TransactionHistory `json:"items,omitempty"`
    Links *[]Link               `json:"links,omitempty"`
}

type ListTransactionsV21Params

ListTransactionsV21Params: query parameters for ListTransactionsV2.1

type ListTransactionsV21Params struct {
    // Filters the results by the latest modification time of resources and returns only transactions that are modified
    // *at or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    ChangesSince *time.Time
    // Specifies the maximum number of results per page. Value must be a positive integer and if not specified, will
    // return 10 results.
    Limit *int
    // Filters the results by the reference ID of transaction events and returns only transactions with events whose
    // IDs are *smaller* than the specified value. This parameters supersedes the `newest_time` parameter (if both
    // are provided in the request).
    NewestRef *string
    // Filters the results by the creation time of resources and returns only transactions that are created *before*
    // the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    NewestTime *time.Time
    // Filters the results by the reference ID of transaction events and returns only transactions with events whose
    // IDs are *greater* than the specified value. This parameters supersedes the `oldest_time` parameter (if both
    // are provided in the request).
    OldestRef *string
    // Filters the results by the creation time of resources and returns only transactions that are created *at
    // or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
    OldestTime *time.Time
    // Specifies the order in which the returned results are displayed.
    Order *string
    // Filters the returned results by the specified list of payment types used for the transactions.
    PaymentTypes *[]string
    // Filters the returned results by the specified list of final statuses of the transactions.
    Statuses *[]string
    // Retrieves the transaction resource with the specified transaction code.
    TransactionCode *string
    // Filters the returned results by the specified list of transaction types.
    Types *[]string
    // Filters the returned results by user email.
    Users *[]string
}

func (*ListTransactionsV21Params) QueryValues

func (p *ListTransactionsV21Params) QueryValues() url.Values

QueryValues converts ListTransactionsV21Params into [url.Values].

type Lon

Lon: Longitude value from the coordinates of the payment location (as received from the payment terminal reader).

Min: 0 Max: 180

type Lon float64

type Product

Product: Details of the product for which the payment is made.

type Product struct {
    // Name of the product from the merchant's catalog.
    Name *string `json:"name,omitempty"`
    // Price of the product without VAT.
    Price *float64 `json:"price,omitempty"`
    // Price of a single product item with VAT.
    PriceWithVat *float64 `json:"price_with_vat,omitempty"`
    // Number of product items for the purchase.
    Quantity *float64 `json:"quantity,omitempty"`
    // Amount of the VAT for a single product item (calculated as the product of `price` and `vat_rate`, i.e. `single_vat_amount
    // = price * vat_rate`).
    SingleVatAmount *float64 `json:"single_vat_amount,omitempty"`
    // Total price of the product items without VAT (calculated as the product of `price` and `quantity`, i.e. `total_price
    // = price * quantity`).
    TotalPrice *float64 `json:"total_price,omitempty"`
    // Total price of the product items including VAT (calculated as the product of `price_with_vat` and `quantity`, i.e.
    // `total_with_vat = price_with_vat * quantity`).
    TotalWithVat *float64 `json:"total_with_vat,omitempty"`
    // Total VAT amount for the purchase (calculated as the product of `single_vat_amount` and `quantity`, i.e. `vat_amount
    // = single_vat_amount * quantity`).
    VatAmount *float64 `json:"vat_amount,omitempty"`
    // VAT rate applicable to the product.
    VatRate *float64 `json:"vat_rate,omitempty"`
}

type RefundTransaction204Response

RefundTransaction204Response is a schema definition.

type RefundTransaction204Response struct {
}

type RefundTransactionBody

RefundTransactionBody: Optional amount for partial refunds of transactions.

type RefundTransactionBody struct {
    // Amount to be refunded. Eligible amount can't exceed the amount of the transaction and varies based on country
    // and currency. If you do not specify a value, the system performs a full refund of the transaction.
    Amount *float64 `json:"amount,omitempty"`
}

type TransactionEvent

TransactionEvent: Details of a transaction event.

type TransactionEvent struct {
    // Amount of the event.
    Amount *shared.AmountEvent `json:"amount,omitempty"`
    // Date when the transaction event occurred.
    // Format: date
    Date *shared.Date `json:"date,omitempty"`
    // Date when the transaction event is due to occur.
    // Format: date
    DueDate *shared.Date `json:"due_date,omitempty"`
    // Type of the transaction event.
    EventType *shared.EventType `json:"event_type,omitempty"`
    // Unique ID of the transaction event.
    // Format: int64
    Id  *shared.EventId `json:"id,omitempty"`
    // Consecutive number of the installment that is paid. Applicable only payout events, i.e. `event_type = PAYOUT`.
    InstallmentNumber *int `json:"installment_number,omitempty"`
    // Status of the transaction event.
    Status *shared.EventStatus `json:"status,omitempty"`
    // Date and time of the transaction event.
    Timestamp *shared.TimestampEvent `json:"timestamp,omitempty"`
}

type TransactionFull

TransactionFull is a schema definition.

type TransactionFull struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
    AuthCode *string `json:"auth_code,omitempty"`
    // Details of the payment card.
    Card *CardResponse `json:"card,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Entry mode of the payment details.
    EntryMode *TransactionFullEntryMode `json:"entry_mode,omitempty"`
    // List of events related to the transaction.
    // Unique items only
    Events *[]Event `json:"events,omitempty"`
    // Indication of the precision of the geographical position received from the payment terminal.
    HorizontalAccuracy *HorizontalAccuracy `json:"horizontal_accuracy,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Internal unique ID of the transaction on the SumUp platform.
    InternalId *int `json:"internal_id,omitempty"`
    // Latitude value from the coordinates of the payment location (as received from the payment terminal reader).
    // Min: 0
    // Max: 90
    Lat *Lat `json:"lat,omitempty"`
    // List of hyperlinks for accessing related resources.
    // Unique items only
    Links *[]interface{} `json:"links,omitempty"`
    // Local date and time of the creation of the transaction.
    LocalTime *time.Time `json:"local_time,omitempty"`
    // Details of the payment location as received from the payment terminal.
    Location *TransactionFullLocation `json:"location,omitempty"`
    // Longitude value from the coordinates of the payment location (as received from the payment terminal reader).
    // Min: 0
    // Max: 180
    Lon *Lon `json:"lon,omitempty"`
    // Unique code of the registered merchant to whom the payment is made.
    MerchantCode *string `json:"merchant_code,omitempty"`
    // Payment type used for the transaction.
    PaymentType *TransactionFullPaymentType `json:"payment_type,omitempty"`
    // Payout plan of the registered user at the time when the transaction was made.
    PayoutPlan *TransactionFullPayoutPlan `json:"payout_plan,omitempty"`
    // Payout type for the transaction.
    PayoutType *TransactionFullPayoutType `json:"payout_type,omitempty"`
    // Number of payouts that are made to the registered user specified in the `user` property.
    PayoutsReceived *int `json:"payouts_received,omitempty"`
    // Total number of payouts to the registered user specified in the `user` property.
    PayoutsTotal *int `json:"payouts_total,omitempty"`
    // Short description of the payment. The value is taken from the `description` property of the related checkout resource.
    ProductSummary *string `json:"product_summary,omitempty"`
    // List of products from the merchant's catalogue for which the transaction serves as a payment.
    Products *[]Product `json:"products,omitempty"`
    // Simple name of the payment type.
    SimplePaymentType *TransactionFullSimplePaymentType `json:"simple_payment_type,omitempty"`
    // Status generated from the processing status and the latest transaction state.
    SimpleStatus *TransactionFullSimpleStatus `json:"simple_status,omitempty"`
    // Current status of the transaction.
    Status *TransactionFullStatus `json:"status,omitempty"`
    // Indicates whether tax deduction is enabled for the transaction.
    TaxEnabled *bool `json:"tax_enabled,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Amount of the tip (out of the total transaction amount).
    TipAmount *float64 `json:"tip_amount,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // List of transaction events related to the transaction.
    TransactionEvents *[]TransactionEvent `json:"transaction_events,omitempty"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    Username *string `json:"username,omitempty"`
    // Amount of the applicable VAT (out of the total transaction amount).
    VatAmount *float64 `json:"vat_amount,omitempty"`
    // List of VAT rates applicable to the transaction.
    VatRates *[]interface{} `json:"vat_rates,omitempty"`
    // Verification method used for the transaction.
    VerificationMethod *TransactionFullVerificationMethod `json:"verification_method,omitempty"`
}

type TransactionFullEntryMode

TransactionFullEntryMode: Entry mode of the payment details.

type TransactionFullEntryMode string

const (
    TransactionFullEntryModeBoleto        TransactionFullEntryMode = "BOLETO"
    TransactionFullEntryModeCustomerEntry TransactionFullEntryMode = "CUSTOMER_ENTRY"
)

type TransactionFullLocation

TransactionFullLocation: Details of the payment location as received from the payment terminal.

type TransactionFullLocation struct {
    // Indication of the precision of the geographical position received from the payment terminal.
    HorizontalAccuracy *HorizontalAccuracy `json:"horizontal_accuracy,omitempty"`
    // Latitude value from the coordinates of the payment location (as received from the payment terminal reader).
    // Min: 0
    // Max: 90
    Lat *Lat `json:"lat,omitempty"`
    // Longitude value from the coordinates of the payment location (as received from the payment terminal reader).
    // Min: 0
    // Max: 180
    Lon *Lon `json:"lon,omitempty"`
}

type TransactionFullPaymentType

TransactionFullPaymentType: Payment type used for the transaction.

type TransactionFullPaymentType string

const (
    TransactionFullPaymentTypeBoleto    TransactionFullPaymentType = "BOLETO"
    TransactionFullPaymentTypeEcom      TransactionFullPaymentType = "ECOM"
    TransactionFullPaymentTypeRecurring TransactionFullPaymentType = "RECURRING"
)

type TransactionFullPayoutPlan

TransactionFullPayoutPlan: Payout plan of the registered user at the time when the transaction was made.

type TransactionFullPayoutPlan string

const (
    TransactionFullPayoutPlanAcceleratedInstallment TransactionFullPayoutPlan = "ACCELERATED_INSTALLMENT"
    TransactionFullPayoutPlanSinglePayment          TransactionFullPayoutPlan = "SINGLE_PAYMENT"
    TransactionFullPayoutPlanTrueInstallment        TransactionFullPayoutPlan = "TRUE_INSTALLMENT"
)

type TransactionFullPayoutType

TransactionFullPayoutType: Payout type for the transaction.

type TransactionFullPayoutType string

const (
    TransactionFullPayoutTypeBalance     TransactionFullPayoutType = "BALANCE"
    TransactionFullPayoutTypeBankAccount TransactionFullPayoutType = "BANK_ACCOUNT"
    TransactionFullPayoutTypePrepaidCard TransactionFullPayoutType = "PREPAID_CARD"
)

type TransactionFullSimplePaymentType

TransactionFullSimplePaymentType: Simple name of the payment type.

type TransactionFullSimplePaymentType string

const (
    TransactionFullSimplePaymentTypeCash              TransactionFullSimplePaymentType = "CASH"
    TransactionFullSimplePaymentTypeCcCustomerEntered TransactionFullSimplePaymentType = "CC_CUSTOMER_ENTERED"
    TransactionFullSimplePaymentTypeCcSignature       TransactionFullSimplePaymentType = "CC_SIGNATURE"
    TransactionFullSimplePaymentTypeElv               TransactionFullSimplePaymentType = "ELV"
    TransactionFullSimplePaymentTypeEmv               TransactionFullSimplePaymentType = "EMV"
    TransactionFullSimplePaymentTypeManualEntry       TransactionFullSimplePaymentType = "MANUAL_ENTRY"
    TransactionFullSimplePaymentTypeMoto              TransactionFullSimplePaymentType = "MOTO"
)

type TransactionFullSimpleStatus

TransactionFullSimpleStatus: Status generated from the processing status and the latest transaction state.

type TransactionFullSimpleStatus string

const (
    TransactionFullSimpleStatusCancelFailed  TransactionFullSimpleStatus = "CANCEL_FAILED"
    TransactionFullSimpleStatusCancelled     TransactionFullSimpleStatus = "CANCELLED"
    TransactionFullSimpleStatusChargeback    TransactionFullSimpleStatus = "CHARGEBACK"
    TransactionFullSimpleStatusFailed        TransactionFullSimpleStatus = "FAILED"
    TransactionFullSimpleStatusNonCollection TransactionFullSimpleStatus = "NON_COLLECTION"
    TransactionFullSimpleStatusPaidOut       TransactionFullSimpleStatus = "PAID_OUT"
    TransactionFullSimpleStatusRefundFailed  TransactionFullSimpleStatus = "REFUND_FAILED"
    TransactionFullSimpleStatusRefunded      TransactionFullSimpleStatus = "REFUNDED"
    TransactionFullSimpleStatusSuccessful    TransactionFullSimpleStatus = "SUCCESSFUL"
)

type TransactionFullStatus

TransactionFullStatus: Current status of the transaction.

type TransactionFullStatus string

const (
    TransactionFullStatusCancelled  TransactionFullStatus = "CANCELLED"
    TransactionFullStatusFailed     TransactionFullStatus = "FAILED"
    TransactionFullStatusPending    TransactionFullStatus = "PENDING"
    TransactionFullStatusSuccessful TransactionFullStatus = "SUCCESSFUL"
)

type TransactionFullVerificationMethod

TransactionFullVerificationMethod: Verification method used for the transaction.

type TransactionFullVerificationMethod string

const (
    TransactionFullVerificationMethodConfirmationCodeVerified TransactionFullVerificationMethod = "confirmation code verified"
    TransactionFullVerificationMethodNone                     TransactionFullVerificationMethod = "none"
    TransactionFullVerificationMethodOfflinePin               TransactionFullVerificationMethod = "offline pin"
    TransactionFullVerificationMethodOfflinePinSignature      TransactionFullVerificationMethod = "offline pin + signature"
    TransactionFullVerificationMethodOnlinePin                TransactionFullVerificationMethod = "online pin"
    TransactionFullVerificationMethodSignature                TransactionFullVerificationMethod = "signature"
)

type TransactionHistory

TransactionHistory is a schema definition.

type TransactionHistory struct {
    // Total amount of the transaction.
    Amount *float64 `json:"amount,omitempty"`
    // Issuing card network of the payment card used for the transaction.
    CardType *TransactionHistoryCardType `json:"card_type,omitempty"`
    // Client-specific ID of the transaction.
    ClientTransactionId *string `json:"client_transaction_id,omitempty"`
    // Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
    // currency values are enumerated above.
    Currency *shared.Currency `json:"currency,omitempty"`
    // Unique ID of the transaction.
    Id  *string `json:"id,omitempty"`
    // Current number of the installment for deferred payments.
    // Min: 1
    InstallmentsCount *int `json:"installments_count,omitempty"`
    // Payment type used for the transaction.
    PaymentType *TransactionHistoryPaymentType `json:"payment_type,omitempty"`
    // Payout plan of the registered user at the time when the transaction was made.
    PayoutPlan *TransactionHistoryPayoutPlan `json:"payout_plan,omitempty"`
    // Number of payouts that are made to the registered user specified in the `user` property.
    PayoutsReceived *int `json:"payouts_received,omitempty"`
    // Total number of payouts to the registered user specified in the `user` property.
    PayoutsTotal *int `json:"payouts_total,omitempty"`
    // Short description of the payment. The value is taken from the `description` property of the related checkout resource.
    ProductSummary *string `json:"product_summary,omitempty"`
    // Current status of the transaction.
    Status *TransactionHistoryStatus `json:"status,omitempty"`
    // Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
    Timestamp *time.Time `json:"timestamp,omitempty"`
    // Transaction code returned by the acquirer/processing entity after processing the transaction.
    TransactionCode *string `json:"transaction_code,omitempty"`
    // Unique ID of the transaction.
    TransactionId *shared.TransactionId `json:"transaction_id,omitempty"`
    // Type of the transaction for the registered user specified in the `user` property.
    Type *TransactionHistoryType `json:"type,omitempty"`
    // Email address of the registered user (merchant) to whom the payment is made.
    // Format: email
    User *string `json:"user,omitempty"`
}

type TransactionHistoryCardType

TransactionHistoryCardType: Issuing card network of the payment card used for the transaction.

type TransactionHistoryCardType string

const (
    TransactionHistoryCardTypeAmex         TransactionHistoryCardType = "AMEX"
    TransactionHistoryCardTypeCup          TransactionHistoryCardType = "CUP"
    TransactionHistoryCardTypeDiners       TransactionHistoryCardType = "DINERS"
    TransactionHistoryCardTypeDiscover     TransactionHistoryCardType = "DISCOVER"
    TransactionHistoryCardTypeElo          TransactionHistoryCardType = "ELO"
    TransactionHistoryCardTypeElv          TransactionHistoryCardType = "ELV"
    TransactionHistoryCardTypeHipercard    TransactionHistoryCardType = "HIPERCARD"
    TransactionHistoryCardTypeJcb          TransactionHistoryCardType = "JCB"
    TransactionHistoryCardTypeMaestro      TransactionHistoryCardType = "MAESTRO"
    TransactionHistoryCardTypeMastercard   TransactionHistoryCardType = "MASTERCARD"
    TransactionHistoryCardTypeUnknown      TransactionHistoryCardType = "UNKNOWN"
    TransactionHistoryCardTypeVisa         TransactionHistoryCardType = "VISA"
    TransactionHistoryCardTypeVisaElectron TransactionHistoryCardType = "VISA_ELECTRON"
    TransactionHistoryCardTypeVisaVpay     TransactionHistoryCardType = "VISA_VPAY"
)

type TransactionHistoryPaymentType

TransactionHistoryPaymentType: Payment type used for the transaction.

type TransactionHistoryPaymentType string

const (
    TransactionHistoryPaymentTypeBoleto    TransactionHistoryPaymentType = "BOLETO"
    TransactionHistoryPaymentTypeEcom      TransactionHistoryPaymentType = "ECOM"
    TransactionHistoryPaymentTypeRecurring TransactionHistoryPaymentType = "RECURRING"
)

type TransactionHistoryPayoutPlan

TransactionHistoryPayoutPlan: Payout plan of the registered user at the time when the transaction was made.

type TransactionHistoryPayoutPlan string

const (
    TransactionHistoryPayoutPlanAcceleratedInstallment TransactionHistoryPayoutPlan = "ACCELERATED_INSTALLMENT"
    TransactionHistoryPayoutPlanSinglePayment          TransactionHistoryPayoutPlan = "SINGLE_PAYMENT"
    TransactionHistoryPayoutPlanTrueInstallment        TransactionHistoryPayoutPlan = "TRUE_INSTALLMENT"
)

type TransactionHistoryStatus

TransactionHistoryStatus: Current status of the transaction.

type TransactionHistoryStatus string

const (
    TransactionHistoryStatusCancelled  TransactionHistoryStatus = "CANCELLED"
    TransactionHistoryStatusFailed     TransactionHistoryStatus = "FAILED"
    TransactionHistoryStatusPending    TransactionHistoryStatus = "PENDING"
    TransactionHistoryStatusSuccessful TransactionHistoryStatus = "SUCCESSFUL"
)

type TransactionHistoryType

TransactionHistoryType: Type of the transaction for the registered user specified in the `user` property.

type TransactionHistoryType string

const (
    TransactionHistoryTypeChargeBack TransactionHistoryType = "CHARGE_BACK"
    TransactionHistoryTypePayment    TransactionHistoryType = "PAYMENT"
    TransactionHistoryTypeRefund     TransactionHistoryType = "REFUND"
)

type TransactionMixinHistory

TransactionMixinHistory is a schema definition.

type TransactionMixinHistory struct {
    // Payout plan of the registered user at the time when the transaction was made.
    PayoutPlan *TransactionMixinHistoryPayoutPlan `json:"payout_plan,omitempty"`
    // Number of payouts that are made to the registered user specified in the `user` property.
    PayoutsReceived *int `json:"payouts_received,omitempty"`
    // Total number of payouts to the registered user specified in the `user` property.
    PayoutsTotal *int `json:"payouts_total,omitempty"`
    // Short description of the payment. The value is taken from the `description` property of the related checkout resource.
    ProductSummary *string `json:"product_summary,omitempty"`
}

type TransactionMixinHistoryPayoutPlan

TransactionMixinHistoryPayoutPlan: Payout plan of the registered user at the time when the transaction was made.

type TransactionMixinHistoryPayoutPlan string

const (
    TransactionMixinHistoryPayoutPlanAcceleratedInstallment TransactionMixinHistoryPayoutPlan = "ACCELERATED_INSTALLMENT"
    TransactionMixinHistoryPayoutPlanSinglePayment          TransactionMixinHistoryPayoutPlan = "SINGLE_PAYMENT"
    TransactionMixinHistoryPayoutPlanTrueInstallment        TransactionMixinHistoryPayoutPlan = "TRUE_INSTALLMENT"
)

type TransactionsService

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

func NewTransactionsService

func NewTransactionsService(c *client.Client) *TransactionsService

func (*TransactionsService) Get

func (s *TransactionsService) Get(ctx context.Context, merchantCode string, params GetTransactionV21Params) (*TransactionFull, error)

Get: Retrieve a transaction Retrieves the full details of an identified transaction. The transaction resource is identified by a query parameter and *one* of following parameters is required:

  • `id`
  • `internal_id`
  • `transaction_code`
  • `foreign_transaction_id`
  • `client_transaction_id`

func (*TransactionsService) GetDeprecated

func (s *TransactionsService) GetDeprecated(ctx context.Context, params GetTransactionParams) (*TransactionFull, error)

GetDeprecated: Retrieve a transaction Retrieves the full details of an identified transaction. The transaction resource is identified by a query parameter and *one* of following parameters is required:

  • `id`
  • `internal_id`
  • `transaction_code`
  • `foreign_transaction_id`
  • `client_transaction_id`

Deprecated: this operation is deprecated

func (*TransactionsService) List

func (s *TransactionsService) List(ctx context.Context, merchantCode string, params ListTransactionsV21Params) (*ListTransactionsV21200Response, error)

List: List transactions Lists detailed history of all transactions associated with the merchant profile.

func (*TransactionsService) ListDeprecated

func (s *TransactionsService) ListDeprecated(ctx context.Context, params ListTransactionsParams) (*ListTransactions200Response, error)

ListDeprecated: List transactions Lists detailed history of all transactions associated with the merchant profile. Deprecated: this operation is deprecated

func (*TransactionsService) Refund

func (s *TransactionsService) Refund(ctx context.Context, txnId string, body RefundTransactionBody) (*RefundTransaction204Response, error)

Refund: Refund a transaction Refunds an identified transaction either in full or partially.

checkout

import "github.com/sumup/sumup-go/example/checkout"

Index

simple

import "github.com/sumup/sumup-go/example/simple"

Index

Generated by gomarkdoc