Documentation
¶
Index ¶
- func GenerateIdempotencyKey(params map[string]any) string
- type APIError
- type CheckoutSession
- type CheckoutSessionsService
- type Client
- type Connection
- type ConnectionAuditEntry
- type ConnectionLabelsUpdate
- type ConnectionListOptions
- type ConnectionRequest
- type ConnectionStatusUpdate
- type ConnectionsService
- func (s *ConnectionsService) Create(ctx context.Context, req *ConnectionRequest, opts ...RequestOption) (*Connection, error)
- func (s *ConnectionsService) Delete(ctx context.Context, connectionID string, opts ...RequestOption) error
- func (s *ConnectionsService) Get(ctx context.Context, connectionID string) (*Connection, error)
- func (s *ConnectionsService) List(ctx context.Context, options ...ConnectionListOptions) ([]Connection, error)
- func (s *ConnectionsService) ListAudit(ctx context.Context, connectionID string, options ...ConnectionListOptions) ([]ConnectionAuditEntry, error)
- func (s *ConnectionsService) Test(ctx context.Context, req *ConnectionRequest, opts ...RequestOption) (bool, error)
- func (s *ConnectionsService) UpdateLabels(ctx context.Context, connectionID string, req *ConnectionLabelsUpdate, ...) (*Connection, error)
- func (s *ConnectionsService) UpdateStatus(ctx context.Context, connectionID string, req *ConnectionStatusUpdate, ...) (*Connection, error)
- func (s *ConnectionsService) Validate(ctx context.Context, connectionID string, opts ...RequestOption) (*Connection, error)
- type CreateCustomerRequest
- type CreatePaymentLinkRequest
- type Customer
- type CustomerListOptions
- type CustomersService
- func (s *CustomersService) Create(ctx context.Context, req *CreateCustomerRequest, opts ...RequestOption) (*Customer, error)
- func (s *CustomersService) Delete(ctx context.Context, customerID string, opts ...RequestOption) error
- func (s *CustomersService) Get(ctx context.Context, customerID string) (*Customer, error)
- func (s *CustomersService) List(ctx context.Context, options ...CustomerListOptions) ([]Customer, error)
- func (s *CustomersService) ListPayments(ctx context.Context, customerID string, options ...PaginationOptions) ([]PaymentSummary, error)
- func (s *CustomersService) Lookup(ctx context.Context, externalID string) (*Customer, error)
- func (s *CustomersService) Top(ctx context.Context, options ...TopCustomersOptions) ([]Customer, error)
- func (s *CustomersService) Update(ctx context.Context, customerID string, req *UpdateCustomerRequest, ...) (*Customer, error)
- type FraudPolicy
- type FraudPolicyInput
- type FraudService
- type Invoice
- type InvoiceListOptions
- type InvoiceUpdateRequest
- type InvoicesService
- func (s *InvoicesService) Cancel(ctx context.Context, invoiceID string, opts ...RequestOption) (*Invoice, error)
- func (s *InvoicesService) Get(ctx context.Context, invoiceID string) (*Invoice, error)
- func (s *InvoicesService) List(ctx context.Context, options ...InvoiceListOptions) ([]Invoice, error)
- func (s *InvoicesService) Retry(ctx context.Context, invoiceID string, opts ...RequestOption) (*Invoice, error)
- func (s *InvoicesService) Update(ctx context.Context, invoiceID string, req *InvoiceUpdateRequest, ...) (*Invoice, error)
- type Option
- type OutboundWebhook
- type PaginationOptions
- type Payment
- type PaymentIntentRequest
- type PaymentIntentUpdateRequest
- type PaymentLink
- type PaymentLinkListOptions
- type PaymentLinkStats
- type PaymentLinksService
- func (s *PaymentLinksService) Create(ctx context.Context, req *CreatePaymentLinkRequest, opts ...RequestOption) (*PaymentLink, error)
- func (s *PaymentLinksService) Delete(ctx context.Context, paymentLinkID string, opts ...RequestOption) error
- func (s *PaymentLinksService) Get(ctx context.Context, paymentLinkID string) (*PaymentLink, error)
- func (s *PaymentLinksService) GetByCode(ctx context.Context, code string) (*PaymentLink, error)
- func (s *PaymentLinksService) GetStats(ctx context.Context, paymentLinkID string) (*PaymentLinkStats, error)
- func (s *PaymentLinksService) List(ctx context.Context, options ...PaymentLinkListOptions) ([]PaymentLink, error)
- func (s *PaymentLinksService) ListPayments(ctx context.Context, paymentLinkID string, options ...PaginationOptions) ([]PaymentSummary, error)
- func (s *PaymentLinksService) Update(ctx context.Context, paymentLinkID string, req *UpdatePaymentLinkRequest, ...) (*PaymentLink, error)
- type PaymentRouteAttempt
- type PaymentStats
- type PaymentStatsOptions
- type PaymentSummary
- type PaymentsService
- func (s *PaymentsService) Cancel(ctx context.Context, paymentID string, opts ...RequestOption) (*Payment, error)
- func (s *PaymentsService) Confirm(ctx context.Context, paymentID string, opts ...RequestOption) (*Payment, error)
- func (s *PaymentsService) ConfirmIntent(ctx context.Context, paymentID, clientSecret string, opts ...RequestOption) (*Payment, error)
- func (s *PaymentsService) CreateIntent(ctx context.Context, req *PaymentIntentRequest, opts ...RequestOption) (*Payment, error)
- func (s *PaymentsService) Get(ctx context.Context, paymentID string) (*Payment, error)
- func (s *PaymentsService) GetStats(ctx context.Context, options *PaymentStatsOptions) (*PaymentStats, error)
- func (s *PaymentsService) List(ctx context.Context, limit, offset int) ([]PaymentSummary, error)
- func (s *PaymentsService) Refund(ctx context.Context, paymentID string, req *RefundRequest, ...) (*Refund, error)
- func (s *PaymentsService) Retry(ctx context.Context, paymentID string, opts ...RequestOption) (*Payment, error)
- func (s *PaymentsService) UpdateIntent(ctx context.Context, paymentID string, req *PaymentIntentUpdateRequest, ...) (*Payment, error)
- type Refund
- type RefundRequest
- type RequestOption
- type RoutingHints
- type RoutingRule
- type RoutingRuleCreateRequest
- type RoutingRuleUpdateRequest
- type RoutingRulesService
- func (s *RoutingRulesService) Create(ctx context.Context, req *RoutingRuleCreateRequest, opts ...RequestOption) (*RoutingRule, error)
- func (s *RoutingRulesService) Delete(ctx context.Context, ruleID string, opts ...RequestOption) error
- func (s *RoutingRulesService) Get(ctx context.Context, ruleID string) (*RoutingRule, error)
- func (s *RoutingRulesService) List(ctx context.Context) ([]RoutingRule, error)
- func (s *RoutingRulesService) Update(ctx context.Context, ruleID string, req *RoutingRuleUpdateRequest, ...) (*RoutingRule, error)
- type Subscription
- type SubscriptionListOptions
- type SubscriptionRequest
- type SubscriptionUpdateRequest
- type SubscriptionsService
- func (s *SubscriptionsService) Cancel(ctx context.Context, subscriptionID string, opts ...RequestOption) (*Subscription, error)
- func (s *SubscriptionsService) Create(ctx context.Context, req *SubscriptionRequest, opts ...RequestOption) (*Subscription, error)
- func (s *SubscriptionsService) Get(ctx context.Context, subscriptionID string) (*Subscription, error)
- func (s *SubscriptionsService) List(ctx context.Context, options ...SubscriptionListOptions) ([]Subscription, error)
- func (s *SubscriptionsService) Resume(ctx context.Context, subscriptionID string, opts ...RequestOption) (*Subscription, error)
- func (s *SubscriptionsService) Update(ctx context.Context, subscriptionID string, req *SubscriptionUpdateRequest, ...) (*Subscription, error)
- type TopCustomersOptions
- type UpdateCustomerRequest
- type UpdatePaymentLinkRequest
- type WebhookConfig
- type WebhookConfigRequest
- type WebhookEvent
- type WebhookEventListOptions
- type WebhooksService
- func (s *WebhooksService) DeleteConfig(ctx context.Context, opts ...RequestOption) error
- func (s *WebhooksService) GetConfig(ctx context.Context) (*WebhookConfig, error)
- func (s *WebhooksService) GetEvent(ctx context.Context, eventID string) (*WebhookEvent, error)
- func (s *WebhooksService) GetOutbound(ctx context.Context, outboundID string) (*OutboundWebhook, error)
- func (s *WebhooksService) ListEvents(ctx context.Context, options ...WebhookEventListOptions) ([]WebhookEvent, error)
- func (s *WebhooksService) ListOutbound(ctx context.Context, options ...PaginationOptions) ([]OutboundWebhook, error)
- func (s *WebhooksService) ReplayEvent(ctx context.Context, eventID string, opts ...RequestOption) (map[string]interface{}, error)
- func (s *WebhooksService) SendTest(ctx context.Context, opts ...RequestOption) (map[string]interface{}, error)
- func (s *WebhooksService) UpsertConfig(ctx context.Context, req *WebhookConfigRequest, opts ...RequestOption) (*WebhookConfig, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateIdempotencyKey ¶ added in v0.9.1
GenerateIdempotencyKey creates a deterministic idempotency key from input parameters. It uses a stable key ordering and a 5-minute time bucket (matching JS SDK behavior).
Types ¶
type CheckoutSession ¶ added in v0.9.1
type CheckoutSession struct {
ID string `json:"id"`
ClientSecret string `json:"client_secret"`
SessionSecret string `json:"session_secret"`
PaymentIntent *Payment `json:"payment_intent"`
ExpiresAt time.Time `json:"expires_at"`
}
CheckoutSession represents a server-created checkout session.
type CheckoutSessionsService ¶ added in v0.9.1
type CheckoutSessionsService service
CheckoutSessionsService handles server-created checkout sessions for browser SDKs.
func (*CheckoutSessionsService) Create ¶ added in v0.9.1
func (s *CheckoutSessionsService) Create(ctx context.Context, req *PaymentIntentRequest, opts ...RequestOption) (*CheckoutSession, error)
Create creates a checkout session that can be handed to browser SDKs.
API Docs: POST /v1/checkout/sessions
type Client ¶
type Client struct {
// Services
Payments *PaymentsService
Connections *ConnectionsService
Subscriptions *SubscriptionsService
Fraud *FraudService
Customers *CustomersService
PaymentLinks *PaymentLinksService
CheckoutSessions *CheckoutSessionsService
Webhooks *WebhooksService
RoutingRules *RoutingRulesService
Invoices *InvoicesService
// contains filtered or unexported fields
}
Client is the Reevit API client.
type Connection ¶
type Connection struct {
ID string `json:"id"`
Provider string `json:"provider"`
Mode string `json:"mode"`
Status string `json:"status"`
Capabilities map[string]interface{} `json:"capabilities"`
RoutingHints *RoutingHints `json:"routing_hints"`
Labels []string `json:"labels"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Connection represents a connection object.
type ConnectionAuditEntry ¶ added in v0.9.1
type ConnectionAuditEntry struct {
ID string `json:"id"`
Action string `json:"action"`
ActorID string `json:"actor_id"`
ActorType string `json:"actor_type"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
}
ConnectionAuditEntry describes an audit trail item for a connection.
type ConnectionLabelsUpdate ¶ added in v0.9.1
type ConnectionLabelsUpdate struct {
Labels []string `json:"labels"`
}
ConnectionLabelsUpdate updates the labels applied to a connection.
type ConnectionListOptions ¶ added in v0.9.1
type ConnectionListOptions struct {
Limit int
Offset int
Provider string
Mode string
Status string
}
ConnectionListOptions contains filters for connection listing.
type ConnectionRequest ¶
type ConnectionRequest struct {
Provider string `json:"provider"`
Mode string `json:"mode"`
Credentials map[string]interface{} `json:"credentials"`
Capabilities map[string]interface{} `json:"capabilities,omitempty"`
RoutingHints *RoutingHints `json:"routing_hints,omitempty"`
Labels []string `json:"labels,omitempty"`
}
ConnectionRequest represents a request to create a connection.
type ConnectionStatusUpdate ¶ added in v0.9.1
type ConnectionStatusUpdate struct {
Status string `json:"status"`
}
ConnectionStatusUpdate updates a connection status.
type ConnectionsService ¶
type ConnectionsService service
ConnectionsService handles communication with the connection related methods of the Reevit API.
func (*ConnectionsService) Create ¶
func (s *ConnectionsService) Create(ctx context.Context, req *ConnectionRequest, opts ...RequestOption) (*Connection, error)
Create creates a new connection.
API Docs: POST /v1/connections
func (*ConnectionsService) Delete ¶ added in v0.9.1
func (s *ConnectionsService) Delete(ctx context.Context, connectionID string, opts ...RequestOption) error
Delete removes a connection.
API Docs: DELETE /v1/connections/{id}
func (*ConnectionsService) Get ¶ added in v0.9.1
func (s *ConnectionsService) Get(ctx context.Context, connectionID string) (*Connection, error)
Get retrieves a connection by ID.
API Docs: GET /v1/connections/{id}
func (*ConnectionsService) List ¶
func (s *ConnectionsService) List(ctx context.Context, options ...ConnectionListOptions) ([]Connection, error)
List returns a list of connections.
API Docs: GET /v1/connections
func (*ConnectionsService) ListAudit ¶ added in v0.9.1
func (s *ConnectionsService) ListAudit(ctx context.Context, connectionID string, options ...ConnectionListOptions) ([]ConnectionAuditEntry, error)
ListAudit returns the audit history for a connection.
API Docs: GET /v1/connections/{id}/audit
func (*ConnectionsService) Test ¶
func (s *ConnectionsService) Test(ctx context.Context, req *ConnectionRequest, opts ...RequestOption) (bool, error)
Test tests a connection.
API Docs: POST /v1/connections/test
func (*ConnectionsService) UpdateLabels ¶ added in v0.9.1
func (s *ConnectionsService) UpdateLabels(ctx context.Context, connectionID string, req *ConnectionLabelsUpdate, opts ...RequestOption) (*Connection, error)
UpdateLabels updates connection labels.
API Docs: PATCH /v1/connections/{id}/labels
func (*ConnectionsService) UpdateStatus ¶ added in v0.9.1
func (s *ConnectionsService) UpdateStatus(ctx context.Context, connectionID string, req *ConnectionStatusUpdate, opts ...RequestOption) (*Connection, error)
UpdateStatus updates connection status.
API Docs: PATCH /v1/connections/{id}/status
func (*ConnectionsService) Validate ¶ added in v0.9.1
func (s *ConnectionsService) Validate(ctx context.Context, connectionID string, opts ...RequestOption) (*Connection, error)
Validate validates a connection configuration.
API Docs: POST /v1/connections/{id}/validate
type CreateCustomerRequest ¶ added in v0.9.1
type CreateCustomerRequest struct {
ExternalID string `json:"external_id,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
Name string `json:"name,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
CreateCustomerRequest represents a request to create a customer.
type CreatePaymentLinkRequest ¶ added in v0.9.1
type CreatePaymentLinkRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Reference string `json:"reference,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
CreatePaymentLinkRequest represents a request to create a payment link.
type Customer ¶ added in v0.9.1
type Customer struct {
ID string `json:"id"`
ExternalID string `json:"external_id"`
Email string `json:"email"`
Phone string `json:"phone"`
Name string `json:"name"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Customer represents a customer in Reevit.
type CustomerListOptions ¶ added in v0.9.1
CustomerListOptions contains supported filters for customer listing.
type CustomersService ¶ added in v0.9.1
type CustomersService service
CustomersService handles communication with customer related methods of the Reevit API.
func (*CustomersService) Create ¶ added in v0.9.1
func (s *CustomersService) Create(ctx context.Context, req *CreateCustomerRequest, opts ...RequestOption) (*Customer, error)
Create creates a new customer.
func (*CustomersService) Delete ¶ added in v0.9.1
func (s *CustomersService) Delete(ctx context.Context, customerID string, opts ...RequestOption) error
Delete removes a customer.
func (*CustomersService) List ¶ added in v0.9.1
func (s *CustomersService) List(ctx context.Context, options ...CustomerListOptions) ([]Customer, error)
List returns customers for the current org.
func (*CustomersService) ListPayments ¶ added in v0.9.1
func (s *CustomersService) ListPayments(ctx context.Context, customerID string, options ...PaginationOptions) ([]PaymentSummary, error)
ListPayments returns payment history for a customer.
func (*CustomersService) Top ¶ added in v0.9.1
func (s *CustomersService) Top(ctx context.Context, options ...TopCustomersOptions) ([]Customer, error)
Top returns top customers by value or volume.
func (*CustomersService) Update ¶ added in v0.9.1
func (s *CustomersService) Update(ctx context.Context, customerID string, req *UpdateCustomerRequest, opts ...RequestOption) (*Customer, error)
Update updates a customer by ID.
type FraudPolicy ¶
type FraudPolicy struct {
Prefer []string `json:"prefer"`
MaxAmount int64 `json:"max_amount"`
BlockedBins []string `json:"blocked_bins"`
AllowedBins []string `json:"allowed_bins"`
VelocityMaxPerMinute int `json:"velocity_max_per_minute"`
}
FraudPolicy represents the fraud policy configuration.
type FraudPolicyInput ¶
type FraudPolicyInput struct {
Prefer []string `json:"prefer,omitempty"`
MaxAmount int64 `json:"max_amount,omitempty"`
BlockedBins []string `json:"blocked_bins,omitempty"`
AllowedBins []string `json:"allowed_bins,omitempty"`
VelocityMaxPerMinute int `json:"velocity_max_per_minute,omitempty"`
}
FraudPolicyInput represents the fraud policy configuration for a payment.
type FraudService ¶
type FraudService service
FraudService handles communication with the fraud policy related methods of the Reevit API.
func (*FraudService) Get ¶
func (s *FraudService) Get(ctx context.Context) (*FraudPolicy, error)
Get retrieves the current fraud policy.
API Docs: GET /v1/policies/fraud
func (*FraudService) Update ¶
func (s *FraudService) Update(ctx context.Context, policy *FraudPolicy, opts ...RequestOption) (*FraudPolicy, error)
Update updates the fraud policy.
API Docs: POST /v1/policies/fraud
type Invoice ¶ added in v0.9.1
type Invoice struct {
ID string `json:"id"`
CustomerID string `json:"customer_id"`
Status string `json:"status"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
DueDate *time.Time `json:"due_date"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Invoice represents an invoice resource.
type InvoiceListOptions ¶ added in v0.9.1
InvoiceListOptions contains supported list filters.
type InvoiceUpdateRequest ¶ added in v0.9.1
type InvoiceUpdateRequest struct {
Status string `json:"status,omitempty"`
DueDate string `json:"due_date,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
InvoiceUpdateRequest represents a partial invoice update payload.
type InvoicesService ¶ added in v0.9.1
type InvoicesService service
InvoicesService handles invoice related methods of the Reevit API.
func (*InvoicesService) Cancel ¶ added in v0.9.1
func (s *InvoicesService) Cancel(ctx context.Context, invoiceID string, opts ...RequestOption) (*Invoice, error)
Cancel cancels an invoice.
func (*InvoicesService) List ¶ added in v0.9.1
func (s *InvoicesService) List(ctx context.Context, options ...InvoiceListOptions) ([]Invoice, error)
List returns invoices for the current org.
func (*InvoicesService) Retry ¶ added in v0.9.1
func (s *InvoicesService) Retry(ctx context.Context, invoiceID string, opts ...RequestOption) (*Invoice, error)
Retry retries invoice collection.
func (*InvoicesService) Update ¶ added in v0.9.1
func (s *InvoicesService) Update(ctx context.Context, invoiceID string, req *InvoiceUpdateRequest, opts ...RequestOption) (*Invoice, error)
Update updates an invoice.
type Option ¶
type Option func(*Client)
Option is a functional option for configuring the Client.
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client used for requests.
type OutboundWebhook ¶ added in v0.9.1
type OutboundWebhook struct {
ID string `json:"id"`
EventID string `json:"event_id"`
URL string `json:"url"`
Status string `json:"status"`
ResponseCode int `json:"response_code"`
AttemptCount int `json:"attempt_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
OutboundWebhook represents an outbound webhook delivery.
type PaginationOptions ¶ added in v0.9.1
PaginationOptions contains basic offset pagination filters.
type Payment ¶
type Payment struct {
ID string `json:"id"`
ConnectionID string `json:"connection_id"`
Provider string `json:"provider"`
ProviderRefID string `json:"provider_ref_id"`
Method string `json:"method"`
Status string `json:"status"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
FeeAmount int64 `json:"fee_amount"`
FeeCurrency string `json:"fee_currency"`
NetAmount int64 `json:"net_amount"`
CustomerID string `json:"customer_id"`
ClientSecret string `json:"client_secret"`
Metadata map[string]interface{} `json:"metadata"`
Route []PaymentRouteAttempt `json:"route"`
Reference string `json:"reference"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Payment represents a payment object.
type PaymentIntentRequest ¶
type PaymentIntentRequest struct {
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Method string `json:"method"`
Country string `json:"country"`
CustomerID string `json:"customer_id,omitempty"`
Reference string `json:"reference,omitempty"`
Policy *FraudPolicyInput `json:"policy,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
PaymentIntentRequest represents a request to create a payment intent.
type PaymentIntentUpdateRequest ¶ added in v0.9.1
type PaymentIntentUpdateRequest struct {
Amount *int64 `json:"amount,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
PaymentIntentUpdateRequest represents a partial update to a payment intent.
type PaymentLink ¶ added in v0.9.1
type PaymentLink struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
URL string `json:"url"`
Status string `json:"status"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
PaymentLink represents a hosted payment link.
type PaymentLinkListOptions ¶ added in v0.9.1
PaymentLinkListOptions contains supported list filters.
type PaymentLinkStats ¶ added in v0.9.1
type PaymentLinkStats struct {
Visits int64 `json:"visits"`
PaymentsCount int64 `json:"payments_count"`
TotalAmount int64 `json:"total_amount"`
ConversionRate float64 `json:"conversion_rate"`
}
PaymentLinkStats contains aggregate link performance data.
type PaymentLinksService ¶ added in v0.9.1
type PaymentLinksService service
PaymentLinksService handles communication with payment link related methods of the Reevit API.
func (*PaymentLinksService) Create ¶ added in v0.9.1
func (s *PaymentLinksService) Create(ctx context.Context, req *CreatePaymentLinkRequest, opts ...RequestOption) (*PaymentLink, error)
Create creates a payment link.
func (*PaymentLinksService) Delete ¶ added in v0.9.1
func (s *PaymentLinksService) Delete(ctx context.Context, paymentLinkID string, opts ...RequestOption) error
Delete removes a payment link.
func (*PaymentLinksService) Get ¶ added in v0.9.1
func (s *PaymentLinksService) Get(ctx context.Context, paymentLinkID string) (*PaymentLink, error)
Get fetches a payment link by ID.
func (*PaymentLinksService) GetByCode ¶ added in v0.9.1
func (s *PaymentLinksService) GetByCode(ctx context.Context, code string) (*PaymentLink, error)
GetByCode resolves a public payment link by code.
func (*PaymentLinksService) GetStats ¶ added in v0.9.1
func (s *PaymentLinksService) GetStats(ctx context.Context, paymentLinkID string) (*PaymentLinkStats, error)
GetStats returns aggregate stats for a payment link.
func (*PaymentLinksService) List ¶ added in v0.9.1
func (s *PaymentLinksService) List(ctx context.Context, options ...PaymentLinkListOptions) ([]PaymentLink, error)
List returns payment links for the current org.
func (*PaymentLinksService) ListPayments ¶ added in v0.9.1
func (s *PaymentLinksService) ListPayments(ctx context.Context, paymentLinkID string, options ...PaginationOptions) ([]PaymentSummary, error)
ListPayments lists payments created from a payment link.
func (*PaymentLinksService) Update ¶ added in v0.9.1
func (s *PaymentLinksService) Update(ctx context.Context, paymentLinkID string, req *UpdatePaymentLinkRequest, opts ...RequestOption) (*PaymentLink, error)
Update updates a payment link.
type PaymentRouteAttempt ¶
type PaymentRouteAttempt struct {
ConnectionID string `json:"connection_id"`
Provider string `json:"provider"`
Status string `json:"status"`
Error string `json:"error"`
Labels []string `json:"labels"`
RoutingHints *RoutingHints `json:"routing_hints"`
}
PaymentRouteAttempt represents a routing attempt.
type PaymentStats ¶ added in v0.9.1
type PaymentStats struct {
Count int64 `json:"count"`
SuccessCount int64 `json:"success_count"`
FailedCount int64 `json:"failed_count"`
PendingCount int64 `json:"pending_count"`
TotalAmount int64 `json:"total_amount"`
FeeAmount int64 `json:"fee_amount"`
NetAmount int64 `json:"net_amount"`
Currency string `json:"currency"`
SuccessRate float64 `json:"success_rate"`
AverageLatency float64 `json:"average_latency_ms"`
AdditionalStats map[string]interface{} `json:"-"`
}
PaymentStats captures aggregated payment metrics.
type PaymentStatsOptions ¶ added in v0.9.1
type PaymentStatsOptions struct {
From string
To string
Country string
Method string
Provider string
Status string
Interval string
}
PaymentStatsOptions contains filters for payment stats queries.
type PaymentSummary ¶
type PaymentSummary struct {
ID string `json:"id"`
ConnectionID string `json:"connection_id"`
Provider string `json:"provider"`
Method string `json:"method"`
Status string `json:"status"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
FeeAmount int64 `json:"fee_amount"`
FeeCurrency string `json:"fee_currency"`
NetAmount int64 `json:"net_amount"`
CustomerID string `json:"customer_id"`
Metadata map[string]interface{} `json:"metadata"`
Reference string `json:"reference"`
CreatedAt time.Time `json:"created_at"`
}
PaymentSummary represents a summary of a payment object.
type PaymentsService ¶
type PaymentsService service
PaymentsService handles communication with the payment related methods of the Reevit API.
func (*PaymentsService) Cancel ¶
func (s *PaymentsService) Cancel(ctx context.Context, paymentID string, opts ...RequestOption) (*Payment, error)
Cancel cancels a payment.
API Docs: POST /v1/payments/{id}/cancel
func (*PaymentsService) Confirm ¶
func (s *PaymentsService) Confirm(ctx context.Context, paymentID string, opts ...RequestOption) (*Payment, error)
Confirm confirms a payment after PSP callback.
API Docs: POST /v1/payments/{id}/confirm
func (*PaymentsService) ConfirmIntent ¶ added in v0.9.1
func (s *PaymentsService) ConfirmIntent(ctx context.Context, paymentID, clientSecret string, opts ...RequestOption) (*Payment, error)
ConfirmIntent confirms a payment intent using its client secret.
API Docs: POST /v1/payments/{id}/confirm-intent
func (*PaymentsService) CreateIntent ¶
func (s *PaymentsService) CreateIntent(ctx context.Context, req *PaymentIntentRequest, opts ...RequestOption) (*Payment, error)
CreateIntent creates a new payment intent.
API Docs: POST /v1/payments/intents
func (*PaymentsService) GetStats ¶ added in v0.9.1
func (s *PaymentsService) GetStats(ctx context.Context, options *PaymentStatsOptions) (*PaymentStats, error)
GetStats returns aggregated payment stats.
API Docs: GET /v1/payments/stats
func (*PaymentsService) List ¶
func (s *PaymentsService) List(ctx context.Context, limit, offset int) ([]PaymentSummary, error)
List returns a list of payments.
API Docs: GET /v1/payments
func (*PaymentsService) Refund ¶ added in v0.9.1
func (s *PaymentsService) Refund(ctx context.Context, paymentID string, req *RefundRequest, opts ...RequestOption) (*Refund, error)
Refund creates a refund for a payment.
API Docs: POST /v1/payments/{id}/refund
func (*PaymentsService) Retry ¶ added in v0.9.1
func (s *PaymentsService) Retry(ctx context.Context, paymentID string, opts ...RequestOption) (*Payment, error)
Retry retries a payment with the orchestration layer.
API Docs: POST /v1/payments/{id}/retry
func (*PaymentsService) UpdateIntent ¶ added in v0.9.1
func (s *PaymentsService) UpdateIntent(ctx context.Context, paymentID string, req *PaymentIntentUpdateRequest, opts ...RequestOption) (*Payment, error)
UpdateIntent updates a payment intent.
API Docs: PATCH /v1/payments/intents/{id}
type Refund ¶ added in v0.9.1
type Refund struct {
ID string `json:"id"`
PaymentID string `json:"payment_id"`
Status string `json:"status"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Reason string `json:"reason"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Refund represents a refund record returned by the API.
type RefundRequest ¶ added in v0.9.1
type RefundRequest struct {
Amount int64 `json:"amount,omitempty"`
Reason string `json:"reason,omitempty"`
}
RefundRequest represents a payment refund request.
type RequestOption ¶
RequestOption is a functional option for configuring API requests.
func WithIdempotencyKey ¶
func WithIdempotencyKey(key string) RequestOption
WithIdempotencyKey sets the idempotency key for the request.
type RoutingHints ¶
type RoutingHints struct {
CountryPreference []string `json:"country_preference"`
MethodBias map[string]string `json:"method_bias"`
FallbackOnly bool `json:"fallback_only"`
}
RoutingHints represents routing preferences.
type RoutingRule ¶ added in v0.9.1
type RoutingRule struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Priority int `json:"priority"`
Conditions map[string]interface{} `json:"conditions"`
Action map[string]interface{} `json:"action"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
RoutingRule represents a routing rule resource.
type RoutingRuleCreateRequest ¶ added in v0.9.1
type RoutingRuleCreateRequest struct {
Name string `json:"name"`
Status string `json:"status,omitempty"`
Priority int `json:"priority,omitempty"`
Conditions map[string]interface{} `json:"conditions,omitempty"`
Action map[string]interface{} `json:"action,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
RoutingRuleCreateRequest represents a routing rule create payload.
type RoutingRuleUpdateRequest ¶ added in v0.9.1
type RoutingRuleUpdateRequest struct {
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Priority int `json:"priority,omitempty"`
Conditions map[string]interface{} `json:"conditions,omitempty"`
Action map[string]interface{} `json:"action,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
RoutingRuleUpdateRequest represents a routing rule update payload.
type RoutingRulesService ¶ added in v0.9.1
type RoutingRulesService service
RoutingRulesService handles routing rule related methods of the Reevit API.
func (*RoutingRulesService) Create ¶ added in v0.9.1
func (s *RoutingRulesService) Create(ctx context.Context, req *RoutingRuleCreateRequest, opts ...RequestOption) (*RoutingRule, error)
Create creates a routing rule.
func (*RoutingRulesService) Delete ¶ added in v0.9.1
func (s *RoutingRulesService) Delete(ctx context.Context, ruleID string, opts ...RequestOption) error
Delete removes a routing rule.
func (*RoutingRulesService) Get ¶ added in v0.9.1
func (s *RoutingRulesService) Get(ctx context.Context, ruleID string) (*RoutingRule, error)
Get fetches a routing rule by ID.
func (*RoutingRulesService) List ¶ added in v0.9.1
func (s *RoutingRulesService) List(ctx context.Context) ([]RoutingRule, error)
List returns routing rules for the current org.
func (*RoutingRulesService) Update ¶ added in v0.9.1
func (s *RoutingRulesService) Update(ctx context.Context, ruleID string, req *RoutingRuleUpdateRequest, opts ...RequestOption) (*RoutingRule, error)
Update updates a routing rule.
type Subscription ¶
type Subscription struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
CustomerID string `json:"customer_id"`
PlanID string `json:"plan_id"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Method string `json:"method"`
Interval string `json:"interval"`
Status string `json:"status"`
NextRenewalAt time.Time `json:"next_renewal_at"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Subscription represents a subscription object.
type SubscriptionListOptions ¶ added in v0.9.1
type SubscriptionListOptions struct {
Limit int
Offset int
Status string
CustomerID string
PlanID string
}
SubscriptionListOptions contains list filters for subscriptions.
type SubscriptionRequest ¶
type SubscriptionRequest struct {
CustomerID string `json:"customer_id"`
PlanID string `json:"plan_id"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Method string `json:"method"`
Interval string `json:"interval"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
SubscriptionRequest represents a request to create a subscription.
type SubscriptionUpdateRequest ¶ added in v0.9.1
type SubscriptionUpdateRequest struct {
PlanID string `json:"plan_id,omitempty"`
Method string `json:"method,omitempty"`
Interval string `json:"interval,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
SubscriptionUpdateRequest represents a partial update to a subscription.
type SubscriptionsService ¶
type SubscriptionsService service
SubscriptionsService handles communication with the subscription related methods of the Reevit API.
func (*SubscriptionsService) Cancel ¶ added in v0.9.1
func (s *SubscriptionsService) Cancel(ctx context.Context, subscriptionID string, opts ...RequestOption) (*Subscription, error)
Cancel cancels a subscription.
API Docs: POST /v1/subscriptions/{id}/cancel
func (*SubscriptionsService) Create ¶
func (s *SubscriptionsService) Create(ctx context.Context, req *SubscriptionRequest, opts ...RequestOption) (*Subscription, error)
Create creates a new subscription.
API Docs: POST /v1/subscriptions
func (*SubscriptionsService) Get ¶ added in v0.9.1
func (s *SubscriptionsService) Get(ctx context.Context, subscriptionID string) (*Subscription, error)
Get retrieves a subscription by ID.
API Docs: GET /v1/subscriptions/{id}
func (*SubscriptionsService) List ¶
func (s *SubscriptionsService) List(ctx context.Context, options ...SubscriptionListOptions) ([]Subscription, error)
List returns a list of subscriptions.
API Docs: GET /v1/subscriptions
func (*SubscriptionsService) Resume ¶ added in v0.9.1
func (s *SubscriptionsService) Resume(ctx context.Context, subscriptionID string, opts ...RequestOption) (*Subscription, error)
Resume resumes a canceled subscription.
API Docs: POST /v1/subscriptions/{id}/resume
func (*SubscriptionsService) Update ¶ added in v0.9.1
func (s *SubscriptionsService) Update(ctx context.Context, subscriptionID string, req *SubscriptionUpdateRequest, opts ...RequestOption) (*Subscription, error)
Update updates a subscription.
API Docs: PATCH /v1/subscriptions/{id}
type TopCustomersOptions ¶ added in v0.9.1
TopCustomersOptions contains filters for top customer queries.
type UpdateCustomerRequest ¶ added in v0.9.1
type UpdateCustomerRequest struct {
ExternalID string `json:"external_id,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
Name string `json:"name,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
UpdateCustomerRequest represents a partial customer update.
type UpdatePaymentLinkRequest ¶ added in v0.9.1
type UpdatePaymentLinkRequest struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
UpdatePaymentLinkRequest represents a partial payment link update.
type WebhookConfig ¶ added in v0.9.1
type WebhookConfig struct {
ID string `json:"id"`
URL string `json:"url"`
Status string `json:"status"`
Events []string `json:"events"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
WebhookConfig represents the org-level outbound webhook configuration.
type WebhookConfigRequest ¶ added in v0.9.1
type WebhookConfigRequest struct {
URL string `json:"url"`
Events []string `json:"events,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
WebhookConfigRequest represents a webhook config upsert payload.
type WebhookEvent ¶ added in v0.9.1
type WebhookEvent struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"`
AttemptCount int `json:"attempt_count"`
Data map[string]interface{} `json:"data"`
CreatedAt time.Time `json:"created_at"`
}
WebhookEvent represents a recorded webhook event.
type WebhookEventListOptions ¶ added in v0.9.1
WebhookEventListOptions contains filters for webhook event listing.
type WebhooksService ¶ added in v0.9.1
type WebhooksService service
WebhooksService handles communication with webhook related methods of the Reevit API.
func (*WebhooksService) DeleteConfig ¶ added in v0.9.1
func (s *WebhooksService) DeleteConfig(ctx context.Context, opts ...RequestOption) error
DeleteConfig removes the outbound webhook configuration.
func (*WebhooksService) GetConfig ¶ added in v0.9.1
func (s *WebhooksService) GetConfig(ctx context.Context) (*WebhookConfig, error)
GetConfig fetches the current outbound webhook configuration.
func (*WebhooksService) GetEvent ¶ added in v0.9.1
func (s *WebhooksService) GetEvent(ctx context.Context, eventID string) (*WebhookEvent, error)
GetEvent fetches a single webhook event.
func (*WebhooksService) GetOutbound ¶ added in v0.9.1
func (s *WebhooksService) GetOutbound(ctx context.Context, outboundID string) (*OutboundWebhook, error)
GetOutbound fetches a single outbound delivery.
func (*WebhooksService) ListEvents ¶ added in v0.9.1
func (s *WebhooksService) ListEvents(ctx context.Context, options ...WebhookEventListOptions) ([]WebhookEvent, error)
ListEvents returns recorded webhook events.
func (*WebhooksService) ListOutbound ¶ added in v0.9.1
func (s *WebhooksService) ListOutbound(ctx context.Context, options ...PaginationOptions) ([]OutboundWebhook, error)
ListOutbound returns outbound deliveries.
func (*WebhooksService) ReplayEvent ¶ added in v0.9.1
func (s *WebhooksService) ReplayEvent(ctx context.Context, eventID string, opts ...RequestOption) (map[string]interface{}, error)
ReplayEvent replays a recorded webhook event.
func (*WebhooksService) SendTest ¶ added in v0.9.1
func (s *WebhooksService) SendTest(ctx context.Context, opts ...RequestOption) (map[string]interface{}, error)
SendTest dispatches a test webhook.
func (*WebhooksService) UpsertConfig ¶ added in v0.9.1
func (s *WebhooksService) UpsertConfig(ctx context.Context, req *WebhookConfigRequest, opts ...RequestOption) (*WebhookConfig, error)
UpsertConfig creates or updates the outbound webhook configuration.