Documentation
¶
Index ¶
- Constants
- type Card
- type CardParams
- type Client
- type Customer
- type CustomerParams
- type Order
- type OrderParams
- type Payment
- type PaymentParams
- type Receiver
- type Resource
- type Settlement
- type VirtualAccount
- func (va *VirtualAccount) Close(id string, client *Client) (*VirtualAccount, error)
- func (va *VirtualAccount) Create(params *VirtualAccountParams, client *Client) (*VirtualAccount, error)
- func (va *VirtualAccount) Endpoint() string
- func (va *VirtualAccount) FindOne(id string, client *Client) (*VirtualAccount, error)
- func (va *VirtualAccount) GetNotes() map[string]string
- func (va *VirtualAccount) New() Resource
- type VirtualAccountParams
- type VirtualAccountReceiver
Constants ¶
const BaseURL = "https://api.razorpay.com/v1"
BaseURL stores the API base URL
const VAReceiverType = "bank_account"
VAReceiverType currently it is the only receiver type supported by virtual account endpoint
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
ID string `json:"id"`
Entity string `json:"entity"`
Name string `json:"name"`
Last4 string `json:"last4"`
Network string `json:"network"`
Type string `json:"type"`
Issuer string `json:"issuer"`
International string `json:"international"`
EMI string `json:"emi"`
}
Card struct represents the information of the card
type CardParams ¶
type CardParams struct {
ID string `json:"id"`
Entity string `json:"entity"`
Name string `json:"name"`
Last4 string `json:"last4"`
Network string `json:"network"`
Type string `json:"type"`
Issuer string `json:"issuer"`
International string `json:"international"`
EMI string `json:"emi"`
}
CardParams struct represents the information to create a card
type Client ¶
Client struct
type Customer ¶
type Customer struct {
ID string `json:"id"`
Entity string `json:"entity"`
Name string `json:"name"`
Email string `json:"email"`
// Contact number of the customer
Contact string `json:"contact"`
Notes map[string]string `json:"notes,omitempty"`
CreatedAt int `json:"created_at"`
}
Customer struct represents the information of the customer
func (*Customer) Create ¶
func (c *Customer) Create(params *CustomerParams, client *Client) (*Customer, error)
Create method will try to create a customer on razorpay
type CustomerParams ¶
type CustomerParams struct {
Name string `json:"name"`
Email string `json:"email"`
// Contact number of the customer
Contact string `json:"contact"`
Notes map[string]string `json:"notes"`
FailExisting string `json:"fail_existing"`
}
CustomerParams struct represents the information to create a customer
type Order ¶
type Order struct {
ID string `json:"id"`
Entity string `json:"entity"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Receipt string `json:"receipt"`
Status string `json:"status"`
Attempts int `json:"attempts"`
Notes map[string]string `json:"notes,omitempty"`
CreatedAt int `json:"created_at"`
AmountPaid int64 `json:"amount_paid"`
AmountDue int64 `json:"amount_due"`
}
Order struct represents the information of the order
func (*Order) Create ¶
func (o *Order) Create(params *OrderParams, client *Client) (*Order, error)
Create method will try to create a order on razorpay
type OrderParams ¶
type OrderParams struct {
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Receipt string `json:"receipt"`
PaymentCapture bool `json:"payment_capture"`
Notes map[string]string `json:"notes"`
}
OrderParams struct represents the information to create a order
type Payment ¶
type Payment struct {
ID string `json:"id"`
Entity string `json:"entity"`
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Status string `json:"status"`
OrderID string `json:"order_id"`
InvoiceID string `json:"invoice_id"`
International bool `json:"international"`
Method string `json:"method"`
AmountRefunded int64 `json:"amount_refunded"`
Captured bool `json:"captured"`
Description string `json:"description"`
CardID string `json:"card_id"`
Card Card `json:"car"`
Bank string `json:"bank"`
Email string `json:"email"`
Contact string `json:"contact"`
Notes interface{} `json:"notes,omitempty"`
Fee int64 `json:"fee"`
Tax int64 `json:"tax"`
CreatedAt int `json:"created_at"`
AmountPaid int64 `json:"amount_paid"`
AmountDue int64 `json:"amount_due"`
}
Payment struct represents the information of the payment
type PaymentParams ¶
type PaymentParams struct {
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Receipt string `json:"receipt"`
PaymentCapture bool `json:"payment_capture"`
Notes map[string]string `json:"notes"`
}
PaymentParams struct represents the information to create a payment
type Receiver ¶
type Receiver struct {
ID string `json:"id"`
Entity string `json:"entity"`
Name string `json:"name"`
AccountNo string `json:"account_number"`
IFSC string `json:"ifsc"`
}
Receiver struct for holding bank account info
type Settlement ¶
type Settlement struct {
ID string `json:"id"`
Entity string `json:"entity"`
Amount int64 `json:"amount"`
Status string `json:"status"`
Fees int64 `json:"fees"`
Tax int64 `json:"tax"`
UTR string `json:"utr"`
CreatedAt int64 `json:"created_at"`
}
Settlement struct contains the properties of settlement object
func (*Settlement) Endpoint ¶
func (o *Settlement) Endpoint() string
Endpoint method returns the endpoint of the resource
func (*Settlement) New ¶
func (o *Settlement) New() Resource
New method will create a settlement object and return a pointer to it
type VirtualAccount ¶
type VirtualAccount struct {
ID string `json:"id"`
Entity string `json:"entity"`
Description string `json:"description"`
CustomerID string `json:"customer_id"`
Status string `json:"status"`
AmountPaid int `json:"amount_paid"`
Receivers []Receiver `json:"receivers"`
Notes interface{} `json:"notes,omitempty"`
CreatedAt int `json:"created_at"`
}
VirtualAccount struct holds info regarding the virtual account
func (*VirtualAccount) Close ¶
func (va *VirtualAccount) Close(id string, client *Client) (*VirtualAccount, error)
Close method will close the virtual account
func (*VirtualAccount) Create ¶
func (va *VirtualAccount) Create(params *VirtualAccountParams, client *Client) (*VirtualAccount, error)
Create method will try to create a customer on razorpay
func (*VirtualAccount) Endpoint ¶
func (va *VirtualAccount) Endpoint() string
Endpoint method returns the endpoint of the resource
func (*VirtualAccount) FindOne ¶
func (va *VirtualAccount) FindOne(id string, client *Client) (*VirtualAccount, error)
FindOne tries to find the customer with given id
func (*VirtualAccount) GetNotes ¶
func (va *VirtualAccount) GetNotes() map[string]string
GetNotes function is used to return a map of the notes
func (*VirtualAccount) New ¶
func (va *VirtualAccount) New() Resource
New method will create a customer object and return a pointer to it
type VirtualAccountParams ¶
type VirtualAccountParams struct {
Description string `json:"description"`
CustomerID string `json:"customer_id"`
Receivers VirtualAccountReceiver `json:"receivers"`
Notes map[string]string `json:"notes,omitempty"`
}
VirtualAccountParams struct contains the params required for creating a virtual account
type VirtualAccountReceiver ¶
type VirtualAccountReceiver struct {
Types []string `json:"types"`
}
VirtualAccountReceiver struct contain the receiver properties