Logo Lanfrica

ebenezersakyi/shika-go

Domain:

digital infrastructure

Record type:

software
Creator:
ebe
Host:
Official Shika Creators Go SDK for accepting Mobile Money payments in Ghana # Shika Creators Go SDK Official Go SDK for the Shika Creators payment gateway. Accept Mobile Money payments in Ghana. ## Requirements - Go 1.21 or higher ## Installation ```bash go get github.com ``` ## Quick Start ```go package main import ( "fmt" "log" "github.com" ) func main() { client := shika.New("sk_live_your_secret_key") // Create a payment payment, err := client.Payments.Create(&shika.PaymentParams{ Amount: 100.00, // GHS PaymentMethod: &shika.PaymentMethod{ Type: "mobile_money", PhoneNumber: "0241234567", }, Description: "Order #1234", }) if err != nil { log.Fatal(err) } fmt.Printf("Payment ID: %s\n", payment.ID) fmt.Printf("Status: %s\n", payment.Status) } ``` ## Usage ### Initialize the Client ```go import "github.com" // Live mode client := shika.New("sk_live_xxx") // Test mode testClient := shika.New("sk_test_xxx") // With custom configuration client := shika.New("sk_live_xxx", shika.Config{ BaseURL: "api.13.220.123.118.nip.io", Timeout: 30 * time.Second, }) ``` ### Payments #### Create a Payment ```go payment, err := client.Payments.Create(&shika.PaymentParams{ Amount: 50.00, Currency: "GHS", // optional, defaults to GHS PaymentMethod: &shika.PaymentMethod{ Type: "mobile_money", PhoneNumber: "0241234567", Provider: "mtn", // optional, auto-detected from number }, Description: "Order payment", Metadata: map[string]interface{}{ "order_id": "12345", }, }) ``` #### Retrieve a Payment ```go payment, err := client.Payments.Retrieve("pay_xxx") ``` #### List Payments ```go payments, err := client.Payments.List(&shika.PaymentListParams{ Limit: 10, Status: "completed", }) for _, payment := range payments.Data { fmt.Printf("%s - %.2f\n", payment.ID, payment.Amount) } // Pagination if payments.HasMore { nextPage, err := client.Payments.List(&shika.PaymentListParams{ StartingAfter: payments.Data[len(payments.Data)-1].ID, }) } ``` ### Payout …

Licenses