Documentation
¶
Overview ¶
Package acppayment provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- Constants
- type APIVersion
- type AcceptLanguage
- type Address
- type Allowance
- type AllowanceReason
- type Authorization
- type ContentType
- type DelegatePaymentJSONRequestBody
- type DelegatePaymentParams
- type DelegatePaymentRequest
- type DelegatePaymentResponse
- type Handler
- type IdempotencyKey
- type Option
- type PaymentMethodCard
- type PaymentMethodCardCardNumberType
- type PaymentMethodCardChecksPerformed
- type PaymentMethodCardDisplayCardFundingType
- type PaymentMethodCardType
- type Provider
- type RequestId
- type RiskSignal
- type RiskSignalAction
- type RiskSignalType
- type Signature
- type Timestamp
- type UserAgent
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
// City City or locality
City string `json:"city"`
// Country ISO-3166-1 alpha-2 country code
Country string `json:"country"`
// LineOne Street address line 1 (e.g., street and number)
LineOne string `json:"line_one"`
// LineTwo Street address line 2 (e.g., apartment, suite, unit)
LineTwo *string `json:"line_two,omitempty"`
// Name Full name of the person at this address
Name string `json:"name"`
// PostalCode ZIP or postal code
PostalCode string `json:"postal_code"`
// State State, province, or region
State string `json:"state"`
}
Address defines model for Address.
type Allowance ¶
type Allowance struct {
// CheckoutSessionId Identifier of the checkout session this payment is for
CheckoutSessionId string `json:"checkout_session_id"`
// Currency ISO-4217 three-letter lowercase currency code (e.g., usd)
Currency string `json:"currency"`
// ExpiresAt ISO 8601 timestamp when this allowance expires
ExpiresAt time.Time `json:"expires_at"`
// MaxAmount Maximum charge amount in minor units (e.g. 100 cents for $1.00 or 100 for ¥100)
MaxAmount int `json:"max_amount"`
// MerchantId Unique identifier for the merchant authorized to use this token
MerchantId string `json:"merchant_id"`
// Reason Usage pattern for this allowance; currently only one_time is supported
Reason AllowanceReason `json:"reason"`
}
Allowance defines model for Allowance.
type AllowanceReason ¶
type AllowanceReason string
AllowanceReason Usage pattern for this allowance; currently only one_time is supported
const (
OneTime AllowanceReason = "one_time"
)
Defines values for AllowanceReason.
type DelegatePaymentJSONRequestBody ¶
type DelegatePaymentJSONRequestBody = DelegatePaymentRequest
DelegatePaymentJSONRequestBody defines body for DelegatePayment for application/json ContentType.
type DelegatePaymentParams ¶
type DelegatePaymentParams struct {
// Authorization Bearer token for API authentication (e.g., Bearer sk_live_123)
Authorization Authorization `json:"Authorization"`
// ContentType Must be application/json
ContentType ContentType `json:"Content-Type"`
// AcceptLanguage Preferred language for response messages (e.g., en-US)
AcceptLanguage *AcceptLanguage `json:"Accept-Language,omitempty"`
// UserAgent Client application identifier
UserAgent *UserAgent `json:"User-Agent,omitempty"`
// IdempotencyKey Unique key to safely retry requests without duplicate token creation
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
// RequestId Unique identifier for request tracking and debugging
RequestId *RequestId `json:"Request-Id,omitempty"`
// Signature Detached JSON signature for request verification
Signature *Signature `json:"Signature,omitempty"`
// Timestamp ISO 8601 timestamp for request timing validation
Timestamp *Timestamp `json:"Timestamp,omitempty"`
// APIVersion API version date in format YYYY-MM-DD (e.g., 2026-01-30)
APIVersion APIVersion `json:"API-Version"`
}
DelegatePaymentParams defines parameters for DelegatePayment.
type DelegatePaymentRequest ¶
type DelegatePaymentRequest struct {
Allowance Allowance `json:"allowance"`
BillingAddress *Address `json:"billing_address,omitempty"`
// Metadata Additional metadata for the request
Metadata map[string]string `json:"metadata"`
PaymentMethod PaymentMethodCard `json:"payment_method"`
// RiskSignals List of risk assessment signals from fraud detection
RiskSignals []RiskSignal `json:"risk_signals"`
}
DelegatePaymentRequest defines model for DelegatePaymentRequest.
type DelegatePaymentResponse ¶
type DelegatePaymentResponse struct {
// Created ISO 8601 timestamp when the token was created
Created time.Time `json:"created"`
// Id Unique vault token identifier (vt_...)
Id string `json:"id"`
// Metadata Metadata echoed from the request plus system-added fields
Metadata map[string]string `json:"metadata"`
}
DelegatePaymentResponse defines model for DelegatePaymentResponse.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler exposes the delegate payment API over net/http.
func NewHandler ¶
func NewHandler(service Provider, authorizer acpauth.Authorizer, opts ...Option) *Handler
NewHandler returns a Handler that serves the ACP delegated payment API.
type Option ¶
type Option func(*config)
Option configures a Handler during construction.
func WithServeMux ¶
WithServeMux registers ACP payment routes on mux instead of creating a new http.ServeMux.
type PaymentMethodCard ¶
type PaymentMethodCard struct {
// CardNumberType Whether the number is a raw card number (fpan) or a network token
CardNumberType PaymentMethodCardCardNumberType `json:"card_number_type"`
// ChecksPerformed List of verification checks performed on the card
ChecksPerformed *[]PaymentMethodCardChecksPerformed `json:"checks_performed,omitempty"`
// Cryptogram Dynamic cryptogram for tokenized card transactions
Cryptogram *string `json:"cryptogram,omitempty"`
// Cvc Card verification code (3 or 4 digits)
Cvc *string `json:"cvc,omitempty"`
// DisplayBrand Card brand for display purposes (e.g., visa, mastercard)
DisplayBrand *string `json:"display_brand,omitempty"`
// DisplayCardFundingType Card funding type for display purposes
DisplayCardFundingType PaymentMethodCardDisplayCardFundingType `json:"display_card_funding_type"`
// DisplayLast4 Last 4 digits of card number for display purposes
DisplayLast4 *string `json:"display_last4,omitempty"`
// DisplayWalletType Digital wallet provider if card is from a wallet (e.g., Apple Pay, Google Pay)
DisplayWalletType *string `json:"display_wallet_type,omitempty"`
// EciValue Electronic Commerce Indicator for 3DS authentication status
EciValue *string `json:"eci_value,omitempty"`
// ExpMonth Two-digit expiration month (01-12)
ExpMonth *string `json:"exp_month,omitempty"`
// ExpYear Four-digit expiration year (e.g., 2026)
ExpYear *string `json:"exp_year,omitempty"`
// Iin Issuer Identification Number (first 6 digits of card)
Iin *string `json:"iin,omitempty"`
// Metadata Additional metadata about the payment method
Metadata map[string]string `json:"metadata"`
// Name Cardholder name as it appears on the card
Name *string `json:"name,omitempty"`
// Number network token or fallback fpan value
Number string `json:"number"`
// Type Payment method type, always 'card'
Type PaymentMethodCardType `json:"type"`
// Virtual Whether this is a virtual card number
Virtual *bool `json:"virtual,omitempty"`
}
PaymentMethodCard defines model for PaymentMethodCard.
type PaymentMethodCardCardNumberType ¶
type PaymentMethodCardCardNumberType string
PaymentMethodCardCardNumberType Whether the number is a raw card number (fpan) or a network token
const ( Fpan PaymentMethodCardCardNumberType = "fpan" NetworkToken PaymentMethodCardCardNumberType = "network_token" )
Defines values for PaymentMethodCardCardNumberType.
type PaymentMethodCardChecksPerformed ¶
type PaymentMethodCardChecksPerformed string
PaymentMethodCardChecksPerformed defines model for PaymentMethodCard.ChecksPerformed.
const ( Ani PaymentMethodCardChecksPerformed = "ani" Auth0 PaymentMethodCardChecksPerformed = "auth0" Avs PaymentMethodCardChecksPerformed = "avs" Cvv PaymentMethodCardChecksPerformed = "cvv" )
Defines values for PaymentMethodCardChecksPerformed.
type PaymentMethodCardDisplayCardFundingType ¶
type PaymentMethodCardDisplayCardFundingType string
PaymentMethodCardDisplayCardFundingType Card funding type for display purposes
const ( Credit PaymentMethodCardDisplayCardFundingType = "credit" Debit PaymentMethodCardDisplayCardFundingType = "debit" Prepaid PaymentMethodCardDisplayCardFundingType = "prepaid" )
Defines values for PaymentMethodCardDisplayCardFundingType.
type PaymentMethodCardType ¶
type PaymentMethodCardType string
PaymentMethodCardType Payment method type, always 'card'
const (
Card PaymentMethodCardType = "card"
)
Defines values for PaymentMethodCardType.
type Provider ¶
type Provider interface {
// DelegatePayment tokenizes the supplied payment method for later checkout completion.
DelegatePayment(ctx context.Context, req DelegatePaymentRequest) (*DelegatePaymentResponse, error)
}
Provider owns delegated payment tokenization.
type RiskSignal ¶
type RiskSignal struct {
// Action Recommended action based on risk assessment
Action RiskSignalAction `json:"action"`
// Score Risk score indicating severity level
Score int `json:"score"`
// Type Type of risk signal detected
Type RiskSignalType `json:"type"`
}
RiskSignal defines model for RiskSignal.
type RiskSignalAction ¶
type RiskSignalAction string
RiskSignalAction Recommended action based on risk assessment
const ( Authorized RiskSignalAction = "authorized" Blocked RiskSignalAction = "blocked" ManualReview RiskSignalAction = "manual_review" )
Defines values for RiskSignalAction.
type RiskSignalType ¶
type RiskSignalType string
RiskSignalType Type of risk signal detected
const (
CardTesting RiskSignalType = "card_testing"
)
Defines values for RiskSignalType.