Skip to main content

Payment

Overview

Payment is a discriminated union of possible payment methods available in the High Velocity front-end app.

type Payment =
| PaymentCreditCard
| PaymentKlarna
| PaymentPaypal
| PaymentStripe
| PaymentGooglePay;
note

You are not stuck with these payment types, since you have full control of the code in High Velocity, you are free to modify, remove, or add payment types and attributes. Payment processing will need to be implemented within the chosen vendor package and system.

PaymentCreditCard

Represents a payment made using a credit card.

Attributes

provider

type: literal = 'creditCard'


cardType

type: 'visa' | 'mastercard' | 'amex' | 'discover'


The type of the credit card.

maskedNumber

type: string


The masked number of the credit card.

id

type: string


The unique identifier for the payment.

paymentMethod

type: PaymentMethod

The payment method details.

amount

type: Money


The amount of the payment.

PaymentKlarna

Represents a payment made using Klarna.

Attributes

provider

type: literal = 'klarna'


id

type: string


The unique identifier for the payment.

paymentMethod

type: PaymentMethod

The payment method details.

amount

type: Money


The amount of the payment.

PaymentPaypal

Represents a payment made using PayPal.

Attributes

provider

type: literal = 'paypal'


id

type: string


The unique identifier for the payment.

paymentMethod

type: PaymentMethod

The payment method details.

amount

type: Money


The amount of the payment.

PaymentStripe

Represents a payment made using Stripe.

Attributes

provider

type: literal = 'stripe'


id

type: string


The unique identifier for the payment.

paymentMethod

type: PaymentMethod

The payment method details.

amount

type: Money


The amount of the payment.

PaymentGooglePay

Represents a payment made using Google Pay.

Attributes

provider

type: literal = 'googlePay'


token

type: string


The token provided by Google Pay for the payment.

id

type: string


The unique identifier for the payment.

paymentMethod

type: PaymentMethod

The payment method details.

amount

type: Money


The amount of the payment.

PaymentMethod

PaymentMethod is a discriminated union of possible payment method types.

type PaymentMethod =
| PaymentMethodCreditCard
| PaymentMethodKlarna
| PaymentMethodPaypal
| PaymentMethodStripe
| PaymentMethodGooglePay;

Each type represents the relevant payment method and shares the following attributes:

Attributes

type

type: 'creditCard' | 'klarna' | 'paypal' | 'stripe' | 'googlePay'


id

type: string


The unique identifier for the payment method.

displayName

type: string


The display name of the payment method.