Documentation
¶
Overview ¶
Package payrex-go provides Go applications easy access to the PayRex API.
Index ¶
- Variables
- func NotNil[T any](v T) *T
- func Slice[T any](values ...T) []T
- func SliceNotNil[T any](values ...T) *[]T
- type Address
- type AllowedFunding
- type Billing
- type BillingStatement
- type BillingStatementCreateParams
- type BillingStatementLineItem
- type BillingStatementLineItemCreateParams
- type BillingStatementLineItemUpdateParams
- type BillingStatementListParams
- type BillingStatementStatus
- type BillingStatementUpdateParams
- type CaptureType
- type Card
- type CheckoutSession
- type CheckoutSessionCreateParams
- type CheckoutSessionLineItem
- type CheckoutSessionLineItemParams
- type CheckoutSessionStatus
- type Client
- type Currency
- type Customer
- type CustomerCreateParams
- type CustomerListParams
- type CustomerSession
- type CustomerSessionComponent
- type CustomerSessionComponentValue
- type CustomerSessionCreateParams
- type CustomerUpdateParams
- type DeletedResource
- type Error
- type ErrorMessage
- type Event
- func (e *Event) BillingStatement() (*BillingStatement, error)
- func (e *Event) CheckoutSession() (*CheckoutSession, error)
- func (e *Event) MustBillingStatement() *BillingStatement
- func (e *Event) MustCheckoutSession() *CheckoutSession
- func (e *Event) MustPaymentIntent() *PaymentIntent
- func (e *Event) MustPayout() *Payout
- func (e *Event) MustRefund() *Refund
- func (e *Event) PaymentIntent() (*PaymentIntent, error)
- func (e *Event) Payout() (*Payout, error)
- func (e *Event) Refund() (*Refund, error)
- type EventResourceType
- type EventType
- type List
- type ListCheckoutSessionsParams
- type Payment
- type PaymentIntent
- type PaymentIntentCaptureParams
- type PaymentIntentCreateParams
- type PaymentIntentNextAction
- type PaymentIntentStatus
- type PaymentMethod
- type PaymentMethodOptions
- type PaymentMethodType
- type PaymentSettings
- type PaymentStatus
- type PaymentUpdateParams
- type Payout
- type PayoutDestination
- type PayoutStatus
- type PayoutTransaction
- type PayoutTransactionListParams
- type PayoutTransactionType
- type Refund
- type RefundCreateParams
- type RefundReason
- type RefundStatus
- type RefundUpdateParams
- type Resource
- type ServiceBillingStatementLineItems
- func (s *ServiceBillingStatementLineItems) Create(params *BillingStatementLineItemCreateParams) (*BillingStatementLineItem, error)
- func (s *ServiceBillingStatementLineItems) Delete(id string) (*DeletedResource, error)
- func (s *ServiceBillingStatementLineItems) Update(id string, params *BillingStatementLineItemUpdateParams) (*BillingStatementLineItem, error)
- type ServiceBillingStatements
- func (s *ServiceBillingStatements) Create(params *BillingStatementCreateParams) (*BillingStatement, error)
- func (s *ServiceBillingStatements) Delete(id string) (*DeletedResource, error)
- func (s *ServiceBillingStatements) Finalize(id string) (*BillingStatement, error)
- func (s *ServiceBillingStatements) List(params *BillingStatementListParams) iter.Seq2[*BillingStatement, error]
- func (s *ServiceBillingStatements) MarkUncollectible(id string) (*BillingStatement, error)
- func (s *ServiceBillingStatements) Retrieve(id string) (*BillingStatement, error)
- func (s *ServiceBillingStatements) Send(id string) (*BillingStatement, error)
- func (s *ServiceBillingStatements) Update(id string, params *BillingStatementUpdateParams) (*BillingStatement, error)
- func (s *ServiceBillingStatements) Void(id string) (*BillingStatement, error)
- type ServiceCheckoutSessions
- func (s *ServiceCheckoutSessions) Create(params *CheckoutSessionCreateParams) (*CheckoutSession, error)
- func (s *ServiceCheckoutSessions) Expire(id string) (*CheckoutSession, error)
- func (s *ServiceCheckoutSessions) List(params *ListCheckoutSessionsParams) iter.Seq2[*CheckoutSession, error]
- func (s *ServiceCheckoutSessions) Retrieve(id string) (*CheckoutSession, error)
- type ServiceCustomerSessions
- type ServiceCustomers
- func (s *ServiceCustomers) Create(params *CustomerCreateParams) (*Customer, error)
- func (s *ServiceCustomers) Delete(id string) (*DeletedResource, error)
- func (s *ServiceCustomers) List(params *CustomerListParams) iter.Seq2[*Customer, error]
- func (s *ServiceCustomers) Retrieve(id string) (*Customer, error)
- func (s *ServiceCustomers) Update(id string, params *CustomerUpdateParams) (*Customer, error)
- type ServicePaymentIntents
- func (s *ServicePaymentIntents) Cancel(id string) (*PaymentIntent, error)
- func (s *ServicePaymentIntents) Capture(id string, params *PaymentIntentCaptureParams) (*PaymentIntent, error)
- func (s *ServicePaymentIntents) Create(params *PaymentIntentCreateParams) (*PaymentIntent, error)
- func (s *ServicePaymentIntents) Retrieve(id string) (*PaymentIntent, error)
- type ServicePayments
- type ServicePayouts
- type ServiceRefunds
- type ServiceWebhooks
- func (s *ServiceWebhooks) Create(params *WebhookCreateParams) (*Webhook, error)
- func (s *ServiceWebhooks) Delete(id string) (*DeletedResource, error)
- func (s *ServiceWebhooks) Disable(id string) (*Webhook, error)
- func (s *ServiceWebhooks) Enable(id string) (*Webhook, error)
- func (s *ServiceWebhooks) List(params *WebhookListParams) iter.Seq2[*Webhook, error]
- func (s *ServiceWebhooks) Retrieve(id string) (*Webhook, error)
- func (s *ServiceWebhooks) Update(id string, params *WebhookUpdateParams) (*Webhook, error)
- type Webhook
- type WebhookCreateParams
- type WebhookListParams
- type WebhookStatus
- type WebhookUpdateParams
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoSignatureHeader = errors.New("header 'Payrex-Signature' not found in request") ErrInvalidSignatureFormat = errors.New("invalid PayRex signature format") ErrInvalidSignature = errors.New("invalid PayRex signature") )
var ErrNilParams = errors.New("expected params argument to not be nil")
Functions ¶
func NotNil ¶
func NotNil[T any](v T) *T
NotNil returns a pointer to the given value of type T.
Useful for passing in string/int literals to nullable *string/*int fields in Params structs.
In Go 1.26 this will be unnecessary, as the new() function can now accept expressions.
func Slice ¶
func Slice[T any](values ...T) []T
Slice returns a slice containing all the passed in values.
Useful for assigning a slice literal to a Params struct's slice field with type inference, instead of manually declaring the slice's element type.
func SliceNotNil ¶
func SliceNotNil[T any](values ...T) *[]T
SliceNotNil returns a slice pointer containing all the passed in values.
Useful for assigning a slice literal to a Params struct's nullable slice field with type inference, instead of manually declaring the slice's element type.
Types ¶
type AllowedFunding ¶
type AllowedFunding string
const ( AllowedFundingCredit AllowedFunding = "credit" AllowedFundingDebit AllowedFunding = "debit" )
type BillingStatement ¶
type BillingStatement struct {
Resource
Status BillingStatementStatus `json:"status"`
Amount int `json:"amount"`
Currency Currency `json:"currency"`
LineItems []struct {
ID string `json:"id"`
BillingStatementID string `json:"billing_statement_id"`
Description string `json:"description"`
UnitPrice int `json:"unit_price"`
Quantity int `json:"quantity"`
} `json:"line_items"`
PaymentIntent *PaymentIntent `json:"payment_intent"`
BillingDetailsCollection string `json:"billing_details_collection"`
CustomerID string `json:"customer_id"`
Description *string `json:"description"`
MerchantName *string `json:"billing_statement_merchant_name"`
MerchantNumber *string `json:"billing_statement_merchant_number"`
URL *string `json:"billing_statement_url"`
StatementDescriptor *string `json:"statement_descriptor"`
PaymentSettings PaymentSettings `json:"payment_settings"`
Metadata *map[string]string `json:"metadata"`
}
BillingStatement is used to notify your application about events in your PayRex account.
Service: ServiceBillingStatements
API reference: https://docs.payrexhq.com/docs/api/billing_statements
type BillingStatementCreateParams ¶
type BillingStatementCreateParams struct {
CustomerID string `form:"customer_id"`
Currency Currency `form:"currency"`
Description *string `form:"description"`
BillingDetailsCollection *string `form:"billing_details_collection"`
PaymentSettings PaymentSettings `form:"payment_settings"`
Metadata *map[string]string `form:"metadata"`
}
BillingStatementCreateParams represents the available ServiceBillingStatements.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/billing_statements/create
type BillingStatementLineItem ¶
type BillingStatementLineItem struct {
Resource
SecretKey string `json:"secret_key"`
BillingStatementID string `json:"billing_statement_id"`
Description string `json:"description"`
UnitPrice int `json:"unit_price"`
Quantity int `json:"quantity"`
}
BillingStatementLineItem is a line item of a BillingStatement that pertains to a business's products or services.
Service: ServiceBillingStatementLineItems
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items
type BillingStatementLineItemCreateParams ¶
type BillingStatementLineItemCreateParams struct {
BillingStatementID string `form:"billing_statement_id"`
Description string `form:"description"`
UnitPrice int `form:"unit_price"`
Quantity int `form:"quantity"`
}
BillingStatementLineItemCreateParams represents the available ServiceBillingStatementLineItems.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items/create
type BillingStatementLineItemUpdateParams ¶
type BillingStatementLineItemUpdateParams struct {
Description *string `form:"description"`
UnitPrice *int `form:"unit_price"`
Quantity *int `form:"quantity"`
}
BillingStatementLineItemUpdateParams represents the available ServiceBillingStatementLineItems.Update parameters.
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items/update
type BillingStatementListParams ¶
type BillingStatementListParams struct {
Limit *int `form:"int"`
Before *string `form:"before"`
After *string `form:"after"`
}
BillingStatementListParams represents the available ServiceBillingStatements.List parameters.
API reference: https://docs.payrexhq.com/docs/api/billing_statements/list
type BillingStatementStatus ¶
type BillingStatementStatus string
BillingStatementStatus enumerates the valid values for the BillingStatement.Status field.
const ( BillingStatementStatusOpen BillingStatementStatus = "open" BillingStatementStatusDraft BillingStatementStatus = "draft" BillingStatementStatusPaid BillingStatementStatus = "paid" BillingStatementStatusVoid BillingStatementStatus = "void" BillingStatementStatusUncollectible BillingStatementStatus = "uncollectible" )
type BillingStatementUpdateParams ¶
type BillingStatementUpdateParams struct {
CustomerID *string `form:"customer_id"`
Description *string `form:"description"`
BillingDetailsCollection *string `form:"billing_details_collection"`
PaymentSettings *PaymentSettings `form:"payment_settings"`
Metadata *map[string]string `form:"metadata"`
}
BillingStatementUpdateParams represents the available ServiceBillingStatements.Update parameters.
API reference: https://docs.payrexhq.com/docs/api/billing_statements/update
type CaptureType ¶
type CaptureType string
const ( CaptureTypeAutomatic CaptureType = "automatic" CaptureTypeManual CaptureType = "manual" )
type Card ¶
type Card struct {
CaptureType CaptureType `json:"capture_type" form:"capture_type"`
AllowedBins *[]string `json:"allowed_bins" form:"allowed_bins"`
AllowedFunding *[]AllowedFunding `json:"allowed_funding" form:"allowed_funding"`
}
type CheckoutSession ¶
type CheckoutSession struct {
Resource
URL string `json:"url"`
BillingDetailsCollection string `json:"billing_details_collection"`
CustomerReferenceID *string `json:"customer_reference_id"`
ClientSecret string `json:"client_secret"`
Status CheckoutSessionStatus `json:"status"`
Currency Currency `json:"currency"`
LineItems []CheckoutSessionLineItem `json:"line_items"`
PaymentIntent *PaymentIntent `json:"payment_intent"`
Metadata *map[string]string `json:"metadata"`
SuccessURL string `json:"success_url"`
CancelURL string `json:"cancel_url"`
PaymentMethods []PaymentMethod `json:"payment_methods"`
Description *string `json:"description"`
SubmitType string `json:"submit_type"`
ExpiresAt int `json:"expires_at"`
}
CheckoutSession is used to notify your application about events in your PayRex account.
Service: ServiceCheckoutSessions
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions
type CheckoutSessionCreateParams ¶
type CheckoutSessionCreateParams struct {
CustomerReferenceID *string `form:"customer_reference_id"`
Currency Currency `form:"currency"`
LineItems []CheckoutSessionLineItemParams `form:"line_items"`
Metadata *map[string]string `form:"metadata"`
SuccessURL string `form:"success_url"`
CancelURL string `form:"cancel_url"`
ExpiresAt *int `form:"expires_at"`
PaymentMethods []PaymentMethod `form:"payment_methods"`
BillingDetailsCollection *string `form:"billing_details_collection"`
Description *string `form:"description"`
SubmitType *string `form:"submit_type"`
PaymentMethodOptions *PaymentMethodOptions `form:"payment_method_options"`
}
CheckoutSessionCreateParams represents the available ServiceCheckoutSessions.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions/create
type CheckoutSessionLineItem ¶
type CheckoutSessionStatus ¶
type CheckoutSessionStatus string
CheckoutSessionStatus enumerates the valid values for the CheckoutSession.Status field.
const ( CheckoutSessionStatusActive CheckoutSessionStatus = "active" CheckoutSessionStatusCompleted CheckoutSessionStatus = "completed" CheckoutSessionStatusExpired CheckoutSessionStatus = "expired" )
type Client ¶
type Client struct {
// BillingStatementLineItems is the service for invoking /billing_statement_line_items APIs.
BillingStatementLineItems ServiceBillingStatementLineItems
// BillingStatements is the service for invoking /billing_statements APIs.
BillingStatements ServiceBillingStatements
// CheckoutSessions is the service for invoking /checkout_sessions APIs.
CheckoutSessions ServiceCheckoutSessions
// CustomerSessions is the service for invoking /customer_sessions APIs.
CustomerSessions ServiceCustomerSessions
// Customers is the service for invoking /customers APIs.
Customers ServiceCustomers
// PaymentIntents is the service for invoking /payment_intents APIs.
PaymentIntents ServicePaymentIntents
// Payments is the service for invoking /payments APIs.
Payments ServicePayments
// Payouts is the service for invoking /payouts APIs.
Payouts ServicePayouts
// Refunds is the service for invoking /refunds APIs.
Refunds ServiceRefunds
// Webhooks is the service for invoking /webhooks APIs.
Webhooks ServiceWebhooks
// contains filtered or unexported fields
}
Client is the PayRex client. It contains all the services for interacting with the PayRex API.
type Currency ¶
type Currency string
Currency is a three-letter ISO currency code in uppercase.
As of the moment, PayRex only supports PHP.
const (
CurrencyPHP Currency = "PHP"
)
type Customer ¶
type Customer struct {
Resource
BillingStatementPrefix string `json:"billing_statement_prefix"`
Currency Currency `json:"currency"`
Email string `json:"email"`
Name string `json:"name"`
Metadata *map[string]string `json:"metadata"`
NextBillingStatementSequenceNumber string `json:"next_billing_statement_sequence_number"`
}
Customer represents the customer of your business. A customer could be a person or a company. Use this resource to track payments that belong to the same customer.
Service: ServiceCustomers
API reference: https://docs.payrexhq.com/docs/api/customers
type CustomerCreateParams ¶
type CustomerCreateParams struct {
Currency Currency `form:"currency"`
Name string `form:"name"`
Email string `form:"email"`
BillingStatementPrefix *string `form:"billing_statement_prefix"`
NextBillingStatementSequenceNumber *string `form:"next_billing_statement_sequence_number"`
Metadata *map[string]string `form:"metadata"`
}
CustomerCreateParams represents the available ServiceCustomers.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/customers/create
type CustomerListParams ¶
type CustomerListParams struct {
Limit *int `form:"int"`
Before *string `form:"before"`
After *string `form:"after"`
Email *string `form:"email"`
Name *string `form:"name"`
Metadata *map[string]string `form:"metadata"`
}
CustomerListParams represents the available ServiceCustomers.List parameters.
API reference: https://docs.payrexhq.com/docs/api/customers/list
type CustomerSession ¶
type CustomerSession struct {
Resource
CustomerID string `json:"customer_id"`
ClientSecret string `json:"client_secret"`
Components []CustomerSessionComponent `json:"components"`
Expired bool `json:"expired"`
ExpiredAt int `json:"expired_at"`
}
CustomerSession represents a customer session.
Service: CustomerSession
type CustomerSessionComponent ¶
type CustomerSessionComponent struct {
Component string `json:"component"`
Feature string `json:"feature"`
Value CustomerSessionComponentValue `json:"value"`
}
type CustomerSessionComponentValue ¶
type CustomerSessionComponentValue string
const ( CustomerSessionComponentValueEnabled CustomerSessionComponentValue = "enabled" CustomerSessionComponentValueDisabled CustomerSessionComponentValue = "disabled" )
type CustomerSessionCreateParams ¶
type CustomerSessionCreateParams struct {
CustomerID string `form:"customer_id"`
}
CustomerSessionCreateParams represents the available ServiceCustomerSessions.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/customer_sessions/create
type CustomerUpdateParams ¶
type CustomerUpdateParams struct {
Currency *Currency `form:"currency"`
Name *string `form:"name"`
Email *string `form:"email"`
BillingStatementPrefix *string `form:"billing_statement_prefix"`
NextBillingStatementSequenceNumber *string `form:"next_billing_statement_sequence_number"`
Metadata *map[string]string `form:"metadata"`
}
CustomerUpdateParams represents the available ServiceCustomers.Update parameters.
API reference: https://docs.payrexhq.com/docs/api/customers/update
type DeletedResource ¶
type DeletedResource struct {
// Unique identifier for the resource.
ID string `json:"id"`
Deleted bool `json:"deleted"`
}
DeletedResource represents a resource of any type that has been deleted.
type Error ¶
type Error struct {
Errors []ErrorMessage `json:"errors"`
}
type ErrorMessage ¶
type ErrorMessage struct {
Code string `json:"code"`
Detail string `json:"detail"`
Parameter string `json:"parameter"`
}
func (ErrorMessage) Error ¶
func (em ErrorMessage) Error() string
type Event ¶
type Event struct {
Resource
Type EventType `json:"type"`
// The name of the type of resource associated with this event.
// Corresponds to the first part of the Type.
ResourceType EventResourceType
PendingWebhooks int `json:"pending_webhooks"`
PreviousAttributes map[string]any `json:"previous_attributes"`
// contains filtered or unexported fields
}
Event represents updates in your PayRex account triggered either by API calls or your actions from the Dashboard.
Service: ServiceWebhooks (returned from [ServiceWebhooks.ParseEvent])
API reference: https://docs.payrexhq.com/docs/api/events
func ParseEvent ¶
ParseEvent parses an event from a PayRex webhook request.
Reference: https://docs.payrexhq.com/docs/guide/developer_handbook/webhooks
func ParseEventFromBytes ¶
ParseEventFromBytes parses an event from a PayRex webhook request.
If you are in an http.HandlerFunc, it's recommended to use ParseEvent instead to extract the event directly from an *http.Request.
Reference: https://docs.payrexhq.com/docs/guide/developer_handbook/webhooks
func (*Event) BillingStatement ¶
func (e *Event) BillingStatement() (*BillingStatement, error)
BillingStatement returns the billing statement associated with this event, if the event type starts with 'billing_statement'.
It's recommended to check the Event.ResourceName first to see if the EventType is of a billing statement.
func (*Event) CheckoutSession ¶
func (e *Event) CheckoutSession() (*CheckoutSession, error)
CheckoutSession returns the checkout session associated with this event, if the event type starts with 'checkout_session'.
It's recommended to check the Event.ResourceName first to see if the EventType is of a checkout session.
func (*Event) MustBillingStatement ¶
func (e *Event) MustBillingStatement() *BillingStatement
MustBillingStatement returns the billing statement associated with this event, or panics if there is none.
It's recommended to check the Event.ResourceName first to see if the EventType is of a billing statement.
func (*Event) MustCheckoutSession ¶
func (e *Event) MustCheckoutSession() *CheckoutSession
MustCheckoutSession returns the checkout session associated with this event, or panics if there is none.
It's recommended to check the Event.ResourceName first to see if the EventType is of a checkout session.
func (*Event) MustPaymentIntent ¶
func (e *Event) MustPaymentIntent() *PaymentIntent
MustPaymentIntent returns the payment intent associated with this event, or panics if there is none.
It's recommended to check the Event.ResourceName first to see if the EventType is of a payment intent.
func (*Event) MustPayout ¶
MustPayout returns the payout associated with this event, or panics if there is none.
It's recommended to check the Event.ResourceName first to see if the EventType is of a payout.
func (*Event) MustRefund ¶
MustRefund returns the refund associated with this event, or panics if there is none.
It's recommended to check the Event.ResourceName first to see if the EventType is of a refund.
func (*Event) PaymentIntent ¶
func (e *Event) PaymentIntent() (*PaymentIntent, error)
PaymentIntent returns the payment intent associated with this event, if the event type starts with 'payment_intent'.
It's recommended to check the Event.ResourceName first to see if the EventType is of a payment intent.
type EventResourceType ¶
type EventResourceType string
EventResourceType enumerates the types of resources that an Event can have.
When an Event.ResourceType field matches one of the values here, it's safe to call the corresponding Event.Must<Resource>() method.
For example, if the Event.ResourceType is EventResourceTypeBillingStatement, you can call Event.MustBillingStatement without issues.
const ( EventResourceTypeBillingStatement EventResourceType = "billing_statement" EventResourceTypeCheckoutSession EventResourceType = "checkout_session" EventResourceTypePaymentIntent EventResourceType = "payment_intent" EventResourceTypePayout EventResourceType = "payout" EventResourceTypeRefund EventResourceType = "refund" )
type EventType ¶
type EventType string
EventType enumerates the event types of an Event that a Webhook can listen to.
const ( EventTypeBillingStatementCreated EventType = "billing_statement.created" EventTypeBillingStatementUpdated EventType = "billing_statement.updated" EventTypeBillingStatementDeleted EventType = "billing_statement.deleted" EventTypeBillingStatementFinalized EventType = "billing_statement.finalized" EventTypeBillingStatementSent EventType = "billing_statement.sent" EventTypeBillingStatementMarkedUncollectible EventType = "billing_statement.marked_uncollectible" EventTypeBillingStatementVoided EventType = "billing_statement.voided" EventTypeBillingStatementPaid EventType = "billing_statement.paid" EventTypeBillingStatementWillBeDue EventType = "billing_statement.will_be_due" EventTypeBillingStatementOverdue EventType = "billing_statement.overdue" EventTypeBillingStatementLineItemCreated EventType = "billing_statement_line_item.created" EventTypeBillingStatementLineItemUpdated EventType = "billing_statement_line_item.updated" EventTypeBillingStatementLineItemDeleted EventType = "billing_statement_line_item.deleted" EventTypeCheckoutSessionExpired EventType = "checkout_session.expired" EventTypePaymentIntentAwaitingCapture EventType = "payment_intent.awaiting_capture" EventTypePaymentIntentSucceeded EventType = "payment_intent.succeeded" EventTypePayoutDeposited EventType = "payout.deposited" EventTypeRefundCreated EventType = "refund.created" EventTypeRefundUpdated EventType = "refund.updated" )
type List ¶
type List[T any] struct { // The resources returned by an API response. Data []T `json:"data"` // Whether there are more resources available. HasMore bool `json:"has_more"` }
List contains several resources returned together by an API response.
type ListCheckoutSessionsParams ¶
type ListCheckoutSessionsParams struct {
Limit *int `form:"int"`
Before *string `form:"before"`
After *string `form:"after"`
}
ListCheckoutSessionsParams represents the available ServiceCheckoutSessions.List parameters.
type Payment ¶
type Payment struct {
Resource
Amount int `json:"amount"`
AmountRefunded int `json:"amount_refunded"`
Billing Billing `json:"billing"`
Currency Currency `json:"currency"`
Description *string `json:"description"`
Fee int `json:"fee"`
Metadata *map[string]string `json:"metadata"`
NetAmount int `json:"net_amount"`
PaymentIntentID string `json:"payment_intent_id"`
Status PaymentStatus `json:"payment_status"`
Customer *Customer `json:"customer"`
PaymentMethod PaymentMethodType `json:"payment_method"`
Refunded bool `json:"refunded"`
}
Payment represents an individual attempt to move money to your PayRex merchant account balance.
Service: ServicePayments
API reference: https://docs.payrexhq.com/docs/api/payments
type PaymentIntent ¶
type PaymentIntent struct {
Resource
Amount int `json:"amount"`
AmountReceived int `json:"amount_received"`
AmountCapturable int `json:"amount_capturable"`
ClientSecret string `json:"client_secret"`
Currency Currency `json:"currency"`
Description *string `json:"description"`
Metadata *map[string]string `json:"metadata"`
PaymentMethodID *string `json:"payment_method_id"`
PaymentMethods []PaymentMethod `json:"payment_methods"`
PaymentMethodOptions *PaymentMethodOptions `json:"payment_method_options"`
StatementDescriptor string `json:"statement_descriptor"`
Status PaymentIntentStatus `json:"status"`
NextAction *PaymentIntentNextAction `json:"next_action"`
ReturnURL *string `json:"return_url"`
}
PaymentIntent tracks the customer's payment lifecycle, keeping track of any failed payment attempts and ensuring the customer is only charged once.
Service: ServicePaymentIntents
API reference: https://docs.payrexhq.com/docs/api/payment_intents
type PaymentIntentCaptureParams ¶
type PaymentIntentCaptureParams struct {
Amount int `form:"amount"`
}
PaymentIntentCaptureParams represents the available ServicePaymentIntents.Capture parameters.
API reference: https://docs.payrexhq.com/docs/api/payment_intents/capture
type PaymentIntentCreateParams ¶
type PaymentIntentCreateParams struct {
Amount int `form:"amount"`
PaymentMethods []PaymentMethod `form:"payment_methods"`
Currency Currency `form:"currency"`
Description *string `form:"description"`
PaymentMethodOptions *PaymentMethodOptions `form:"payment_method_options"`
}
PaymentIntentCreateParams represents the available ServicePaymentIntents.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/payment_intents/create
type PaymentIntentNextAction ¶
type PaymentIntentStatus ¶
type PaymentIntentStatus string
PaymentIntentStatus enumerates the valid values for the PaymentIntent.Status field.
const ( PaymentIntentStatusAwaitingPaymentMethod PaymentIntentStatus = "awaiting_payment_method" PaymentIntentStatusAwaitingNextAction PaymentIntentStatus = "awaiting_next_action" PaymentIntentStatusProcessing PaymentIntentStatus = "processing" PaymentIntentStatusSucceeded PaymentIntentStatus = "succeeded" )
type PaymentMethod ¶
type PaymentMethod string
PaymentMethod enumerates the valid payment methods for PayRex payments.
const ( // Pay through bank card. PaymentMethodCard PaymentMethod = "card" // Pay through GCash. PaymentMethodGCash PaymentMethod = "gcash" // Pay through Maya. PaymentMethodMaya PaymentMethod = "maya" // Pay through QR Ph. PaymentMethodQRPh PaymentMethod = "qrph" )
type PaymentMethodOptions ¶
type PaymentMethodOptions struct {
Card Card `json:"card" form:"card"`
}
type PaymentMethodType ¶
type PaymentMethodType struct {
Type PaymentMethod `json:"type"`
}
type PaymentSettings ¶
type PaymentSettings struct {
// The list of [PaymentMethod] values allowed to be processed by the [PaymentIntent] of a [BillingStatement].
PaymentMethods []PaymentMethod `json:"payment_methods" form:"payment_methods"`
}
PaymentSettings lists fields that can modify the behavior of the payment processing for a BillingStatement.
type PaymentStatus ¶
type PaymentStatus string
PaymentStatus enumerates the valid values for the Payment.Status field.
const ( PaymentStatusPaid PaymentStatus = "paid" PaymentStatusFailed PaymentStatus = "failed" )
type PaymentUpdateParams ¶
type PaymentUpdateParams struct {
Description *string `form:"description"`
Metadata *map[string]string `form:"metadata"`
}
PaymentUpdateParams represents the available ServicePayments.Update parameters.
API reference: https://docs.payrexhq.com/docs/api/payments/update
type Payout ¶
type Payout struct {
Resource
Amount int `json:"amount"`
Destination PayoutDestination `json:"destination"`
NetAmount int `json:"net_amount"`
Status PayoutStatus `json:"status"`
}
Payout resources are created when you are scheduled to receive money from PayRex.
Payouts are made depending on the payout schedule for your PayRex merchant account.
Service: ServicePayouts
API reference: https://docs.payrexhq.com/docs/api/payouts
type PayoutDestination ¶
type PayoutStatus ¶
type PayoutStatus string
PayoutStatus enumerates the valid values for the Payout.Status field.
const ( PayoutStatusPending PayoutStatus = "pending" PayoutStatusInTransit PayoutStatus = "in_transit" PayoutStatusFailed PayoutStatus = "failed" PayoutStatusSuccessful PayoutStatus = "successful" )
type PayoutTransaction ¶
type PayoutTransaction struct {
// Unique identifier for the resource.
ID string `json:"id"`
Amount int `json:"amount"`
NetAmount int `json:"net_amount"`
TransactionType PayoutTransactionType `json:"transaction_type"`
TransactionID string `json:"transaction_id"`
// The time the resource was created, measured in seconds since the Unix epoch.
CreatedAt int `json:"created_at"`
// The time the resource was updated, measured in seconds since the Unix epoch.
UpdatedAt int `json:"updated_at"`
}
PayoutTransaction represents every line item of a Payout.
Every PayoutTransaction belongs to a Payout resource.
Service: ServicePayouts
API reference: https://docs.payrexhq.com/docs/api/payout_transactions
type PayoutTransactionListParams ¶
type PayoutTransactionListParams struct {
Limit *int `form:"limit"`
Before *string `form:"before"`
After *string `form:"after"`
}
PayoutTransactionListParams represents the available ServicePayouts.ListTransactions parameters.
API reference: https://docs.payrexhq.com/docs/api/payout_transactions/list
type PayoutTransactionType ¶
type PayoutTransactionType string
PayoutTransactionType enumerates the valid values for the PayoutTransaction.TransactionType field.
const ( PayoutTransactionTypePayment PayoutTransactionType = "payment" PayoutTransactionTypeRefund PayoutTransactionType = "refund" PayoutTransactionTypeAdjustment PayoutTransactionType = "adjustment" )
type Refund ¶
type Refund struct {
Resource
Amount int `json:"amount"`
Currency Currency `json:"currency"`
Status RefundStatus `json:"status"`
Description *string `json:"description"`
Reason RefundReason `json:"reason"`
Remarks *string `json:"remarks"`
PaymentID string `json:"payment_id"`
Metadata *map[string]string `json:"metadata"`
}
Refund resources represent a refunded amount of a paid payment.
Service: ServiceRefunds
API reference: https://docs.payrexhq.com/docs/api/refunds
type RefundCreateParams ¶
type RefundCreateParams struct {
Amount int `form:"amount"`
Currency Currency `form:"currency"`
Description *string `form:"description"`
PaymentID string `form:"payment_id"`
Remarks *string `form:"remarks"`
Reason RefundReason `form:"reason"`
Metadata *map[string]string `form:"metadata"`
}
RefundCreateParams represents the available ServiceRefunds.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/refunds/create
type RefundReason ¶
type RefundReason string
RefundReason enumerates the valid refund reasons.
const ( RefundReasonFraudulent RefundReason = "fraudulent" RefundReasonRequestedByCustomer RefundReason = "requested_by_customer" RefundReasonProductOutOfStock RefundReason = "product_out_of_stock" RefundReasonServiceNotProvided RefundReason = "service_not_provided" RefundReasonProductWasDamaged RefundReason = "product_was_damaged" RefundReasonServiceMisaligned RefundReason = "service_misaligned" RefundReasonWrongProductReceived RefundReason = "wrong_product_received" RefundReasonOthers RefundReason = "others" )
type RefundStatus ¶
type RefundStatus string
RefundStatus enumerates the valid values for the Refund.Status field.
const ( RefundStatusSucceeded RefundStatus = "succeeded" RefundStatusFailed RefundStatus = "failed" RefundStatusPending RefundStatus = "pending" )
type RefundUpdateParams ¶
RefundUpdateParams represents the available ServiceRefunds.Update parameters.
API reference: https://docs.payrexhq.com/docs/api/refunds/update
type Resource ¶
type Resource struct {
// Unique identifier for the resource.
ID string `json:"id"`
// 'true' if the resource's mode is live or 'false' if the resource is in test mode.
Livemode bool `json:"livemode"`
// The time the resource was created, measured in seconds since the Unix epoch.
CreatedAt int `json:"created_at"`
// The time the resource was updated, measured in seconds since the Unix epoch.
UpdatedAt int `json:"updated_at"`
}
Resource defines the common fields for most resources.
type ServiceBillingStatementLineItems ¶
type ServiceBillingStatementLineItems struct {
// contains filtered or unexported fields
}
ServiceBillingStatementLineItems is used to interact with BillingStatementLineItem resources, using the /billing_statement_line_items APIs.
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items
func (*ServiceBillingStatementLineItems) Create ¶
func (s *ServiceBillingStatementLineItems) Create(params *BillingStatementLineItemCreateParams) (*BillingStatementLineItem, error)
Create creates a billing statement line item resource.
Endpoint: POST /billing_statement_line_items
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items/create
func (*ServiceBillingStatementLineItems) Delete ¶
func (s *ServiceBillingStatementLineItems) Delete(id string) (*DeletedResource, error)
Delete deletes a billing statement line item resource by ID.
Endpoint: DELETE /billing_statement_line_items/:id
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items/delete
func (*ServiceBillingStatementLineItems) Update ¶
func (s *ServiceBillingStatementLineItems) Update(id string, params *BillingStatementLineItemUpdateParams) (*BillingStatementLineItem, error)
Update updates a billing statement line item resource by ID.
Endpoint: PUT /billing_statement_line_items/:id
API reference: https://docs.payrexhq.com/docs/api/billing_statement_line_items/update
type ServiceBillingStatements ¶
type ServiceBillingStatements struct {
// contains filtered or unexported fields
}
ServiceBillingStatements is used to interact with BillingStatement resources, using the /billing_statements APIs.
API reference: https://docs.payrexhq.com/docs/api/billing_statements
func (*ServiceBillingStatements) Create ¶
func (s *ServiceBillingStatements) Create(params *BillingStatementCreateParams) (*BillingStatement, error)
Create creates a billing statement resource.
Endpoint: POST /billing_statements
API reference: https://docs.payrexhq.com/docs/api/billing_statements/create
func (*ServiceBillingStatements) Delete ¶
func (s *ServiceBillingStatements) Delete(id string) (*DeletedResource, error)
Delete deletes a billing statement resource by ID.
Endpoint: DELETE /billing_statements/:id
API reference: https://docs.payrexhq.com/docs/api/billing_statements/delete
func (*ServiceBillingStatements) Finalize ¶
func (s *ServiceBillingStatements) Finalize(id string) (*BillingStatement, error)
Finalize finalizes a billing statement by ID.
Endpoint: POST /billing_statements/:id/finalize
API reference: https://docs.payrexhq.com/docs/api/billing_statements/finalize
func (*ServiceBillingStatements) List ¶
func (s *ServiceBillingStatements) List(params *BillingStatementListParams) iter.Seq2[*BillingStatement, error]
List lists billing statement resources. The 'params' parameter can be nil.
Endpoint: GET /billing_statements
API reference: https://docs.payrexhq.com/docs/api/billing_statements/list
func (*ServiceBillingStatements) MarkUncollectible ¶
func (s *ServiceBillingStatements) MarkUncollectible(id string) (*BillingStatement, error)
MarkUncollectible marks a billing statement resource as uncollectible by ID.
Endpoint: POST /billing_statements/:id/disable
API reference: https://docs.payrexhq.com/docs/api/billing_statements/mark_uncollectible
func (*ServiceBillingStatements) Retrieve ¶
func (s *ServiceBillingStatements) Retrieve(id string) (*BillingStatement, error)
Retrieve retrieves a billing statement resource by ID.
Endpoint: GET /billing_statements/:id
API reference: https://docs.payrexhq.com/docs/api/billing_statements/retrieve
func (*ServiceBillingStatements) Send ¶
func (s *ServiceBillingStatements) Send(id string) (*BillingStatement, error)
Send sends a billing statement resource via e-mail by ID.
Endpoint: POST /billing_statements/:id/disable
API reference: https://docs.payrexhq.com/docs/api/billing_statements/send
func (*ServiceBillingStatements) Update ¶
func (s *ServiceBillingStatements) Update(id string, params *BillingStatementUpdateParams) (*BillingStatement, error)
Update updates a billing statement resource by ID.
Endpoint: PUT /billing_statements/:id
API reference: https://docs.payrexhq.com/docs/api/billing_statements/update
func (*ServiceBillingStatements) Void ¶
func (s *ServiceBillingStatements) Void(id string) (*BillingStatement, error)
Void void a billing statement resource by ID.
Endpoint: POST /billing_statements/:id/void
API reference: https://docs.payrexhq.com/docs/api/billing_statements/void
type ServiceCheckoutSessions ¶
type ServiceCheckoutSessions struct {
// contains filtered or unexported fields
}
ServiceCheckoutSessions is used to interact with CheckoutSession resources, using the /checkout_sessions APIs.
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions
func (*ServiceCheckoutSessions) Create ¶
func (s *ServiceCheckoutSessions) Create(params *CheckoutSessionCreateParams) (*CheckoutSession, error)
Create creates a checkout session resource.
Endpoint: POST /checkout_sessions
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions/create
func (*ServiceCheckoutSessions) Expire ¶
func (s *ServiceCheckoutSessions) Expire(id string) (*CheckoutSession, error)
Expire marks a checkout_session as expired by ID.
Endpoint: POST /checkout_sessions/:id/enable
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions/enable
func (*ServiceCheckoutSessions) List ¶
func (s *ServiceCheckoutSessions) List(params *ListCheckoutSessionsParams) iter.Seq2[*CheckoutSession, error]
List lists checkout sessions. The 'params' parameter can be nil.
Endpoint: GET /checkout_sessions
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions/list
func (*ServiceCheckoutSessions) Retrieve ¶
func (s *ServiceCheckoutSessions) Retrieve(id string) (*CheckoutSession, error)
Retrieve retrieves a checkout session resource by ID.
A CheckoutSession can only be retrieved from the server side using a secret API key.
Endpoint: GET /checkout_sessions/:id
API reference: https://docs.payrexhq.com/docs/api/checkout_sessions/retrieve
type ServiceCustomerSessions ¶
type ServiceCustomerSessions struct {
// contains filtered or unexported fields
}
ServiceCustomerSessions is used to interact with CustomerSession resources, using the /customer_sessions APIs.
API reference: https://docs.payrexhq.com/docs/api/customer_sessions
func (*ServiceCustomerSessions) Create ¶
func (s *ServiceCustomerSessions) Create(params *CustomerSessionCreateParams) (*CustomerSession, error)
Create creates a customer session resource.
Endpoint: POST /customer_sessions
API reference: https://docs.payrexhq.com/docs/api/customer_sessions/create
func (*ServiceCustomerSessions) Retrieve ¶
func (s *ServiceCustomerSessions) Retrieve(id string) (*CustomerSession, error)
Retrieve retrieves a customer session resource by ID.
Endpoint: GET /customer_sessions/:id
API reference: https://docs.payrexhq.com/docs/api/customer_sessions/retrieve
type ServiceCustomers ¶
type ServiceCustomers struct {
// contains filtered or unexported fields
}
ServiceCustomers is used to interact with Customer resources, using the /customers APIs.
API reference: https://docs.payrexhq.com/docs/api/customers
func (*ServiceCustomers) Create ¶
func (s *ServiceCustomers) Create(params *CustomerCreateParams) (*Customer, error)
Create creates a customer resource.
Endpoint: POST /customers
API reference: https://docs.payrexhq.com/docs/api/customers/create
func (*ServiceCustomers) Delete ¶
func (s *ServiceCustomers) Delete(id string) (*DeletedResource, error)
Delete deletes a customer resource by ID.
Deleted customers can still be retrieved through ServiceCustomers.Retrieve to track their history.
Endpoint: DELETE /customers/:id
API reference: https://docs.payrexhq.com/docs/api/customers/delete
func (*ServiceCustomers) List ¶
func (s *ServiceCustomers) List(params *CustomerListParams) iter.Seq2[*Customer, error]
List lists customers. The 'params' parameter can be nil.
Endpoint: GET /customers
API reference: https://docs.payrexhq.com/docs/api/customers/list
func (*ServiceCustomers) Retrieve ¶
func (s *ServiceCustomers) Retrieve(id string) (*Customer, error)
Retrieve retrieves a customer resource by ID.
Endpoint: GET /customers/:id
API reference: https://docs.payrexhq.com/docs/api/customers/retrieve
func (*ServiceCustomers) Update ¶
func (s *ServiceCustomers) Update(id string, params *CustomerUpdateParams) (*Customer, error)
Update updates a customer resource by ID.
Endpoint: PUT /customers/:id
API reference: https://docs.payrexhq.com/docs/api/customers/update
type ServicePaymentIntents ¶
type ServicePaymentIntents struct {
// contains filtered or unexported fields
}
ServicePaymentIntents is used to interact with PaymentIntent resources, using the /payment_intents APIs.
API reference: https://docs.payrexhq.com/docs/api/payment_intents
func (*ServicePaymentIntents) Cancel ¶
func (s *ServicePaymentIntents) Cancel(id string) (*PaymentIntent, error)
Cancel cancels a PaymentIntent resource by ID.
A payment intent with a status of canceled means your customer cannot proceed with paying the particular payment intent.
You can only cancel a payment intent with status 'awaiting_payment_method'.
Endpoint: POST /payment_intents/:id/cancel
API reference: https://docs.payrexhq.com/docs/api/payment_intents/cancel
func (*ServicePaymentIntents) Capture ¶
func (s *ServicePaymentIntents) Capture(id string, params *PaymentIntentCaptureParams) (*PaymentIntent, error)
Capture captures a PaymentIntent resource by ID.
Endpoint: POST /payment_intents/:id/capture
API reference: https://docs.payrexhq.com/docs/api/payment_intents/capture
func (*ServicePaymentIntents) Create ¶
func (s *ServicePaymentIntents) Create(params *PaymentIntentCreateParams) (*PaymentIntent, error)
Create creates a PaymentIntent resource.
Endpoint: POST /payment_intents
API reference: https://docs.payrexhq.com/docs/api/payment_intents/create
func (*ServicePaymentIntents) Retrieve ¶
func (s *ServicePaymentIntents) Retrieve(id string) (*PaymentIntent, error)
Retrieve retrieves a PaymentIntent resource by ID.
Endpoint: GET /payment_intents/:id
API reference: https://docs.payrexhq.com/docs/api/payment_intents/retrieve
type ServicePayments ¶
type ServicePayments struct {
// contains filtered or unexported fields
}
ServicePayments is used to interact with Payment resources, using the /payments APIs.
API reference: https://docs.payrexhq.com/docs/api/payments
func (*ServicePayments) Retrieve ¶
func (s *ServicePayments) Retrieve(id string) (*Payment, error)
Retrieve retrieves a Payment resource by ID.
Endpoint: GET /payments/:id
API reference: https://docs.payrexhq.com/docs/api/payments/retrieve
func (*ServicePayments) Update ¶
func (s *ServicePayments) Update(id string, params *PaymentUpdateParams) (*Payment, error)
Update updates a Payment resource by ID.
Endpoint: PUT /payments/:id
API reference: https://docs.payrexhq.com/docs/api/payments/update
type ServicePayouts ¶
type ServicePayouts struct {
// contains filtered or unexported fields
}
ServicePayouts is used to interact with Payout and PayoutTransaction resources, using the /payouts APIs.
API reference: https://docs.payrexhq.com/docs/api/payouts
func (*ServicePayouts) ListTransactions ¶
func (s *ServicePayouts) ListTransactions(id string, params *PayoutTransactionListParams) (*List[PayoutTransaction], error)
ListTransactions lists payout transactions by Payout ID. The 'params' parameter can be nil.
Endpoint: GET /payouts/:id/transactions
API reference: https://docs.payrexhq.com/docs/api/payout_transactions/list
type ServiceRefunds ¶
type ServiceRefunds struct {
// contains filtered or unexported fields
}
ServiceRefunds is used to interact with Refund resources, using the /refunds APIs.
API reference: https://docs.payrexhq.com/docs/api/refunds
func (*ServiceRefunds) Create ¶
func (s *ServiceRefunds) Create(params *RefundCreateParams) (*Refund, error)
Create creates a refund resource.
Endpoint: POST /refunds
API reference: https://docs.payrexhq.com/docs/api/refunds/create
func (*ServiceRefunds) Update ¶
func (s *ServiceRefunds) Update(id string, params *RefundUpdateParams) (*Refund, error)
Update updates a refund resource by ID.
Endpoint: PUT /refunds/:id
API reference: https://docs.payrexhq.com/docs/api/refunds/update
type ServiceWebhooks ¶
type ServiceWebhooks struct {
// contains filtered or unexported fields
}
ServiceWebhooks is used to interact with Webhook resources, using the /webhooks APIs.
API reference: https://docs.payrexhq.com/docs/api/webhooks
func (*ServiceWebhooks) Create ¶
func (s *ServiceWebhooks) Create(params *WebhookCreateParams) (*Webhook, error)
Create creates a webhook resource.
Endpoint: POST /webhooks
API reference: https://docs.payrexhq.com/docs/api/webhooks/create
func (*ServiceWebhooks) Delete ¶
func (s *ServiceWebhooks) Delete(id string) (*DeletedResource, error)
Delete deletes a webhook resource by ID.
Endpoint: DELETE /webhooks/:id
API reference: https://docs.payrexhq.com/docs/api/webhooks/delete
func (*ServiceWebhooks) Disable ¶
func (s *ServiceWebhooks) Disable(id string) (*Webhook, error)
Disable disables a webhook resource by ID.
Endpoint: POST /webhooks/:id/disable
API reference: https://docs.payrexhq.com/docs/api/webhooks/disable
func (*ServiceWebhooks) Enable ¶
func (s *ServiceWebhooks) Enable(id string) (*Webhook, error)
Enable enables a webhook by ID.
Endpoint: POST /webhooks/:id/enable
API reference: https://docs.payrexhq.com/docs/api/webhooks/enable
func (*ServiceWebhooks) List ¶
func (s *ServiceWebhooks) List(params *WebhookListParams) iter.Seq2[*Webhook, error]
List lists webhooks. The 'params' parameter can be nil.
Endpoint: GET /webhooks
API reference: https://docs.payrexhq.com/docs/api/webhooks/list
func (*ServiceWebhooks) Retrieve ¶
func (s *ServiceWebhooks) Retrieve(id string) (*Webhook, error)
Retrieve retrieves a webhook resource by ID.
Endpoint: GET /webhooks/:id
API reference: https://docs.payrexhq.com/docs/api/webhooks/retrieve
func (*ServiceWebhooks) Update ¶
func (s *ServiceWebhooks) Update(id string, params *WebhookUpdateParams) (*Webhook, error)
Update updates a webhook resource by ID.
Endpoint: PUT /webhooks/:id
API reference: https://docs.payrexhq.com/docs/api/webhooks/update
type Webhook ¶
type Webhook struct {
Resource
SecretKey string `json:"secret_key"`
Status WebhookStatus `json:"status"`
Description *string `json:"description"`
URL string `json:"url"`
Events []EventType `json:"events"`
}
Webhook is used to notify your application about events in your PayRex account.
Service: ServiceWebhooks
API reference: https://docs.payrexhq.com/docs/api/webhooks
type WebhookCreateParams ¶
type WebhookCreateParams struct {
URL string `form:"url"`
Description *string `form:"description"`
Events []EventType `form:"events"`
}
WebhookCreateParams represents the available ServiceWebhooks.Create parameters.
API reference: https://docs.payrexhq.com/docs/api/webhooks/create
type WebhookListParams ¶
type WebhookListParams struct {
Limit *int `form:"int"`
Before *string `form:"before"`
After *string `form:"after"`
URL *string `form:"url"`
Description *string `form:"description"`
}
WebhookListParams represents the available ServiceWebhooks.List parameters.
API reference: https://docs.payrexhq.com/docs/api/webhooks/list
type WebhookStatus ¶
type WebhookStatus string
WebhookStatus enumerates the valid values for the Webhook.Status field.
const ( WebhookStatusEnabled WebhookStatus = "enabled" WebhookStatusDisabled WebhookStatus = "disabled" )
type WebhookUpdateParams ¶
type WebhookUpdateParams struct {
URL *string `form:"url"`
Description *string `form:"description"`
Events *[]EventType `form:"events"`
}
WebhookUpdateParams represents the available ServiceWebhooks.Update parameters.
API reference: https://docs.payrexhq.com/docs/api/webhooks/update
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
basic
command
|
|
|
webhook-handler
command
|
|
|
internal
|
|
|
form
Package form provides functionality to parse a struct into a URL-encoded string.
|
Package form provides functionality to parse a struct into a URL-encoded string. |