razorpay-go

module
v0.0.0-...-b851f3e Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT

README

Razorpay Go Client

Golang bindings for interacting with the Razorpay API

Usage

You need to setup your key and secret using the following: You can find your API keys at https://dashboard.razorpay.com/#/app/keys.

package main

import (
	"context"
	"net/http"
	"time"

	razorpay "github.com/gamezop/razorpay-go/pkg/client"
	"github.com/gamezop/razorpay-go/pkg/resource"
)

func main() {
	httpClient := &http.Client{Timeout: time.Second * 30}
	client := razorpay.NewClient(httpClient, "<YOUR_API_KEY>", "<YOUR_API_SECRET>")

	// example api:
	contact, err = client.CreateContact(context.Background(), resource.RequestCreateContact{
		Name:        "Gaurav Kumar",
		Email:       "gaurav.kumar@example.com",
		Contact:     "9123456789",
		Type:        "customer",
		ReferenceID: "Acme Contact ID 12345",
	})
}

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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