checkouts

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 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.
	// 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"`
}

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

type CardExpiryMonth

type CardExpiryMonth string

CardExpiryMonth: 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 string

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

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

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

Checkout: Details of the payment checkout.

type CheckoutAccepted

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

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

CheckoutAcceptedNextStep: 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      *interface{} `json:"md,omitempty"`
	PaReq   *interface{} `json:"pa_req,omitempty"`
	TermUrl *interface{} `json:"term_url,omitempty"`
}

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

CheckoutCreateRequest: Details of the payment checkout.

type CheckoutCreateRequestPurpose

type CheckoutCreateRequestPurpose string

CheckoutCreateRequestPurpose: Purpose of the checkout. Default: CHECKOUT

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

type CheckoutCreateRequestStatus

type CheckoutCreateRequestStatus string

CheckoutCreateRequestStatus: 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 *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"`
}

CheckoutCreateRequestTransaction is a schema definition.

type CheckoutCreateRequestTransactionEntryMode

type CheckoutCreateRequestTransactionEntryMode string

CheckoutCreateRequestTransactionEntryMode: Entry mode of the payment details.

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

type CheckoutCreateRequestTransactionPaymentType

type CheckoutCreateRequestTransactionPaymentType string

CheckoutCreateRequestTransactionPaymentType: Payment type used for the transaction.

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

type CheckoutCreateRequestTransactionStatus

type CheckoutCreateRequestTransactionStatus string

CheckoutCreateRequestTransactionStatus: Current status of the transaction.

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

type CheckoutProcessMixin

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

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

type CheckoutProcessMixinPaymentType

type CheckoutProcessMixinPaymentType string

CheckoutProcessMixinPaymentType: Describes the payment method used to attempt processing

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

type CheckoutStatus

type CheckoutStatus string

CheckoutStatus: Current status of the checkout.

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

type CheckoutSuccess

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

CheckoutSuccess is a schema definition.

type CheckoutSuccessPaymentInstrument

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

CheckoutSuccessPaymentInstrument: Object containing token information for the specified payment instrument

type CheckoutSuccessStatus

type CheckoutSuccessStatus string

CheckoutSuccessStatus: Current status of the checkout.

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

type CheckoutSuccessTransaction

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

CheckoutSuccessTransaction is a schema definition.

type CheckoutSuccessTransactionEntryMode

type CheckoutSuccessTransactionEntryMode string

CheckoutSuccessTransactionEntryMode: Entry mode of the payment details.

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

type CheckoutSuccessTransactionPaymentType

type CheckoutSuccessTransactionPaymentType string

CheckoutSuccessTransactionPaymentType: Payment type used for the transaction.

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

type CheckoutSuccessTransactionStatus

type CheckoutSuccessTransactionStatus string

CheckoutSuccessTransactionStatus: 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 *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"`
}

CheckoutTransaction is a schema definition.

type CheckoutTransactionEntryMode

type CheckoutTransactionEntryMode string

CheckoutTransactionEntryMode: Entry mode of the payment details.

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

type CheckoutTransactionPaymentType

type CheckoutTransactionPaymentType string

CheckoutTransactionPaymentType: Payment type used for the transaction.

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

type CheckoutTransactionStatus

type CheckoutTransactionStatus string

CheckoutTransactionStatus: Current status of the transaction.

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

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

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

func (*CheckoutsService) Get

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

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

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

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

CreateCheckoutBody: Details of the payment checkout.

type CreateCheckoutBodyPurpose

type CreateCheckoutBodyPurpose string

CreateCheckoutBodyPurpose: Purpose of the checkout. Default: CHECKOUT

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

type CreateCheckoutBodyStatus

type CreateCheckoutBodyStatus string

CreateCheckoutBodyStatus: Current status of the checkout. Read only

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

type CreateCheckoutBodyTransaction

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

CreateCheckoutBodyTransaction is a schema definition.

type CreateCheckoutBodyTransactionEntryMode

type CreateCheckoutBodyTransactionEntryMode string

CreateCheckoutBodyTransactionEntryMode: Entry mode of the payment details.

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

type CreateCheckoutBodyTransactionPaymentType

type CreateCheckoutBodyTransactionPaymentType string

CreateCheckoutBodyTransactionPaymentType: Payment type used for the transaction.

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

type CreateCheckoutBodyTransactionStatus

type CreateCheckoutBodyTransactionStatus string

CreateCheckoutBodyTransactionStatus: Current status of the transaction.

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

type DeactivateCheckout200Response

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

DeactivateCheckout200Response: Details of the deleted checkout.

type DeactivateCheckout200ResponsePurpose

type DeactivateCheckout200ResponsePurpose string

DeactivateCheckout200ResponsePurpose: Purpose of the checkout creation initially

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

type DeactivateCheckout200ResponseStatus

type DeactivateCheckout200ResponseStatus string

DeactivateCheckout200ResponseStatus: Current status of the checkout. Read only

const (
	DeactivateCheckout200ResponseStatusExpired DeactivateCheckout200ResponseStatus = "EXPIRED"
)

type DeactivateCheckout200ResponseTransaction

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

DeactivateCheckout200ResponseTransaction is a schema definition.

type DeactivateCheckout200ResponseTransactionEntryMode

type DeactivateCheckout200ResponseTransactionEntryMode string

DeactivateCheckout200ResponseTransactionEntryMode: Entry mode of the payment details.

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

type DeactivateCheckout200ResponseTransactionPaymentType

type DeactivateCheckout200ResponseTransactionPaymentType string

DeactivateCheckout200ResponseTransactionPaymentType: Payment type used for the transaction.

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

type DeactivateCheckout200ResponseTransactionStatus

type DeactivateCheckout200ResponseTransactionStatus string

DeactivateCheckout200ResponseTransactionStatus: Current status of the transaction.

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

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

DetailsError: 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 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 GetPaymentMethodsParams

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
}

GetPaymentMethodsParams: query parameters for GetPaymentMethods

func (*GetPaymentMethodsParams) QueryValues

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

QueryValues converts GetPaymentMethodsParams into url.Values.

type ListCheckouts200Response

type ListCheckouts200Response []CheckoutSuccess

ListCheckouts200Response is a schema definition.

type ListCheckoutsParams

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

ListCheckoutsParams: query parameters for ListCheckouts

func (*ListCheckoutsParams) QueryValues

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

QueryValues converts ListCheckoutsParams 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"`
}

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

type MandatePayloadType

type MandatePayloadType string

MandatePayloadType: Indicates the mandate type

const (
	MandatePayloadTypeRecurrent MandatePayloadType = "recurrent"
)

type ProcessCheckout400Response

type ProcessCheckout400Response json.RawMessage

ProcessCheckout400Response is a schema definition.

func (*ProcessCheckout400Response) Error

type ProcessCheckoutBody

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

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

type ProcessCheckoutBodyPaymentType

type ProcessCheckoutBodyPaymentType string

ProcessCheckoutBodyPaymentType: Describes the payment method used to attempt processing

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)

Jump to

Keyboard shortcuts

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