paygap

module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2023 License: Apache-2.0

README

PayGap

Payment gateway providers SDK Go for zarinpal, idpay, pay.ir, and other gateway providers.

Install

go get -u github.com/GoFarsi/paygap

Usage

example for zarinpal provider

package main

import (
	"context"
	"fmt"
	"github.com/gofarsi/paygap/client"
	zarinpal "github.com/gofarsi/paygap/providers/zarinpal/v4"
	"log"
)

func main() {
	c := client.New()
	z, err := zarinpal.New(c, "YOUR_MERCHANT_ID", false)
	if err != nil {
		log.Fatal(err)
	}

	resp, err := z.RequestPayment(context.Background(), 1000, "YOUR_CALL_BACK", "YOUR_CURRENCY", "description", nil)
	if err != nil {
		log.Fatal(err)
	}
	
	fmt.Println(resp)
}

Directories

Path Synopsis
_example
providers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL