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
- type CheckoutResponse
- type Client
- type Config
- type Customer
- type InitializePaymentRequest
- type InitializePaymentResponse
- type Merchant
- type OTPSendResponse
- type OTPValidateResponse
- type PaymentChannel
- type PaymentStatus
- type PaymentStatusResponse
- type Provider
- type QRInfo
- type QRPaymentResponse
- type SubmitPaymentRequest
- type SubmitPaymentResponse
- 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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 InitializePaymentRequest ¶
type InitializePaymentRequest = types.InitializePaymentRequest
InitializePaymentRequest represents a payment initialization request
type InitializePaymentResponse ¶
type InitializePaymentResponse = types.InitializePaymentResponse
InitializePaymentResponse represents a payment initialization response
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 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 SubmitPaymentRequest ¶
type SubmitPaymentRequest = types.SubmitPaymentRequest
SubmitPaymentRequest represents a payment submission request
type SubmitPaymentResponse ¶
type SubmitPaymentResponse = types.SubmitPaymentResponse
SubmitPaymentResponse represents a payment submission response
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