Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Sogbey committed Aug 23, 2023
1 parent c49669d commit 00903f0
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import (
"log"
"os"


"github.com/Daniel-Sogbey/go-paystack/paystack"
Transactions "github.com/Daniel-Sogbey/go-paystack/pkg/transactions"
"github.com/Daniel-Sogbey/paystack-go-sdk/internal"
"github.com/Daniel-Sogbey/paystack-go-sdk/paystack"
Transactions "github.com/Daniel-Sogbey/paystack-go-sdk/pkg/transactions"
)

func main() {
internal.LoadEnv()

//SET UP AN HTTP CLIENT WITH AUTHORIZATION KEY AND CONTENT TYPE
client := paystack.NewClient("sk_test_f572197fbc13951b13afafc0d0f6517ed7ec12eb", "application/json")
client := paystack.NewClient(os.Getenv("API_KEY"), "application/json")

//SET UP INITIALIZE TRANSACTION REQUEST BODY
initializeTransactionRequest := &Transactions.InitializeTransactionRequest{
Expand Down Expand Up @@ -60,9 +60,16 @@ func main() {
// SAMPLE JSON RESPONSE FROM THE PAYSTACK INITIALIZE TRANSACTION API
fmt.Println("JSON RESPONSE : ", verifyTransactionResponse)

fetchTransactionRequest := Transactions.FetchTransactionsResquest{
Id: "3030558719",
}

fetchTransactionResponse, _ := Transactions.Fetch(client, &fetchTransactionRequest)

fmt.Println("JSON RESPONSE : ", fetchTransactionResponse)
}


```

## Run Sample Test
Expand All @@ -72,18 +79,20 @@ go test
```

```GO
package initialize
package Transactions

import (
"testing"
"os"
"testing"

"github.com/Daniel-Sogbey/go-paystack/paystack"
"github.com/Daniel-Sogbey/paystack-go-sdk/internal"
"github.com/Daniel-Sogbey/paystack-go-sdk/paystack"
)

func TestInitializeTransactions(t *testing.T) {
func TestInitialize(t *testing.T) {
internal.LoadEnv()

client := paystack.NewClient("sk_test_f572197fbc13951b13afafc0d0f6517ed7ec12eb", "application/json")
client := paystack.NewClient(os.Getenv("API_KEY"), "application/json")

sampleInitializeTransactionRequest := &InitializeTransactionRequest{
Email: "1@2.com",
Expand All @@ -103,6 +112,7 @@ func TestInitializeTransactions(t *testing.T) {
}



```

## TODOS
Expand Down

0 comments on commit 00903f0

Please sign in to comment.