razorpay

package module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 5 Imported by: 43

README

Razorpay Go Client

Golang bindings for interacting with the Razorpay API

This is primarily meant for merchants who wish to perform interactions with the Razorpay API programatically

Read up here for getting started and understanding the payment flow with Razorpay: https://razorpay.com/docs/get-started/

Documentation

Documentation of Razorpay's API and their usage is available at https://docs.razorpay.com

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.

import (
razorpay "github.com/razorpay/razorpay-go"
)

client := razorpay.NewClient("<YOUR_API_KEY>", "<YOUR_API_SECRET>")

Note: All methods below return a map[string]interface{} and error. All methods accept an extraHeaders param of type map[string]string, allowing you to optinally set extra HTTP headers on the request.

Supported Resources

License

The Razorpay Go SDK is released under the MIT License. See LICENSE file for more details.

Documentation

Index

Constants

View Source
const SDKName = "razorpay-go"

SDKName ...Name of this SDK

View Source
const SDKVersion = "1.3.2"

SDKVersion ...

Variables

Request ...

Functions

This section is empty.

Types

type Client

type Client struct {
	Addon          *resources.Addon
	Account        *resources.Account
	Card           *resources.Card
	Customer       *resources.Customer
	Invoice        *resources.Invoice
	PaymentLink    *resources.PaymentLink
	Order          *resources.Order
	Payment        *resources.Payment
	Plan           *resources.Plan
	Product        *resources.Product
	Refund         *resources.Refund
	Subscription   *resources.Subscription
	Token          *resources.Token
	Transfer       *resources.Transfer
	VirtualAccount *resources.VirtualAccount
	QrCode         *resources.QrCode
	FundAccount    *resources.FundAccount
	Settlement     *resources.Settlement
	Stakeholder    *resources.Stakeholder
	Item           *resources.Item
	Iin            *resources.Iin
	Webhook        *resources.Webhook
	Document       *resources.Document
	Dispute        *resources.Dispute
}

Client provides various helper methods to make HTTP requests to Razorpay's APIs.

func NewClient

func NewClient(key string, secret string) *Client

NewClient creates and returns a new Razorpay client. key and secret are used to authenticate the requests made to Razorpay's APIs.

func (*Client) AddHeaders

func (client *Client) AddHeaders(headers map[string]string)

AddHeaders adds additional headers to Razorpay's client. All requests made using the client will contain these additional headers in the HTTP request.

func (*Client) SetTimeout

func (client *Client) SetTimeout(timeout int16)

SetTimeout sets the timeout of Razorpay's Client. The default timeout will be overridden for all HTTP requests made using this client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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