Documentation
¶
Overview ¶
Package ghion is the Go SDK for Ghion Finances payment gateway
This SDK provides a simple and secure way to integrate Ghion Finances payment gateway into your Go applications. It supports multiple payment channels including USSD, QR, OTP, and provides comprehensive webhook handling.
Quick Start:
client, err := ghion.NewClient(&ghion.Config{
APIKey: "your-api-key",
APISecret: "your-api-secret",
Passphrase: "your-passphrase",
})
if err != nil {
log.Fatal(err)
}
payment, err := client.InitializePayment(&ghion.InitializePaymentRequest{
Amount: 100,
Reference: "order_12345",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Payment initialized: %s\n", payment.ID)
Index ¶
- Constants
- Variables
- type APIError
- type AuthenticationError
- type BillError
- type CheckoutResponse
- type Client
- type Config
- type ConfigurationError
- type Customer
- type GhionError
- type InitializePaymentRequest
- type InitializePaymentResponse
- type Merchant
- type NetworkError
- type OTPSendResponse
- type OTPValidateResponse
- type PaymentChannel
- type PaymentError
- type PaymentStatus
- type PaymentStatusResponse
- type Provider
- type QRInfo
- type QRPaymentResponse
- type RateLimitError
- type SubmitPaymentRequest
- type SubmitPaymentResponse
- type ValidationError
- type WebhookError
- type WebhookEvent
- type WebhookEventType
Constants ¶
const ( // PaymentStatusPending represents a pending payment PaymentStatusPending = types.PaymentStatusPending // PaymentStatusProcessing represents a processing payment PaymentStatusProcessing = types.PaymentStatusProcessing // PaymentStatusCompleted represents a completed payment PaymentStatusCompleted = types.PaymentStatusCompleted // PaymentStatusFailed represents a failed payment PaymentStatusFailed = types.PaymentStatusFailed // PaymentStatusCancelled represents a cancelled payment PaymentStatusCancelled = types.PaymentStatusCancelled // PaymentStatusExpired represents an expired payment PaymentStatusExpired = types.PaymentStatusExpired )
const ( // StatusPending is a shorter alias for PaymentStatusPending StatusPending = types.PaymentStatusPending // StatusProcessing is a shorter alias for PaymentStatusProcessing StatusProcessing = types.PaymentStatusProcessing // StatusCompleted is a shorter alias for PaymentStatusCompleted StatusCompleted = types.PaymentStatusCompleted // StatusFailed is a shorter alias for PaymentStatusFailed StatusFailed = types.PaymentStatusFailed // StatusCancelled is a shorter alias for PaymentStatusCancelled StatusCancelled = types.PaymentStatusCancelled // StatusExpired is a shorter alias for PaymentStatusExpired StatusExpired = types.PaymentStatusExpired )
Shorter aliases for payment status (status.something format)
const ( // EventTransactionCompleted represents a transaction completed event EventTransactionCompleted = types.EventTransactionCompleted // EventTransactionFailed represents a transaction failed event EventTransactionFailed = types.EventTransactionFailed // EventTransactionRefunded represents a transaction refunded event EventTransactionRefunded = types.EventTransactionRefunded // EventTransactionPartiallyRefunded represents a transaction partially refunded event EventTransactionPartiallyRefunded = types.EventTransactionPartiallyRefunded // EventTransactionExpired represents a transaction expired event EventTransactionExpired = types.EventTransactionExpired // EventTransactionDisputed represents a transaction disputed event EventTransactionDisputed = types.EventTransactionDisputed // EventTransactionUpdated represents a transaction updated event EventTransactionUpdated = types.EventTransactionUpdated )
Variables ¶
var ( // NewConfigurationError creates a new ConfigurationError NewConfigurationError = errors.NewConfigurationError // NewAuthenticationError creates a new AuthenticationError NewAuthenticationError = errors.NewAuthenticationError // NewAPIError creates a new APIError NewAPIError = errors.NewAPIError // NewValidationError creates a new ValidationError NewValidationError = errors.NewValidationError // NewNetworkError creates a new NetworkError NewNetworkError = errors.NewNetworkError // NewPaymentError creates a new PaymentError NewPaymentError = errors.NewPaymentError // NewBillError creates a new BillError NewBillError = errors.NewBillError // NewWebhookError creates a new WebhookError NewWebhookError = errors.NewWebhookError // NewRateLimitError creates a new RateLimitError NewRateLimitError = errors.NewRateLimitError )
Error constructors
Functions ¶
This section is empty.
Types ¶
type AuthenticationError ¶ added in v1.1.0
type AuthenticationError = errors.AuthenticationError
AuthenticationError represents invalid credentials or signature
type CheckoutResponse ¶
type CheckoutResponse = types.CheckoutResponse
CheckoutResponse represents checkout information
type Client ¶
type Client = client.GhionClient
Client is the main SDK client for Ghion Finances payment gateway
type Config ¶
type Config = types.GhionConfig
Config represents the configuration for the Ghion client
type ConfigurationError ¶ added in v1.1.0
type ConfigurationError = errors.ConfigurationError
ConfigurationError represents invalid SDK configuration
type GhionError ¶ added in v1.1.0
type GhionError = errors.GhionError
GhionError is the base error class for all SDK errors
type InitializePaymentRequest ¶
type InitializePaymentRequest = types.InitializePaymentRequest
InitializePaymentRequest represents a payment initialization request
type InitializePaymentResponse ¶
type InitializePaymentResponse = types.InitializePaymentResponse
InitializePaymentResponse represents a payment initialization response
type NetworkError ¶ added in v1.1.0
type NetworkError = errors.NetworkError
NetworkError represents connection or timeout issues
type OTPSendResponse ¶
type OTPSendResponse = types.OTPSendResponse
OTPSendResponse represents an OTP send response
type OTPValidateResponse ¶
type OTPValidateResponse = types.OTPValidateResponse
OTPValidateResponse represents an OTP validation response
type PaymentChannel ¶
type PaymentChannel = types.PaymentChannel
PaymentChannel represents an available payment channel
type PaymentError ¶ added in v1.1.0
type PaymentError = errors.PaymentError
PaymentError represents payment processing failures
type PaymentStatus ¶
type PaymentStatus = types.PaymentStatus
PaymentStatus represents the status of a payment
type PaymentStatusResponse ¶
type PaymentStatusResponse = types.PaymentStatusResponse
PaymentStatusResponse represents a payment status response
type QRPaymentResponse ¶
type QRPaymentResponse = types.QRPaymentResponse
QRPaymentResponse represents a QR payment response
type RateLimitError ¶ added in v1.1.0
type RateLimitError = errors.RateLimitError
RateLimitError represents API rate limit exceeded
type SubmitPaymentRequest ¶
type SubmitPaymentRequest = types.SubmitPaymentRequest
SubmitPaymentRequest represents a payment submission request
type SubmitPaymentResponse ¶
type SubmitPaymentResponse = types.SubmitPaymentResponse
SubmitPaymentResponse represents a payment submission response
type ValidationError ¶ added in v1.1.0
type ValidationError = errors.ValidationError
ValidationError represents invalid input parameters
type WebhookError ¶ added in v1.1.0
type WebhookError = errors.WebhookError
WebhookError represents webhook signature verification or processing failures
type WebhookEvent ¶
type WebhookEvent = types.WebhookEvent
WebhookEvent represents a webhook event payload
type WebhookEventType ¶
type WebhookEventType = types.WebhookEventType
WebhookEventType represents the type of webhook event