checkouts

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type 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 used for the transaction.
	Type shared.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"`
}

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

type CardExpiryMonth

type CardExpiryMonth string

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

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

type CardType = shared.CardType

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

type Checkout

type Checkout struct {
	// Amount of the payment.
	Amount *float32 `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"`
	// 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"`
}

Details of the payment checkout.

type CheckoutAccepted

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

3DS Response

type CheckoutAcceptedNextStep

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

Required action processing 3D Secure payments.

type CheckoutAcceptedNextStepMechanism

type CheckoutAcceptedNextStepMechanism string

CheckoutAcceptedNextStepMechanism is a schema definition.

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

type CheckoutAcceptedNextStepPayload

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

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

type CheckoutCreateRequest

type CheckoutCreateRequest struct {
	// Amount of the payment.
	Amount float32 `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"`
	// 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"`
}

Details of the payment checkout.

type CheckoutCreateRequestPurpose

type CheckoutCreateRequestPurpose string

Purpose of the checkout. Default: CHECKOUT

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

type CheckoutCreateRequestStatus

type CheckoutCreateRequestStatus string

Current status of the checkout. Read only

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

type CheckoutCreateRequestTransaction

type CheckoutCreateRequestTransaction struct {
	// Total amount of the transaction.
	Amount *float32 `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 *shared.EntryMode `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.
	// Format: int64
	InternalID *int64 `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 *shared.PaymentType `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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
}

CheckoutCreateRequestTransaction is a schema definition.

type CheckoutCreateRequestTransactionStatus

type CheckoutCreateRequestTransactionStatus string

Current status of the transaction.

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

type CheckoutStatus

type CheckoutStatus string

Current status of the checkout.

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

type CheckoutSuccess

type CheckoutSuccess struct {
	// Amount of the payment.
	Amount *float32 `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"`
	// 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"`
}

CheckoutSuccess is a schema definition.

type CheckoutSuccessPaymentInstrument

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

Object containing token information for the specified payment instrument

type CheckoutSuccessStatus

type CheckoutSuccessStatus string

Current status of the checkout.

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

type CheckoutSuccessTransaction

type CheckoutSuccessTransaction struct {
	// Total amount of the transaction.
	Amount *float32 `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 *shared.EntryMode `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.
	// Format: int64
	InternalID *int64 `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 *shared.PaymentType `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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
}

CheckoutSuccessTransaction is a schema definition.

type CheckoutSuccessTransactionStatus

type CheckoutSuccessTransactionStatus string

Current status of the transaction.

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

type CheckoutTransaction

type CheckoutTransaction struct {
	// Total amount of the transaction.
	Amount *float32 `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 *shared.EntryMode `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.
	// Format: int64
	InternalID *int64 `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 *shared.PaymentType `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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
}

CheckoutTransaction is a schema definition.

type CheckoutTransactionStatus

type CheckoutTransactionStatus string

Current status of the transaction.

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

type Client added in v0.13.0

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

func NewClient added in v0.13.0

func NewClient(c *client.Client) *Client

func (*Client) Create added in v0.13.0

func (c *Client) Create(ctx context.Context, body Create) (*Checkout, error)

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 (*Client) Deactivate added in v0.13.0

func (c *Client) Deactivate(ctx context.Context, id string) (*Checkout, error)

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

func (*Client) Get added in v0.13.0

func (c *Client) Get(ctx context.Context, id string) (*CheckoutSuccess, error)

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

func (*Client) List added in v0.13.0

Lists created checkout resources according to the applied `checkout_reference`.

func (*Client) ListAvailablePaymentMethods added in v0.13.0

func (c *Client) ListAvailablePaymentMethods(ctx context.Context, merchantCode string, params ListAvailablePaymentMethodsParams) (*GetPaymentMethods200Response, error)

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

func (*Client) Process added in v0.13.0

func (c *Client) Process(ctx context.Context, id string, body Process) (*ProcessCheckoutResponse, error)

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 Create added in v0.12.0

type Create struct {
	// Amount of the payment.
	Amount float32 `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"`
	// Purpose of the checkout.
	// Default: CHECKOUT
	Purpose *CreatePurpose `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 *CreateStatus `json:"status,omitempty"`
	// List of transactions related to the payment.
	// Read only
	// Unique items only
	Transactions []CreateTransaction `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"`
}

Details of the payment checkout.

type CreatePurpose added in v0.12.0

type CreatePurpose string

Purpose of the checkout. Default: CHECKOUT

const (
	CreatePurposeCheckout              CreatePurpose = "CHECKOUT"
	CreatePurposeSetupRecurringPayment CreatePurpose = "SETUP_RECURRING_PAYMENT"
)

type CreateStatus added in v0.12.0

type CreateStatus string

Current status of the checkout. Read only

const (
	CreateStatusFailed  CreateStatus = "FAILED"
	CreateStatusPaid    CreateStatus = "PAID"
	CreateStatusPending CreateStatus = "PENDING"
)

type CreateTransaction added in v0.12.0

type CreateTransaction struct {
	// Total amount of the transaction.
	Amount *float32 `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 *shared.EntryMode `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.
	// Format: int64
	InternalID *int64 `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 *shared.PaymentType `json:"payment_type,omitempty"`
	// Current status of the transaction.
	Status *CreateTransactionStatus `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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
}

CreateTransaction is a schema definition.

type CreateTransactionStatus added in v0.12.0

type CreateTransactionStatus string

Current status of the transaction.

const (
	CreateTransactionStatusCancelled  CreateTransactionStatus = "CANCELLED"
	CreateTransactionStatusFailed     CreateTransactionStatus = "FAILED"
	CreateTransactionStatusPending    CreateTransactionStatus = "PENDING"
	CreateTransactionStatusSuccessful CreateTransactionStatus = "SUCCESSFUL"
)

type Currency added in v0.13.0

type Currency = shared.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 DetailsError

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

Error message structure.

func (*DetailsError) Error

func (e *DetailsError) Error() string

type DetailsErrorFailedConstraint

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

DetailsErrorFailedConstraint is a schema definition.

type EntryMode added in v0.13.0

type EntryMode = shared.EntryMode

Entry mode of the payment details.

type ErrorExtended

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

ErrorExtended is a schema definition.

func (*ErrorExtended) Error

func (e *ErrorExtended) Error() string

type GetPaymentMethods200Response

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

GetPaymentMethods200Response is a schema definition.

type GetPaymentMethods200ResponseAvailablePaymentMethod

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

GetPaymentMethods200ResponseAvailablePaymentMethod is a schema definition.

type ListAvailablePaymentMethodsParams added in v0.12.0

type ListAvailablePaymentMethodsParams 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
}

ListAvailablePaymentMethodsParams are query parameters for GetPaymentMethods.

func (*ListAvailablePaymentMethodsParams) QueryValues added in v0.12.0

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

QueryValues converts ListAvailablePaymentMethodsParams into url.Values.

type ListCheckouts200Response

type ListCheckouts200Response []CheckoutSuccess

ListCheckouts200Response is a schema definition.

type ListParams added in v0.12.0

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

ListParams are query parameters for ListCheckouts.

func (*ListParams) QueryValues added in v0.12.0

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

QueryValues converts ListParams into url.Values.

type MandatePayload

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

Mandate is passed when a card is to be tokenized

type MandatePayloadType

type MandatePayloadType string

Indicates the mandate type

const (
	MandatePayloadTypeRecurrent MandatePayloadType = "recurrent"
)

type MandateResponse added in v0.13.0

type MandateResponse = shared.MandateResponse

Created mandate

type PaymentType added in v0.13.0

type PaymentType = shared.PaymentType

Payment type used for the transaction.

type PersonalDetails added in v0.13.0

type PersonalDetails = shared.PersonalDetails

Personal details for the customer.

type Process added in v0.12.0

type Process 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 ProcessPaymentType `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"`
}

Details of the payment instrument for processing the checkout.

type ProcessCheckout added in v0.7.0

type ProcessCheckout 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 ProcessCheckoutPaymentType `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"`
}

Details of the payment instrument for processing the checkout.

type ProcessCheckout400Response

type ProcessCheckout400Response json.RawMessage

ProcessCheckout400Response is a schema definition.

func (*ProcessCheckout400Response) Error

type ProcessCheckoutPaymentType added in v0.7.0

type ProcessCheckoutPaymentType string

Describes the payment method used to attempt processing

const (
	ProcessCheckoutPaymentTypeBancontact ProcessCheckoutPaymentType = "bancontact"
	ProcessCheckoutPaymentTypeBlik       ProcessCheckoutPaymentType = "blik"
	ProcessCheckoutPaymentTypeBoleto     ProcessCheckoutPaymentType = "boleto"
	ProcessCheckoutPaymentTypeCard       ProcessCheckoutPaymentType = "card"
	ProcessCheckoutPaymentTypeIdeal      ProcessCheckoutPaymentType = "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)

type ProcessPaymentType added in v0.12.0

type ProcessPaymentType string

Describes the payment method used to attempt processing

const (
	ProcessPaymentTypeBancontact ProcessPaymentType = "bancontact"
	ProcessPaymentTypeBlik       ProcessPaymentType = "blik"
	ProcessPaymentTypeBoleto     ProcessPaymentType = "boleto"
	ProcessPaymentTypeCard       ProcessPaymentType = "card"
	ProcessPaymentTypeIdeal      ProcessPaymentType = "ideal"
)

Jump to

Keyboard shortcuts

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