forked from rpip/paystack-go
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdoc.go
More file actions
47 lines (36 loc) · 1.28 KB
/
doc.go
File metadata and controls
47 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Package paystack provides the binding for Paystack REST APIs.
Where possible, the services available on the client groups the API into
logical chunks and correspond to the structure of the Paystack API
documentation at https://developers.paystack.co/v1.0/reference.
Usage:
import "github.com/borderlesshq/paystack-go"
apiKey := "sk_test_b748a89ad84f35c2f1a8b81681f956274de048bb"
// second param is an optional http client, allowing overriding of the HTTP client to use.
// This is useful if you're running in a Google AppEngine environment
// where the http.DefaultClient is not available.
client := paystack.NewClient(apiKey)
recipient := &TransferRecipient{
Type: "Nuban",
Name: "Customer 1",
Description: "Demo customer",
AccountNumber: "0100000010",
BankCode: "044",
Currency: "NGN",
Metadata: map[string]interface{}{"job": "Plumber"},
}
recipient1, err := client.Transfer.CreateRecipient(recipient)
req := &TransferRequest{
Source: "balance",
Reason: "Delivery pickup",
Amount: 30,
Recipient: recipient1.RecipientCode,
}
transfer, err := client.Transfer.Initiate(req)
// retrieve list of plans
plans, err := client.Plan.List()
for i, plan := range plans.Values {
fmt.Printf("%+v", plan)
}
*/
package paystack