Skip to content

Commit

Permalink
feat: add idpay provider to paygap
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad committed Jan 5, 2023
1 parent e97b736 commit ae5b9c2
Show file tree
Hide file tree
Showing 8 changed files with 820 additions and 8 deletions.
32 changes: 32 additions & 0 deletions _example/idpay/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"context"
"fmt"
"github.com/GoFarsi/paygap/client"
"github.com/GoFarsi/paygap/providers/idpay"
"log"
)

func main() {
c := client.New()
i, err := idpay.New(c, "YOUR_API_KEY", false)
if err != nil {
log.Fatal(err)
}

resp, err := i.CreateTransaction(context.Background(), &idpay.PaymentRequest{
OrderId: "xxxxxxxx-xxxxxx-xxxx",
Amount: 5000,
Name: "transaction A",
Phone: "09151234567",
Mail: "[email protected]",
Desc: "example description",
Callback: "http://example.com/callback",
})
if err != nil {
log.Fatal(err)
}

fmt.Println(resp)
}
4 changes: 2 additions & 2 deletions _example/zarinpal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"context"
"fmt"
"github.com/gofarsi/paygap/client"
zarinpal "github.com/gofarsi/paygap/providers/zarinpal/v4"
"github.com/GoFarsi/paygap/client"
"github.com/GoFarsi/paygap/providers/zarinpal"
"log"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/gofarsi/paygap
module github.com/GoFarsi/paygap

go 1.19

Expand Down
Loading

0 comments on commit ae5b9c2

Please sign in to comment.