Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Card
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type Customer
- type CustomerListParams
- type CustomerListResponse
- type CustomerNewParams
- type CustomerService
- func (r *CustomerService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Customer, err error)
- func (r *CustomerService) List(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) (res *CustomerListResponse, err error)
- func (r *CustomerService) New(ctx context.Context, body CustomerNewParams, opts ...option.RequestOption) (res *Customer, err error)
- func (r *CustomerService) Update(ctx context.Context, id string, body CustomerUpdateParams, ...) (res *Customer, err error)
- type CustomerUpdateParams
- type Error
- type NotesUnion
- type NotesUnionParam
- type Order
- type OrderFetchPaymentsParams
- type OrderFetchPaymentsParamsExpand
- type OrderFetchPaymentsResponse
- type OrderListParams
- type OrderListResponse
- type OrderNewParams
- type OrderService
- func (r *OrderService) FetchPayments(ctx context.Context, id string, query OrderFetchPaymentsParams, ...) (res *OrderFetchPaymentsResponse, err error)
- func (r *OrderService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Order, err error)
- func (r *OrderService) List(ctx context.Context, query OrderListParams, opts ...option.RequestOption) (res *OrderListResponse, err error)
- func (r *OrderService) New(ctx context.Context, body OrderNewParams, opts ...option.RequestOption) (res *Order, err error)
- func (r *OrderService) Update(ctx context.Context, id string, body OrderUpdateParams, ...) (res *Order, err error)
- type OrderUpdateParams
- type Payment
- type PaymentAcquirerData
- type PaymentCaptureParams
- type PaymentEmi
- type PaymentGetParams
- type PaymentGetParamsExpand
- type PaymentGetRefundParams
- type PaymentLink
- type PaymentLinkCustomer
- type PaymentLinkListParams
- type PaymentLinkListResponse
- type PaymentLinkNewParams
- type PaymentLinkNewParamsCustomer
- type PaymentLinkNewParamsNotify
- type PaymentLinkNotify
- type PaymentLinkNotifyParams
- type PaymentLinkNotifyParamsMedium
- type PaymentLinkNotifyResponse
- type PaymentLinkPayment
- type PaymentLinkRemindersUnion
- type PaymentLinkService
- func (r *PaymentLinkService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *PaymentLink, err error)
- func (r *PaymentLinkService) List(ctx context.Context, query PaymentLinkListParams, opts ...option.RequestOption) (res *PaymentLinkListResponse, err error)
- func (r *PaymentLinkService) New(ctx context.Context, body PaymentLinkNewParams, opts ...option.RequestOption) (res *PaymentLink, err error)
- func (r *PaymentLinkService) Notify(ctx context.Context, medium PaymentLinkNotifyParamsMedium, ...) (res *PaymentLinkNotifyResponse, err error)
- func (r *PaymentLinkService) Update(ctx context.Context, id string, body PaymentLinkUpdateParams, ...) (res *PaymentLink, err error)
- type PaymentLinkStatus
- type PaymentLinkUpdateParams
- type PaymentListParams
- type PaymentListParamsExpand
- type PaymentListRefundsParams
- type PaymentListResponse
- type PaymentMethod
- type PaymentNewRefundParams
- type PaymentNewRefundParamsSpeed
- type PaymentQrCodeGetParams
- type PaymentQrCodeListParams
- type PaymentQrCodeNewParams
- type PaymentQrCodeNewParamsType
- type PaymentQrCodeNewParamsUsage
- type PaymentQrCodeService
- func (r *PaymentQrCodeService) Close(ctx context.Context, id string, opts ...option.RequestOption) (res *QrCode, err error)
- func (r *PaymentQrCodeService) Get(ctx context.Context, id string, query PaymentQrCodeGetParams, ...) (res *QrCode, err error)
- func (r *PaymentQrCodeService) List(ctx context.Context, query PaymentQrCodeListParams, ...) (res *QrCodeList, err error)
- func (r *PaymentQrCodeService) New(ctx context.Context, body PaymentQrCodeNewParams, opts ...option.RequestOption) (res *QrCode, err error)
- type PaymentRefundService
- type PaymentService
- func (r *PaymentService) Capture(ctx context.Context, id string, body PaymentCaptureParams, ...) (res *Payment, err error)
- func (r *PaymentService) Get(ctx context.Context, id string, query PaymentGetParams, ...) (res *Payment, err error)
- func (r *PaymentService) GetCardDetails(ctx context.Context, id string, opts ...option.RequestOption) (res *Card, err error)
- func (r *PaymentService) GetRefund(ctx context.Context, refundID string, query PaymentGetRefundParams, ...) (res *Refund, err error)
- func (r *PaymentService) List(ctx context.Context, query PaymentListParams, opts ...option.RequestOption) (res *PaymentListResponse, err error)
- func (r *PaymentService) ListRefunds(ctx context.Context, id string, query PaymentListRefundsParams, ...) (res *RefundList, err error)
- func (r *PaymentService) NewRefund(ctx context.Context, id string, body PaymentNewRefundParams, ...) (res *Refund, err error)
- func (r *PaymentService) Update(ctx context.Context, id string, body PaymentUpdateParams, ...) (res *Payment, err error)
- type PaymentStatus
- type PaymentUpdateParams
- type PaymentUpdateParamsNotesUnion
- type Payout
- type PayoutListParams
- type PayoutListParamsMode
- type PayoutListParamsStatus
- type PayoutListResponse
- type PayoutMode
- type PayoutService
- type PayoutStatus
- type PayoutStatusDetails
- type QrCode
- type QrCodeCloseReason
- type QrCodeList
- type QrCodeStatus
- type QrCodeTaxInvoice
- type QrCodeType
- type QrCodeUsage
- type Refund
- type RefundAcquirerData
- type RefundList
- type RefundListParams
- type RefundService
- func (r *RefundService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Refund, err error)
- func (r *RefundService) List(ctx context.Context, query RefundListParams, opts ...option.RequestOption) (res *RefundList, err error)
- func (r *RefundService) Update(ctx context.Context, id string, body RefundUpdateParams, ...) (res *Refund, err error)
- type RefundSpeedProcessed
- type RefundSpeedRequested
- type RefundStatus
- type RefundUpdateParams
- type Settlement
- type SettlementListParams
- type SettlementListResponse
- type SettlementOndemand
- type SettlementOndemandNewParams
- type SettlementOndemandOndemandPayouts
- type SettlementOndemandOndemandPayoutsItem
- type SettlementOndemandService
- type SettlementOndemandStatus
- type SettlementReconGetParams
- type SettlementReconGetResponse
- type SettlementReconGetResponseItem
- type SettlementReconService
- type SettlementService
- type SettlementStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (GOMON_USERNAME, GOMON_PASSWORD, GOMON_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Card ¶
type Card struct {
// Unique identifier of the card.
ID string `json:"id"`
// Indicates if the card supports EMI.
Emi bool `json:"emi"`
// Name of the entity. Here, it is card.
Entity string `json:"entity"`
// Indicates if the card is international.
International bool `json:"international"`
// Card issuer code.
Issuer string `json:"issuer"`
// Last four digits of the card.
Last4 string `json:"last4"`
// Name on the card.
Name string `json:"name"`
// Card network.
Network string `json:"network"`
// Card sub type.
SubType string `json:"sub_type"`
// IIN of the tokenized card.
TokenIin string `json:"token_iin,nullable"`
// Card type.
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Emi respjson.Field
Entity respjson.Field
International respjson.Field
Issuer respjson.Field
Last4 respjson.Field
Name respjson.Field
Network respjson.Field
SubType respjson.Field
TokenIin respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Card) UnmarshalJSON ¶
type Client ¶
type Client struct {
Options []option.RequestOption
Orders OrderService
Customers CustomerService
Payments PaymentService
PaymentLinks PaymentLinkService
Refunds RefundService
Settlements SettlementService
Payouts PayoutService
}
Client creates a struct with services and top level methods that help with interacting with the gomon API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (GOMON_USERNAME, GOMON_PASSWORD, GOMON_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type Customer ¶
type Customer struct {
// Unique identifier of the customer.
ID string `json:"id"`
// The customer's phone number. A maximum length of 15 characters including country
// code.
Contact string `json:"contact"`
// UNIX timestamp, when the customer was created.
CreatedAt int64 `json:"created_at"`
// The customer's email address. A maximum length of 64 characters.
Email string `json:"email"`
// Indicates the type of entity.
Entity string `json:"entity"`
// GST number linked to the customer.
Gstin string `json:"gstin,nullable"`
// Customer's name. Alphanumeric, with period (.), apostrophe ('), forward slash
// (/), at (@) and parentheses allowed. The name must be between 3-50 characters in
// length.
Name string `json:"name"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Contact respjson.Field
CreatedAt respjson.Field
Email respjson.Field
Entity respjson.Field
Gstin respjson.Field
Name respjson.Field
Notes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Customer) UnmarshalJSON ¶
type CustomerListParams ¶
type CustomerListParams struct {
// The number of customer records to be retrieved from the system. The default
// value is 10. The maximum value is 100. This can be used for pagination in
// combination with skip.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// The number of customer records that must be skipped. The default value is 0.
// This can be used for pagination in combination with count.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CustomerListParams) URLQuery ¶
func (r CustomerListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CustomerListParams's query parameters as `url.Values`.
type CustomerListResponse ¶
type CustomerListResponse struct {
// The number of customer records returned in this response.
Count int64 `json:"count"`
// Indicates the type of entity. Always 'collection' for this response.
Entity string `json:"entity"`
// List of customer objects.
Items []Customer `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CustomerListResponse) RawJSON ¶
func (r CustomerListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomerListResponse) UnmarshalJSON ¶
func (r *CustomerListResponse) UnmarshalJSON(data []byte) error
type CustomerNewParams ¶
type CustomerNewParams struct {
// The customer's phone number. A maximum length of 15 characters including country
// code.
Contact string `json:"contact,required"`
// The customer's email address. A maximum length of 64 characters.
Email string `json:"email,required"`
// Customer's name. Alphanumeric value with period (.), apostrophe ('), forward
// slash (/), at (@) and parentheses are allowed. The name must be between 3-50
// characters in length.
Name string `json:"name,required"`
// Possible values: false (fetches details of existing customer), true (default,
// throws error if customer exists).
FailExisting param.Opt[bool] `json:"fail_existing,omitzero"`
// Customer's GST number, if available.
Gstin param.Opt[string] `json:"gstin,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// contains filtered or unexported fields
}
func (CustomerNewParams) MarshalJSON ¶
func (r CustomerNewParams) MarshalJSON() (data []byte, err error)
func (*CustomerNewParams) UnmarshalJSON ¶
func (r *CustomerNewParams) UnmarshalJSON(data []byte) error
type CustomerService ¶
type CustomerService struct {
Options []option.RequestOption
}
CustomerService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerService method instead.
func NewCustomerService ¶
func NewCustomerService(opts ...option.RequestOption) (r CustomerService)
NewCustomerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CustomerService) Get ¶
func (r *CustomerService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Customer, err error)
Use this endpoint to retrieve details of a customer with id. [See docs](https://razorpay.com/docs/api/customers/fetch-with-id/)
func (*CustomerService) List ¶
func (r *CustomerService) List(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) (res *CustomerListResponse, err error)
Use this endpoint to retrieve the details of all the customers. [See docs](https://razorpay.com/docs/api/customers/fetch-all/)
func (*CustomerService) New ¶
func (r *CustomerService) New(ctx context.Context, body CustomerNewParams, opts ...option.RequestOption) (res *Customer, err error)
Use this endpoint to create or add a customer with basic details such as name and contact details.
func (*CustomerService) Update ¶
func (r *CustomerService) Update(ctx context.Context, id string, body CustomerUpdateParams, opts ...option.RequestOption) (res *Customer, err error)
Use this endpoint to edit the customer details such as name, email, and contact details. The combination of email and contact must be unique for every customer.
type CustomerUpdateParams ¶
type CustomerUpdateParams struct {
// The customer's phone number. A maximum length of 15 characters including country
// code.
Contact param.Opt[string] `json:"contact,omitzero"`
// The customer's email address. A maximum length of 64 characters.
Email param.Opt[string] `json:"email,omitzero"`
// Customer's name. Alphanumeric, with period (.), apostrophe ('), forward slash
// (/), at (@) and parentheses allowed. The name must be between 3-50 characters in
// length.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (CustomerUpdateParams) MarshalJSON ¶
func (r CustomerUpdateParams) MarshalJSON() (data []byte, err error)
func (*CustomerUpdateParams) UnmarshalJSON ¶
func (r *CustomerUpdateParams) UnmarshalJSON(data []byte) error
type NotesUnion ¶
type NotesUnion struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a [[]string] instead of an object.
OfStringArray []string `json:",inline"`
JSON struct {
OfString respjson.Field
OfStringArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
NotesUnion contains all possible properties and values from [map[string]string], [[]string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]
func (NotesUnion) AsStringArray ¶
func (u NotesUnion) AsStringArray() (v []string)
func (NotesUnion) AsStringMap ¶
func (u NotesUnion) AsStringMap() (v map[string]string)
func (NotesUnion) RawJSON ¶
func (u NotesUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (NotesUnion) ToParam ¶
func (r NotesUnion) ToParam() NotesUnionParam
ToParam converts this NotesUnion to a NotesUnionParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with NotesUnionParam.Overrides()
func (*NotesUnion) UnmarshalJSON ¶
func (r *NotesUnion) UnmarshalJSON(data []byte) error
type NotesUnionParam ¶
type NotesUnionParam struct {
OfStringMap map[string]string `json:",omitzero,inline"`
OfStringArray []string `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (NotesUnionParam) MarshalJSON ¶
func (u NotesUnionParam) MarshalJSON() ([]byte, error)
func (*NotesUnionParam) UnmarshalJSON ¶
func (u *NotesUnionParam) UnmarshalJSON(data []byte) error
type Order ¶
type Order struct {
ID string `json:"id"`
Amount int64 `json:"amount"`
AmountDue int64 `json:"amount_due"`
AmountPaid int64 `json:"amount_paid"`
Attempts int64 `json:"attempts"`
CodFee int64 `json:"cod_fee"`
CreatedAt int64 `json:"created_at"`
Currency string `json:"currency"`
Entity string `json:"entity"`
LineItemsTotal int64 `json:"line_items_total"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
OfferID string `json:"offer_id,nullable"`
Receipt string `json:"receipt"`
ShippingFee int64 `json:"shipping_fee"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
AmountDue respjson.Field
AmountPaid respjson.Field
Attempts respjson.Field
CodFee respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Entity respjson.Field
LineItemsTotal respjson.Field
Notes respjson.Field
OfferID respjson.Field
Receipt respjson.Field
ShippingFee respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Order) UnmarshalJSON ¶
type OrderFetchPaymentsParams ¶
type OrderFetchPaymentsParams struct {
// Use to expand the card or EMI details for each payment.
//
// Any of "card", "emi".
Expand OrderFetchPaymentsParamsExpand `query:"expand[],omitzero" json:"-"`
// contains filtered or unexported fields
}
func (OrderFetchPaymentsParams) URLQuery ¶
func (r OrderFetchPaymentsParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrderFetchPaymentsParams's query parameters as `url.Values`.
type OrderFetchPaymentsParamsExpand ¶
type OrderFetchPaymentsParamsExpand string
Use to expand the card or EMI details for each payment.
const ( OrderFetchPaymentsParamsExpandCard OrderFetchPaymentsParamsExpand = "card" OrderFetchPaymentsParamsExpandEmi OrderFetchPaymentsParamsExpand = "emi" )
type OrderFetchPaymentsResponse ¶
type OrderFetchPaymentsResponse struct {
// Number of payments returned.
Count int64 `json:"count"`
// Name of the entity. Always 'collection'.
Entity string `json:"entity"`
// List of payment objects.
Items []Payment `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OrderFetchPaymentsResponse) RawJSON ¶
func (r OrderFetchPaymentsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrderFetchPaymentsResponse) UnmarshalJSON ¶
func (r *OrderFetchPaymentsResponse) UnmarshalJSON(data []byte) error
type OrderListParams ¶
type OrderListParams struct {
// The number of orders to be fetched. The default value is 10. The maximum value
// is 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// Timestamp (in Unix format) from when the orders should be fetched.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// Retrieves the orders that contain the provided value for receipt.
Receipt param.Opt[string] `query:"receipt,omitzero" json:"-"`
// The number of orders to be skipped. The default value is 0.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Timestamp (in Unix format) up till when orders are to be fetched.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// Retrieves Orders for which payments have been authorized. Payment and order
// states differ.
//
// Any of true, false.
Authorized bool `query:"authorized,omitzero" json:"-"`
// Used to retrieve additional information about the payment.
//
// Any of "payments", "payments.card", "transfers", "virtual_account".
Expand []string `query:"expand,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (OrderListParams) URLQuery ¶
func (r OrderListParams) URLQuery() (v url.Values, err error)
URLQuery serializes OrderListParams's query parameters as `url.Values`.
type OrderListResponse ¶
type OrderListResponse struct {
Count int64 `json:"count"`
Entity string `json:"entity"`
Items []Order `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OrderListResponse) RawJSON ¶
func (r OrderListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrderListResponse) UnmarshalJSON ¶
func (r *OrderListResponse) UnmarshalJSON(data []byte) error
type OrderNewParams ¶
type OrderNewParams struct {
// Amount in the smallest currency unit (e.g., paise)
Amount int64 `json:"amount,required"`
// ISO currency code
Currency string `json:"currency,required"`
// Minimum amount for the first partial payment
FirstPaymentMinAmount param.Opt[int64] `json:"first_payment_min_amount,omitzero"`
// Unique identifier for the offer
OfferID param.Opt[string] `json:"offer_id,omitzero"`
// Allow partial payments
PartialPayment param.Opt[bool] `json:"partial_payment,omitzero"`
// Receipt number for internal reference
Receipt param.Opt[string] `json:"receipt,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// contains filtered or unexported fields
}
func (OrderNewParams) MarshalJSON ¶
func (r OrderNewParams) MarshalJSON() (data []byte, err error)
func (*OrderNewParams) UnmarshalJSON ¶
func (r *OrderNewParams) UnmarshalJSON(data []byte) error
type OrderService ¶
type OrderService struct {
Options []option.RequestOption
}
OrderService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrderService method instead.
func NewOrderService ¶
func NewOrderService(opts ...option.RequestOption) (r OrderService)
NewOrderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OrderService) FetchPayments ¶
func (r *OrderService) FetchPayments(ctx context.Context, id string, query OrderFetchPaymentsParams, opts ...option.RequestOption) (res *OrderFetchPaymentsResponse, err error)
Use this endpoint to retrieve all payments corresponding to a specific order. [See docs](https://razorpay.com/docs/api/payments/fetch-payments-orders)
func (*OrderService) Get ¶
func (r *OrderService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Order, err error)
Fetch an order by its unique ID.
func (*OrderService) List ¶
func (r *OrderService) List(ctx context.Context, query OrderListParams, opts ...option.RequestOption) (res *OrderListResponse, err error)
Use this endpoint to retrieve the details of all the orders you created.
func (*OrderService) New ¶
func (r *OrderService) New(ctx context.Context, body OrderNewParams, opts ...option.RequestOption) (res *Order, err error)
Create a new order.
func (*OrderService) Update ¶
func (r *OrderService) Update(ctx context.Context, id string, body OrderUpdateParams, opts ...option.RequestOption) (res *Order, err error)
Update an order's notes or other editable fields.
type OrderUpdateParams ¶
type OrderUpdateParams struct {
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// contains filtered or unexported fields
}
func (OrderUpdateParams) MarshalJSON ¶
func (r OrderUpdateParams) MarshalJSON() (data []byte, err error)
func (*OrderUpdateParams) UnmarshalJSON ¶
func (r *OrderUpdateParams) UnmarshalJSON(data []byte) error
type Payment ¶
type Payment struct {
// Unique identifier of the payment.
ID string `json:"id"`
// A dynamic array consisting of unique reference numbers.
AcquirerData PaymentAcquirerData `json:"acquirer_data"`
// The payment amount in currency subunits. For example, for an amount of ₹1.00
// enter 100.
Amount int64 `json:"amount"`
// The amount refunded in currency subunits.
AmountRefunded int64 `json:"amount_refunded"`
// The 4-character bank code which the customer's account is associated with.
Bank string `json:"bank,nullable"`
// Indicates if the payment is captured.
Captured bool `json:"captured"`
// Details of the card used to make the payment. Present only if method is 'card'
// and expand[]=card is used.
Card Card `json:"card,nullable"`
// The unique identifier of the card used by the customer to make the payment.
CardID string `json:"card_id,nullable"`
// Customer contact number used for the payment.
Contact string `json:"contact"`
// Timestamp, in UNIX format, on which the payment was created.
CreatedAt int64 `json:"created_at"`
// The currency in which the payment is made.
Currency string `json:"currency"`
// Description of the payment, if any.
Description string `json:"description"`
// Customer email address used for the payment.
Email string `json:"email"`
// Details of the EMI plan used to make the payment. Present only if method is
// 'emi' and expand[]=emi is used.
Emi PaymentEmi `json:"emi,nullable"`
// Indicates the type of entity.
Entity string `json:"entity"`
// Error that occurred during payment.
ErrorCode string `json:"error_code,nullable"`
// Description of the error that occurred during payment.
ErrorDescription string `json:"error_description,nullable"`
// The exact error reason.
ErrorReason string `json:"error_reason,nullable"`
// The point of failure.
ErrorSource string `json:"error_source,nullable"`
// The stage where the transaction failure occurred.
ErrorStep string `json:"error_step,nullable"`
// Fee (including GST) charged by Razorpay.
Fee int64 `json:"fee"`
// Indicates whether the payment is done via an international card or a domestic
// one.
International bool `json:"international"`
// Invoice id, if any.
InvoiceID string `json:"invoice_id,nullable"`
// The payment method used for making the payment.
//
// Any of "card", "netbanking", "wallet", "emi", "upi".
Method PaymentMethod `json:"method"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// Order id, if provided.
OrderID string `json:"order_id"`
// The refund status of the payment.
RefundStatus string `json:"refund_status,nullable"`
Reward string `json:"reward,nullable"`
SourceChannel string `json:"source_channel,nullable"`
// The status of the payment.
//
// Any of "created", "authorized", "captured", "refunded", "failed".
Status PaymentStatus `json:"status"`
// GST charged for the payment.
Tax int64 `json:"tax"`
// The customer's VPA (Virtual Payment Address) or UPI id used to make the payment.
Vpa string `json:"vpa,nullable"`
// The name of the wallet used by the customer to make the payment.
Wallet string `json:"wallet,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AcquirerData respjson.Field
Amount respjson.Field
AmountRefunded respjson.Field
Bank respjson.Field
Captured respjson.Field
Card respjson.Field
CardID respjson.Field
Contact respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Description respjson.Field
Email respjson.Field
Emi respjson.Field
Entity respjson.Field
ErrorCode respjson.Field
ErrorDescription respjson.Field
ErrorReason respjson.Field
ErrorSource respjson.Field
ErrorStep respjson.Field
Fee respjson.Field
International respjson.Field
InvoiceID respjson.Field
Method respjson.Field
Notes respjson.Field
OrderID respjson.Field
RefundStatus respjson.Field
Reward respjson.Field
SourceChannel respjson.Field
Status respjson.Field
Tax respjson.Field
Vpa respjson.Field
Wallet respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Payment) UnmarshalJSON ¶
type PaymentAcquirerData ¶
type PaymentAcquirerData struct {
Arn string `json:"arn"`
// Bank transaction ID
BankTransactionID string `json:"bank_transaction_id"`
Rrn string `json:"rrn"`
// transaction ID
TransactionID string `json:"transaction_id"`
// Upi transaction ID
UpiTransactionID string `json:"upi_transaction_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arn respjson.Field
BankTransactionID respjson.Field
Rrn respjson.Field
TransactionID respjson.Field
UpiTransactionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dynamic array consisting of unique reference numbers.
func (PaymentAcquirerData) RawJSON ¶
func (r PaymentAcquirerData) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentAcquirerData) UnmarshalJSON ¶
func (r *PaymentAcquirerData) UnmarshalJSON(data []byte) error
type PaymentCaptureParams ¶
type PaymentCaptureParams struct {
// The amount to be captured.
Amount param.Opt[int64] `json:"amount,omitzero"`
// The currency in which the payment is made.
Currency param.Opt[string] `json:"currency,omitzero"`
// contains filtered or unexported fields
}
func (PaymentCaptureParams) MarshalJSON ¶
func (r PaymentCaptureParams) MarshalJSON() (data []byte, err error)
func (*PaymentCaptureParams) UnmarshalJSON ¶
func (r *PaymentCaptureParams) UnmarshalJSON(data []byte) error
type PaymentEmi ¶
type PaymentEmi struct {
// The duration of the EMI plan in months.
Duration int64 `json:"duration"`
// The bank code of the EMI issuer.
Issuer string `json:"issuer"`
// The interest rate (in basis points) for the EMI plan.
Rate int64 `json:"rate"`
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Duration respjson.Field
Issuer respjson.Field
Rate respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Details of the EMI plan used to make the payment. Present only if method is 'emi' and expand[]=emi is used.
func (PaymentEmi) RawJSON ¶
func (r PaymentEmi) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentEmi) UnmarshalJSON ¶
func (r *PaymentEmi) UnmarshalJSON(data []byte) error
type PaymentGetParams ¶
type PaymentGetParams struct {
// Use to expand the card or EMI details when the payment method is 'card' or
// 'emi'.
//
// Any of "card", "emi".
Expand PaymentGetParamsExpand `query:"expand[],omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PaymentGetParams) URLQuery ¶
func (r PaymentGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentGetParams's query parameters as `url.Values`.
type PaymentGetParamsExpand ¶
type PaymentGetParamsExpand string
Use to expand the card or EMI details when the payment method is 'card' or 'emi'.
const ( PaymentGetParamsExpandCard PaymentGetParamsExpand = "card" PaymentGetParamsExpandEmi PaymentGetParamsExpand = "emi" )
type PaymentGetRefundParams ¶
type PaymentGetRefundParams struct {
ID string `path:"id,required" json:"-"`
// contains filtered or unexported fields
}
type PaymentLink ¶
type PaymentLink struct {
// Unique identifier of the Payment Link.
ID string `json:"id"`
// Indicates whether customers can make partial payments.
AcceptPartial bool `json:"accept_partial"`
// Amount to be paid using the Payment Link.
Amount int64 `json:"amount"`
// Amount paid by the customer.
AmountPaid int64 `json:"amount_paid"`
// Callback method.
CallbackMethod string `json:"callback_method"`
// Redirect URL after payment.
CallbackURL string `json:"callback_url"`
// Timestamp at which the Payment Link was cancelled.
CancelledAt int64 `json:"cancelled_at"`
// Timestamp when the Payment Link was created.
CreatedAt int64 `json:"created_at"`
// Currency code.
Currency string `json:"currency"`
// Customer details.
Customer PaymentLinkCustomer `json:"customer"`
// Description of the Payment Link.
Description string `json:"description"`
// Name of the entity. Always 'payment_link'.
Entity string `json:"entity"`
// Expiry timestamp.
ExpireBy int64 `json:"expire_by"`
// Timestamp at which the Payment Link expired.
ExpiredAt int64 `json:"expired_at"`
// Minimum amount for the first partial payment.
FirstMinPartialAmount int64 `json:"first_min_partial_amount"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// Notification settings.
Notify PaymentLinkNotify `json:"notify"`
// Payment details such as amount, payment id, Payment Link id and more. This array
// is populated only after a payment is made by the customer or if the payment
// fails. Until then, the value is null.
Payments []PaymentLinkPayment `json:"payments,nullable"`
// Reference number tagged to a Payment Link.
ReferenceID string `json:"reference_id"`
// Used to send reminders for the Payment Link.
ReminderEnable bool `json:"reminder_enable"`
Reminders PaymentLinkRemindersUnion `json:"reminders"`
// The unique short URL generated for the Payment Link.
ShortURL string `json:"short_url"`
// Source of the Payment Link creation (if applicable).
Source string `json:"source"`
// Identifier for the source (if applicable).
SourceID string `json:"source_id"`
// Current state of the Payment Link.
//
// Any of "created", "partially_paid", "expired", "cancelled", "paid".
Status PaymentLinkStatus `json:"status"`
// Timestamp when the Payment Link was updated.
UpdatedAt int64 `json:"updated_at"`
// Unique identifier for the user role through which the Payment Link was created.
UserID string `json:"user_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AcceptPartial respjson.Field
Amount respjson.Field
AmountPaid respjson.Field
CallbackMethod respjson.Field
CallbackURL respjson.Field
CancelledAt respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Customer respjson.Field
Description respjson.Field
Entity respjson.Field
ExpireBy respjson.Field
ExpiredAt respjson.Field
FirstMinPartialAmount respjson.Field
Notes respjson.Field
Notify respjson.Field
Payments respjson.Field
ReferenceID respjson.Field
ReminderEnable respjson.Field
Reminders respjson.Field
ShortURL respjson.Field
Source respjson.Field
SourceID respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaymentLink) RawJSON ¶
func (r PaymentLink) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLink) UnmarshalJSON ¶
func (r *PaymentLink) UnmarshalJSON(data []byte) error
type PaymentLinkCustomer ¶
type PaymentLinkCustomer struct {
// Contact number of the customer.
Contact string `json:"contact"`
// Email address of the customer.
Email string `json:"email"`
// Name of the customer.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Contact respjson.Field
Email respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Customer details.
func (PaymentLinkCustomer) RawJSON ¶
func (r PaymentLinkCustomer) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLinkCustomer) UnmarshalJSON ¶
func (r *PaymentLinkCustomer) UnmarshalJSON(data []byte) error
type PaymentLinkListParams ¶
type PaymentLinkListParams struct {
// Unique identifier of the payment associated with the Payment Link.
PaymentID param.Opt[string] `query:"payment_id,omitzero" json:"-"`
// The unique reference number entered while creating the Payment Link.
ReferenceID param.Opt[string] `query:"reference_id,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PaymentLinkListParams) URLQuery ¶
func (r PaymentLinkListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentLinkListParams's query parameters as `url.Values`.
type PaymentLinkListResponse ¶
type PaymentLinkListResponse struct {
// List of Payment Links.
PaymentLinks []PaymentLink `json:"payment_links"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PaymentLinks respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaymentLinkListResponse) RawJSON ¶
func (r PaymentLinkListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLinkListResponse) UnmarshalJSON ¶
func (r *PaymentLinkListResponse) UnmarshalJSON(data []byte) error
type PaymentLinkNewParams ¶
type PaymentLinkNewParams struct {
// Amount to be paid using the Payment Link. Must be in the smallest unit of the
// currency.
Amount int64 `json:"amount,required"`
// A three-letter ISO code for the currency in which you want to accept the
// payment.
Currency string `json:"currency,required"`
// Indicates whether customers can make partial payments using the Payment Link.Not
// allowed for UPI Payment Links.
AcceptPartial param.Opt[bool] `json:"accept_partial,omitzero"`
// If callback_url parameter is passed, callback_method must be passed with the
// value get.
CallbackMethod param.Opt[string] `json:"callback_method,omitzero"`
// If specified, adds a redirect URL to the Payment Link.
CallbackURL param.Opt[string] `json:"callback_url,omitzero"`
// A brief description of the Payment Link. Max 2048 characters.
Description param.Opt[string] `json:"description,omitzero"`
// Timestamp, in Unix, at which the Payment Link will expire.
ExpireBy param.Opt[int64] `json:"expire_by,omitzero"`
// Minimum amount, in currency subunits, that must be paid by the customer as the
// first partial payment. Must be passed along with accept_partial.
FirstMinPartialAmount param.Opt[int64] `json:"first_min_partial_amount,omitzero"`
// Reference number tagged to a Payment Link. Must be unique for each Payment Link.
// Max 40 characters.
ReferenceID param.Opt[string] `json:"reference_id,omitzero"`
// Used to send reminders for the Payment Link.
ReminderEnable param.Opt[bool] `json:"reminder_enable,omitzero"`
// Must be set to true for creating a UPI Payment Link. If not passed or false, a
// Standard Payment Link will be created.
UpiLink param.Opt[bool] `json:"upi_link,omitzero"`
// Customer details.
Customer PaymentLinkNewParamsCustomer `json:"customer,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// Defines who handles Payment Link notification.
Notify PaymentLinkNewParamsNotify `json:"notify,omitzero"`
// contains filtered or unexported fields
}
func (PaymentLinkNewParams) MarshalJSON ¶
func (r PaymentLinkNewParams) MarshalJSON() (data []byte, err error)
func (*PaymentLinkNewParams) UnmarshalJSON ¶
func (r *PaymentLinkNewParams) UnmarshalJSON(data []byte) error
type PaymentLinkNewParamsCustomer ¶
type PaymentLinkNewParamsCustomer struct {
// Contact number of the customer.
Contact param.Opt[string] `json:"contact,omitzero"`
// Email address of the customer.
Email param.Opt[string] `json:"email,omitzero"`
// Name of the customer.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
Customer details.
func (PaymentLinkNewParamsCustomer) MarshalJSON ¶
func (r PaymentLinkNewParamsCustomer) MarshalJSON() (data []byte, err error)
func (*PaymentLinkNewParamsCustomer) UnmarshalJSON ¶
func (r *PaymentLinkNewParamsCustomer) UnmarshalJSON(data []byte) error
type PaymentLinkNewParamsNotify ¶
type PaymentLinkNewParamsNotify struct {
// Send email notification.
Email param.Opt[bool] `json:"email,omitzero"`
// Send SMS notification.
SMS param.Opt[bool] `json:"sms,omitzero"`
// contains filtered or unexported fields
}
Defines who handles Payment Link notification.
func (PaymentLinkNewParamsNotify) MarshalJSON ¶
func (r PaymentLinkNewParamsNotify) MarshalJSON() (data []byte, err error)
func (*PaymentLinkNewParamsNotify) UnmarshalJSON ¶
func (r *PaymentLinkNewParamsNotify) UnmarshalJSON(data []byte) error
type PaymentLinkNotify ¶
type PaymentLinkNotify struct {
// Email notification enabled.
Email bool `json:"email"`
// SMS notification enabled.
SMS bool `json:"sms"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Email respjson.Field
SMS respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification settings.
func (PaymentLinkNotify) RawJSON ¶
func (r PaymentLinkNotify) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLinkNotify) UnmarshalJSON ¶
func (r *PaymentLinkNotify) UnmarshalJSON(data []byte) error
type PaymentLinkNotifyParams ¶
type PaymentLinkNotifyParams struct {
ID string `path:"id,required" json:"-"`
// contains filtered or unexported fields
}
type PaymentLinkNotifyParamsMedium ¶
type PaymentLinkNotifyParamsMedium string
const ( PaymentLinkNotifyParamsMediumSMS PaymentLinkNotifyParamsMedium = "sms" PaymentLinkNotifyParamsMediumEmail PaymentLinkNotifyParamsMedium = "email" )
type PaymentLinkNotifyResponse ¶
type PaymentLinkNotifyResponse struct {
// Indicates whether the notification was sent successfully.
Success bool `json:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaymentLinkNotifyResponse) RawJSON ¶
func (r PaymentLinkNotifyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLinkNotifyResponse) UnmarshalJSON ¶
func (r *PaymentLinkNotifyResponse) UnmarshalJSON(data []byte) error
type PaymentLinkPayment ¶
type PaymentLinkPayment struct {
// The amount paid by the customer using the Payment Link.
Amount int64 `json:"amount"`
// Timestamp, in Unix, indicating when the payment was made.
CreatedAt int64 `json:"created_at"`
// The payment method used to make the payment.
//
// Any of "netbanking", "card", "wallet", "upi", "emi", "bank_transfer".
Method string `json:"method"`
// Unique identifier of the payment made against the Payment Link.
PaymentID string `json:"payment_id"`
// Unique identifier of the Payment Link.
PlinkID string `json:"plink_id"`
// The payment state.
Status string `json:"status"`
// Timestamp, in Unix, indicating when the payment was updated.
UpdatedAt int64 `json:"updated_at"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
CreatedAt respjson.Field
Method respjson.Field
PaymentID respjson.Field
PlinkID respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaymentLinkPayment) RawJSON ¶
func (r PaymentLinkPayment) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLinkPayment) UnmarshalJSON ¶
func (r *PaymentLinkPayment) UnmarshalJSON(data []byte) error
type PaymentLinkRemindersUnion ¶
type PaymentLinkRemindersUnion struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a [[]string] instead of an object.
OfStringArray []string `json:",inline"`
JSON struct {
OfString respjson.Field
OfStringArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
PaymentLinkRemindersUnion contains all possible properties and values from [map[string]string], [[]string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]
func (PaymentLinkRemindersUnion) AsStringArray ¶
func (u PaymentLinkRemindersUnion) AsStringArray() (v []string)
func (PaymentLinkRemindersUnion) AsStringMap ¶
func (u PaymentLinkRemindersUnion) AsStringMap() (v map[string]string)
func (PaymentLinkRemindersUnion) RawJSON ¶
func (u PaymentLinkRemindersUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentLinkRemindersUnion) UnmarshalJSON ¶
func (r *PaymentLinkRemindersUnion) UnmarshalJSON(data []byte) error
type PaymentLinkService ¶
type PaymentLinkService struct {
Options []option.RequestOption
}
PaymentLinkService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaymentLinkService method instead.
func NewPaymentLinkService ¶
func NewPaymentLinkService(opts ...option.RequestOption) (r PaymentLinkService)
NewPaymentLinkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PaymentLinkService) Get ¶
func (r *PaymentLinkService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *PaymentLink, err error)
Use this endpoint to retrieve the details of a Payment Link using its id. [See docs](https://razorpay.com/docs/api/payments/payment-links/fetch-id-standard/)
func (*PaymentLinkService) List ¶
func (r *PaymentLinkService) List(ctx context.Context, query PaymentLinkListParams, opts ...option.RequestOption) (res *PaymentLinkListResponse, err error)
Use this endpoint to retrieve the details of all Payment Links. To get only UPI Payment Links, filter the response objects where `upi_link` is `true`. [See docs](https://razorpay.com/docs/api/payments/payment-links/fetch-all-upi)
func (*PaymentLinkService) New ¶
func (r *PaymentLinkService) New(ctx context.Context, body PaymentLinkNewParams, opts ...option.RequestOption) (res *PaymentLink, err error)
Use this endpoint to create a Payment Link using basic details such as amount, expiry date, reference id, description, customer details and so on. [See docs](https://razorpay.com/docs/api/payments/payment-links/create-standard/)
func (*PaymentLinkService) Notify ¶
func (r *PaymentLinkService) Notify(ctx context.Context, medium PaymentLinkNotifyParamsMedium, body PaymentLinkNotifyParams, opts ...option.RequestOption) (res *PaymentLinkNotifyResponse, err error)
Use this endpoint to send or resend notifications to your customers via email or SMS. [See docs](https://razorpay.com/docs/api/payments/payment-links/resend/)
func (*PaymentLinkService) Update ¶
func (r *PaymentLinkService) Update(ctx context.Context, id string, body PaymentLinkUpdateParams, opts ...option.RequestOption) (res *PaymentLink, err error)
Use this endpoint to edit the Standard Payment Link details such as the reference id, expiry date, enabling reminders and so on. [See docs](https://razorpay.com/docs/api/payments/payment-links/update-standard)
type PaymentLinkStatus ¶
type PaymentLinkStatus string
Current state of the Payment Link.
const ( PaymentLinkStatusCreated PaymentLinkStatus = "created" PaymentLinkStatusPartiallyPaid PaymentLinkStatus = "partially_paid" PaymentLinkStatusExpired PaymentLinkStatus = "expired" PaymentLinkStatusCancelled PaymentLinkStatus = "cancelled" PaymentLinkStatusPaid PaymentLinkStatus = "paid" )
type PaymentLinkUpdateParams ¶
type PaymentLinkUpdateParams struct {
// Indicates whether customers can make partial payments. Not allowed for UPI
// Payment Links.
AcceptPartial param.Opt[bool] `json:"accept_partial,omitzero"`
// Unix timestamp when the payment link should expire.
ExpireBy param.Opt[int64] `json:"expire_by,omitzero"`
// Adds a unique reference number to an existing link.
ReferenceID param.Opt[string] `json:"reference_id,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// contains filtered or unexported fields
}
func (PaymentLinkUpdateParams) MarshalJSON ¶
func (r PaymentLinkUpdateParams) MarshalJSON() (data []byte, err error)
func (*PaymentLinkUpdateParams) UnmarshalJSON ¶
func (r *PaymentLinkUpdateParams) UnmarshalJSON(data []byte) error
type PaymentListParams ¶
type PaymentListParams struct {
// Number of payments to be fetched. Default is 10. Maximum is 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// UNIX timestamp, in seconds, from when payments are to be fetched.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// Number of records to be skipped while fetching the payments.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// UNIX timestamp, in seconds, till when payments are to be fetched.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// Use to expand the card or EMI details for each payment.
//
// Any of "card", "emi".
Expand PaymentListParamsExpand `query:"expand[],omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PaymentListParams) URLQuery ¶
func (r PaymentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentListParams's query parameters as `url.Values`.
type PaymentListParamsExpand ¶
type PaymentListParamsExpand string
Use to expand the card or EMI details for each payment.
const ( PaymentListParamsExpandCard PaymentListParamsExpand = "card" PaymentListParamsExpandEmi PaymentListParamsExpand = "emi" )
type PaymentListRefundsParams ¶
type PaymentListRefundsParams struct {
// The number of refunds to fetch for the payment. Maximum is 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// UNIX timestamp at which the refunds were created.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// The number of refunds to be skipped for the payment.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// UNIX timestamp till which the refunds were created.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PaymentListRefundsParams) URLQuery ¶
func (r PaymentListRefundsParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentListRefundsParams's query parameters as `url.Values`.
type PaymentListResponse ¶
type PaymentListResponse struct {
// Number of payments returned.
Count int64 `json:"count"`
// Name of the entity. Always 'collection'.
Entity string `json:"entity"`
// List of payment objects.
Items []Payment `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PaymentListResponse) RawJSON ¶
func (r PaymentListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PaymentListResponse) UnmarshalJSON ¶
func (r *PaymentListResponse) UnmarshalJSON(data []byte) error
type PaymentMethod ¶
type PaymentMethod string
The payment method used for making the payment.
const ( PaymentMethodCard PaymentMethod = "card" PaymentMethodNetbanking PaymentMethod = "netbanking" PaymentMethodWallet PaymentMethod = "wallet" PaymentMethodEmi PaymentMethod = "emi" PaymentMethodUpi PaymentMethod = "upi" )
type PaymentNewRefundParams ¶
type PaymentNewRefundParams struct {
// The amount to be refunded. Amount should be in the smallest unit of the currency
// in which the payment was made. Required in case of partial refund.
Amount param.Opt[int64] `json:"amount,omitzero"`
// A unique identifier provided by you for your internal reference.
Receipt param.Opt[string] `json:"receipt,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// Indicates that the refund will be processed at an optimal speed based on
// Razorpay's internal fund transfer logic. Must be 'optimum'.
//
// Any of "optimum".
Speed PaymentNewRefundParamsSpeed `json:"speed,omitzero"`
// contains filtered or unexported fields
}
func (PaymentNewRefundParams) MarshalJSON ¶
func (r PaymentNewRefundParams) MarshalJSON() (data []byte, err error)
func (*PaymentNewRefundParams) UnmarshalJSON ¶
func (r *PaymentNewRefundParams) UnmarshalJSON(data []byte) error
type PaymentNewRefundParamsSpeed ¶
type PaymentNewRefundParamsSpeed string
Indicates that the refund will be processed at an optimal speed based on Razorpay's internal fund transfer logic. Must be 'optimum'.
const (
PaymentNewRefundParamsSpeedOptimum PaymentNewRefundParamsSpeed = "optimum"
)
type PaymentQrCodeGetParams ¶
type PaymentQrCodeGetParams struct {
// The unique identifier of the payment whose QR Codes are to be fetched.
PaymentID string `query:"payment_id,required" json:"-"`
// contains filtered or unexported fields
}
func (PaymentQrCodeGetParams) URLQuery ¶
func (r PaymentQrCodeGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentQrCodeGetParams's query parameters as `url.Values`.
type PaymentQrCodeListParams ¶
type PaymentQrCodeListParams struct {
// Number of QR Codes to be fetched. Default is 10. Maximum is 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// The unique identifier of the customer whose QR Codes are to be fetched.
CustomerID param.Opt[string] `query:"customer_id,omitzero" json:"-"`
// UNIX timestamp, in seconds, from when QR Codes are to be fetched.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// The unique identifier of the payment whose QR Codes are to be fetched.
PaymentID param.Opt[string] `query:"payment_id,omitzero" json:"-"`
// Number of records to be skipped while fetching the QR Codes.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// UNIX timestamp, in seconds, till when QR Codes are to be fetched.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PaymentQrCodeListParams) URLQuery ¶
func (r PaymentQrCodeListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PaymentQrCodeListParams's query parameters as `url.Values`.
type PaymentQrCodeNewParams ¶
type PaymentQrCodeNewParams struct {
// Indicates if the QR should accept payments of specific amounts or any amount.
FixedAmount bool `json:"fixed_amount,required"`
// The type of the QR Code. Only 'upi_qr' is supported.
//
// Any of "upi_qr".
Type PaymentQrCodeNewParamsType `json:"type,omitzero,required"`
// Indicates if the QR Code should accept single or multiple payments.
//
// Any of "single_use", "multiple_use".
Usage PaymentQrCodeNewParamsUsage `json:"usage,omitzero,required"`
// Unix timestamp at which the QR Code is scheduled to be automatically closed.
CloseBy param.Opt[int64] `json:"close_by,omitzero"`
// The unique identifier of the customer the QR Code is linked with.
CustomerID param.Opt[string] `json:"customer_id,omitzero"`
// A brief description about the QR Code.
Description param.Opt[string] `json:"description,omitzero"`
// Label entered to identify the QR Code.
Name param.Opt[string] `json:"name,omitzero"`
// The amount allowed for a transaction (in the smallest currency unit).
PaymentAmount param.Opt[int64] `json:"payment_amount,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// contains filtered or unexported fields
}
func (PaymentQrCodeNewParams) MarshalJSON ¶
func (r PaymentQrCodeNewParams) MarshalJSON() (data []byte, err error)
func (*PaymentQrCodeNewParams) UnmarshalJSON ¶
func (r *PaymentQrCodeNewParams) UnmarshalJSON(data []byte) error
type PaymentQrCodeNewParamsType ¶
type PaymentQrCodeNewParamsType string
The type of the QR Code. Only 'upi_qr' is supported.
const (
PaymentQrCodeNewParamsTypeUpiQr PaymentQrCodeNewParamsType = "upi_qr"
)
type PaymentQrCodeNewParamsUsage ¶
type PaymentQrCodeNewParamsUsage string
Indicates if the QR Code should accept single or multiple payments.
const ( PaymentQrCodeNewParamsUsageSingleUse PaymentQrCodeNewParamsUsage = "single_use" PaymentQrCodeNewParamsUsageMultipleUse PaymentQrCodeNewParamsUsage = "multiple_use" )
type PaymentQrCodeService ¶
type PaymentQrCodeService struct {
Options []option.RequestOption
}
PaymentQrCodeService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaymentQrCodeService method instead.
func NewPaymentQrCodeService ¶
func NewPaymentQrCodeService(opts ...option.RequestOption) (r PaymentQrCodeService)
NewPaymentQrCodeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PaymentQrCodeService) Close ¶
func (r *PaymentQrCodeService) Close(ctx context.Context, id string, opts ...option.RequestOption) (res *QrCode, err error)
Use this endpoint to close a QR Code. [See docs](https://razorpay.com/docs/api/qr-codes/close/)
func (*PaymentQrCodeService) Get ¶
func (r *PaymentQrCodeService) Get(ctx context.Context, id string, query PaymentQrCodeGetParams, opts ...option.RequestOption) (res *QrCode, err error)
Use this endpoint to retrieve the details of a QR Code by using a Payment Id. [See docs](https://razorpay.com/docs/api/qr-codes/fetch-payment-id/)
func (*PaymentQrCodeService) List ¶
func (r *PaymentQrCodeService) List(ctx context.Context, query PaymentQrCodeListParams, opts ...option.RequestOption) (res *QrCodeList, err error)
Use this endpoint to retrieve details of all QR Codes. By default, only the last 10 QR Codes are returned. You can use count and skip query parameters to change that behaviour. You can also filter QR Codes by customer_id. [See docs](https://razorpay.com/docs/api/qr-codes/fetch-customer-id)
func (*PaymentQrCodeService) New ¶
func (r *PaymentQrCodeService) New(ctx context.Context, body PaymentQrCodeNewParams, opts ...option.RequestOption) (res *QrCode, err error)
Use this endpoint to create a QR Code. You can share the short URL with customers to accept payments, print, and download it. [See docs](https://razorpay.com/docs/api/qr-codes/create/)
type PaymentRefundService ¶
type PaymentRefundService struct {
Options []option.RequestOption
}
PaymentRefundService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaymentRefundService method instead.
func NewPaymentRefundService ¶
func NewPaymentRefundService(opts ...option.RequestOption) (r PaymentRefundService)
NewPaymentRefundService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type PaymentService ¶
type PaymentService struct {
Options []option.RequestOption
QrCodes PaymentQrCodeService
Refunds PaymentRefundService
}
PaymentService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPaymentService method instead.
func NewPaymentService ¶
func NewPaymentService(opts ...option.RequestOption) (r PaymentService)
NewPaymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PaymentService) Capture ¶
func (r *PaymentService) Capture(ctx context.Context, id string, body PaymentCaptureParams, opts ...option.RequestOption) (res *Payment, err error)
Use this endpoint to change the payment status from authorized to captured. Attempting to capture a payment whose status is not authorized will produce an error. [See docs](https://razorpay.com/docs/api/payments/capture/)
func (*PaymentService) Get ¶
func (r *PaymentService) Get(ctx context.Context, id string, query PaymentGetParams, opts ...option.RequestOption) (res *Payment, err error)
Use this endpoint to retrieve the details of a specific payment using its id. You can expand the card or EMI details by passing the query parameter `expand[]=card` or `expand[]=emi`. [See docs for card](https://razorpay.com/docs/api/payments/fetch-payment-expanded-card) [See docs for EMI](https://razorpay.com/docs/api/payments/fetch-payment-expanded-emi)
func (*PaymentService) GetCardDetails ¶
func (r *PaymentService) GetCardDetails(ctx context.Context, id string, opts ...option.RequestOption) (res *Card, err error)
Use this endpoint to retrieve the details of the card used to make a payment. [See docs](https://razorpay.com/docs/api/payments/fetch-card-details-payment)
func (*PaymentService) GetRefund ¶
func (r *PaymentService) GetRefund(ctx context.Context, refundID string, query PaymentGetRefundParams, opts ...option.RequestOption) (res *Refund, err error)
Use this endpoint to retrieve details of a specific refund made for a payment. [See docs](https://razorpay.com/docs/api/refunds/fetch-specific-refund-payment)
func (*PaymentService) List ¶
func (r *PaymentService) List(ctx context.Context, query PaymentListParams, opts ...option.RequestOption) (res *PaymentListResponse, err error)
Use this endpoint to retrieve details of all the payments. By default, only the last 10 records are displayed. You can use the `count` and `skip` parameters to retrieve the specific number of records that you need. You can also expand card or EMI details using `expand[]=card` or `expand[]=emi`. [See docs](https://razorpay.com/docs/api/payments/fetch-all-payments)
func (*PaymentService) ListRefunds ¶
func (r *PaymentService) ListRefunds(ctx context.Context, id string, query PaymentListRefundsParams, opts ...option.RequestOption) (res *RefundList, err error)
Use this endpoint to retrieve multiple refunds for a payment. By default, only the last 10 refunds are returned. You can use count and skip query parameters to change that behaviour. [See docs](https://razorpay.com/docs/api/refunds/fetch-multiple-refund-payment)
func (*PaymentService) NewRefund ¶
func (r *PaymentService) NewRefund(ctx context.Context, id string, body PaymentNewRefundParams, opts ...option.RequestOption) (res *Refund, err error)
Use this endpoint to process refunds instantaneously to your customers. The instant refund is enabled by default for your account. You should set the refund speed to `optimum` when creating a refund request to ensure refunds are processed instantly. [See docs](https://razorpay.com/docs/api/refunds/create-instant/)
func (*PaymentService) Update ¶
func (r *PaymentService) Update(ctx context.Context, id string, body PaymentUpdateParams, opts ...option.RequestOption) (res *Payment, err error)
Use this endpoint to update the `notes` field for a particular payment. Only the `notes` field can be updated. You can add up to 15 key-value pairs, each value not exceeding 256 characters. [See docs](https://razorpay.com/docs/api/payments/update)
type PaymentStatus ¶
type PaymentStatus string
The status of the payment.
const ( PaymentStatusCreated PaymentStatus = "created" PaymentStatusAuthorized PaymentStatus = "authorized" PaymentStatusCaptured PaymentStatus = "captured" PaymentStatusRefunded PaymentStatus = "refunded" PaymentStatusFailed PaymentStatus = "failed" )
type PaymentUpdateParams ¶
type PaymentUpdateParams struct {
// Contains user-defined fields, stored for reference purposes. Maximum 15
// key-value pairs, 256 characters each.
Notes PaymentUpdateParamsNotesUnion `json:"notes,omitzero,required"`
// contains filtered or unexported fields
}
func (PaymentUpdateParams) MarshalJSON ¶
func (r PaymentUpdateParams) MarshalJSON() (data []byte, err error)
func (*PaymentUpdateParams) UnmarshalJSON ¶
func (r *PaymentUpdateParams) UnmarshalJSON(data []byte) error
type PaymentUpdateParamsNotesUnion ¶
type PaymentUpdateParamsNotesUnion struct {
OfStringMap map[string]string `json:",omitzero,inline"`
OfStringArray []string `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (PaymentUpdateParamsNotesUnion) MarshalJSON ¶
func (u PaymentUpdateParamsNotesUnion) MarshalJSON() ([]byte, error)
func (*PaymentUpdateParamsNotesUnion) UnmarshalJSON ¶
func (u *PaymentUpdateParamsNotesUnion) UnmarshalJSON(data []byte) error
type Payout ¶
type Payout struct {
// The unique identifier of the payout.
ID string `json:"id"`
// The payout amount, in paise. The value does not include fees and tax. Fees and
// tax, if any, are deducted from your account balance.
Amount int64 `json:"amount"`
// This value is returned if the contact was created as part of a bulk upload.
BatchID string `json:"batch_id,nullable"`
// Indicates the Unix timestamp when this payout was created.
CreatedAt int64 `json:"created_at"`
// The payout's currency. Here, it is INR.
Currency string `json:"currency"`
// The entity being created. Here, it will be payout.
Entity string `json:"entity"`
// Indicates the fee type charged for the payout. Possible value is free_payout.
FeeType string `json:"fee_type"`
// The fees for the payout. This value is returned only when the payout moves to
// the processing state.
Fees int64 `json:"fees"`
// The unique identifier linked to the fund account.
FundAccountID string `json:"fund_account_id"`
// The mode used to make the payout.
//
// Any of "NEFT", "RTGS", "IMPS", "card", "UPI", "amazonpay".
Mode PayoutMode `json:"mode"`
// Custom note that also appears on the bank statement. Maximum length 30
// characters.
Narration string `json:"narration"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// The purpose of the payout that is being created.
Purpose string `json:"purpose"`
// A user-generated reference given to the payout. Maximum length is 40 characters.
ReferenceID string `json:"reference_id"`
// The payout status.
//
// Any of "queued", "pending", "rejected", "processing", "processed", "cancelled",
// "reversed", "failed".
Status PayoutStatus `json:"status"`
// This parameter returns the current status of the payout.
StatusDetails PayoutStatusDetails `json:"status_details"`
// The tax that is applicable for the fee being charged. This value is returned
// only when the payout moves to the processing state.
Tax int64 `json:"tax"`
// The unique transaction number linked to a payout.
Utr string `json:"utr,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
BatchID respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Entity respjson.Field
FeeType respjson.Field
Fees respjson.Field
FundAccountID respjson.Field
Mode respjson.Field
Narration respjson.Field
Notes respjson.Field
Purpose respjson.Field
ReferenceID respjson.Field
Status respjson.Field
StatusDetails respjson.Field
Tax respjson.Field
Utr respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Payout) UnmarshalJSON ¶
type PayoutListParams ¶
type PayoutListParams struct {
// The account from which the payouts were done. For example, 7878780080316316.
AccountNumber string `query:"account_number,required" json:"-"`
// The unique identifier of the contact for which you want to fetch payouts.
ContactID param.Opt[string] `query:"contact_id,omitzero" json:"-"`
// Number of payouts to be fetched. Default value is 10. Maximum value is 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// Timestamp, in Unix, from when you want to fetch payouts.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// The unique identifier of the fund account for which you want to fetch payouts.
FundAccountID param.Opt[string] `query:"fund_account_id,omitzero" json:"-"`
// The user-generated reference for which payouts are to be fetched. Maximum length
// is 40 characters.
ReferenceID param.Opt[string] `query:"reference_id,omitzero" json:"-"`
// Numbers of payouts to be skipped. Default value is 0.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Timestamp, in Unix, till when you want to fetch payouts.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// The mode for which payouts are to be fetched. You can use one of the following
// payout modes NEFT, RTGS, IMPS, UPI, card, amazonpay.
//
// Any of "NEFT", "RTGS", "IMPS", "UPI", "card", "amazonpay".
Mode PayoutListParamsMode `query:"mode,omitzero" json:"-"`
// The payout status. Possible payout states queued, pending, rejected, processing,
// processed, cancelled, reversed, failed.
//
// Any of "queued", "pending", "rejected", "processing", "processed", "cancelled",
// "reversed", "failed".
Status PayoutListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PayoutListParams) URLQuery ¶
func (r PayoutListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PayoutListParams's query parameters as `url.Values`.
type PayoutListParamsMode ¶
type PayoutListParamsMode string
The mode for which payouts are to be fetched. You can use one of the following payout modes NEFT, RTGS, IMPS, UPI, card, amazonpay.
const ( PayoutListParamsModeNeft PayoutListParamsMode = "NEFT" PayoutListParamsModeRtgs PayoutListParamsMode = "RTGS" PayoutListParamsModeImps PayoutListParamsMode = "IMPS" PayoutListParamsModeUpi PayoutListParamsMode = "UPI" PayoutListParamsModeCard PayoutListParamsMode = "card" PayoutListParamsModeAmazonpay PayoutListParamsMode = "amazonpay" )
type PayoutListParamsStatus ¶
type PayoutListParamsStatus string
The payout status. Possible payout states queued, pending, rejected, processing, processed, cancelled, reversed, failed.
const ( PayoutListParamsStatusQueued PayoutListParamsStatus = "queued" PayoutListParamsStatusPending PayoutListParamsStatus = "pending" PayoutListParamsStatusRejected PayoutListParamsStatus = "rejected" PayoutListParamsStatusProcessing PayoutListParamsStatus = "processing" PayoutListParamsStatusProcessed PayoutListParamsStatus = "processed" PayoutListParamsStatusCancelled PayoutListParamsStatus = "cancelled" PayoutListParamsStatusReversed PayoutListParamsStatus = "reversed" PayoutListParamsStatusFailed PayoutListParamsStatus = "failed" )
type PayoutListResponse ¶
type PayoutListResponse struct {
// Number of payouts returned.
Count int64 `json:"count"`
// Name of the entity. Always collection.
Entity string `json:"entity"`
// List of payout objects.
Items []Payout `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PayoutListResponse) RawJSON ¶
func (r PayoutListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PayoutListResponse) UnmarshalJSON ¶
func (r *PayoutListResponse) UnmarshalJSON(data []byte) error
type PayoutMode ¶
type PayoutMode string
The mode used to make the payout.
const ( PayoutModeNeft PayoutMode = "NEFT" PayoutModeRtgs PayoutMode = "RTGS" PayoutModeImps PayoutMode = "IMPS" PayoutModeCard PayoutMode = "card" PayoutModeUpi PayoutMode = "UPI" PayoutModeAmazonpay PayoutMode = "amazonpay" )
type PayoutService ¶
type PayoutService struct {
Options []option.RequestOption
}
PayoutService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPayoutService method instead.
func NewPayoutService ¶
func NewPayoutService(opts ...option.RequestOption) (r PayoutService)
NewPayoutService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PayoutService) Get ¶
func (r *PayoutService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Payout, err error)
Use this endpoint to retrieve the details of a particular payout in the system. [See docs](https://razorpay.com/docs/api/x/payouts/fetch-with-id)
func (*PayoutService) List ¶
func (r *PayoutService) List(ctx context.Context, query PayoutListParams, opts ...option.RequestOption) (res *PayoutListResponse, err error)
Use this endpoint to retrieve the details of all the available payouts in the system. [See docs](https://razorpay.com/docs/api/x/payouts/fetch-all/)
type PayoutStatus ¶
type PayoutStatus string
The payout status.
const ( PayoutStatusQueued PayoutStatus = "queued" PayoutStatusPending PayoutStatus = "pending" PayoutStatusRejected PayoutStatus = "rejected" PayoutStatusProcessing PayoutStatus = "processing" PayoutStatusProcessed PayoutStatus = "processed" PayoutStatusCancelled PayoutStatus = "cancelled" PayoutStatusReversed PayoutStatus = "reversed" PayoutStatusFailed PayoutStatus = "failed" )
type PayoutStatusDetails ¶
type PayoutStatusDetails struct {
// Status description.
Description string `json:"description"`
// Status reason.
Reason string `json:"reason"`
// Status source.
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
Reason respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
This parameter returns the current status of the payout.
func (PayoutStatusDetails) RawJSON ¶
func (r PayoutStatusDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*PayoutStatusDetails) UnmarshalJSON ¶
func (r *PayoutStatusDetails) UnmarshalJSON(data []byte) error
type QrCode ¶
type QrCode struct {
// The unique identifier of the QR Code.
ID string `json:"id"`
// Unix timestamp at which the QR Code is scheduled to be automatically closed.
CloseBy int64 `json:"close_by"`
// The reason for the closure of the QR Code.
//
// Any of "on_demand", "paid".
CloseReason QrCodeCloseReason `json:"close_reason,nullable"`
// Unix timestamp at which the QR Code is automatically closed.
ClosedAt int64 `json:"closed_at"`
// Unix timestamp at which the QR Code is created.
CreatedAt int64 `json:"created_at"`
// The unique identifier of the customer the QR Code is linked with.
CustomerID string `json:"customer_id"`
// A brief description about the QR Code.
Description string `json:"description"`
// Indicates the type of entity. Here, it is qr_code.
Entity string `json:"entity"`
// Indicates if the QR Code should accept payments of specific amounts or any
// amount.
FixedAmount bool `json:"fixed_amount"`
// The URL of the QR Code image.
ImageURL string `json:"image_url"`
// Label entered to identify the QR Code.
Name string `json:"name"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// The amount allowed for a transaction (in the smallest currency unit).
PaymentAmount int64 `json:"payment_amount"`
// The total amount received on the QR Code.
PaymentsAmountReceived int64 `json:"payments_amount_received"`
// The total number of payments received on the QR Code.
PaymentsCountReceived int64 `json:"payments_count_received"`
// Indicates the status of the QR Code.
//
// Any of "active", "closed".
Status QrCodeStatus `json:"status"`
TaxInvoice []QrCodeTaxInvoice `json:"tax_invoice"`
// The type of the QR Code. Only 'upi_qr' is supported.
//
// Any of "upi_qr".
Type QrCodeType `json:"type"`
// Indicates if the QR Code should accept single or multiple payments.
//
// Any of "single_use", "multiple_use".
Usage QrCodeUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CloseBy respjson.Field
CloseReason respjson.Field
ClosedAt respjson.Field
CreatedAt respjson.Field
CustomerID respjson.Field
Description respjson.Field
Entity respjson.Field
FixedAmount respjson.Field
ImageURL respjson.Field
Name respjson.Field
Notes respjson.Field
PaymentAmount respjson.Field
PaymentsAmountReceived respjson.Field
PaymentsCountReceived respjson.Field
Status respjson.Field
TaxInvoice respjson.Field
Type respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*QrCode) UnmarshalJSON ¶
type QrCodeCloseReason ¶
type QrCodeCloseReason string
The reason for the closure of the QR Code.
const ( QrCodeCloseReasonOnDemand QrCodeCloseReason = "on_demand" QrCodeCloseReasonPaid QrCodeCloseReason = "paid" )
type QrCodeList ¶
type QrCodeList struct {
// Number of QR Codes returned.
Count int64 `json:"count"`
// Name of the entity. Always 'collection'.
Entity string `json:"entity"`
// List of QR Code objects.
Items []QrCode `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (QrCodeList) RawJSON ¶
func (r QrCodeList) RawJSON() string
Returns the unmodified JSON received from the API
func (*QrCodeList) UnmarshalJSON ¶
func (r *QrCodeList) UnmarshalJSON(data []byte) error
type QrCodeStatus ¶
type QrCodeStatus string
Indicates the status of the QR Code.
const ( QrCodeStatusActive QrCodeStatus = "active" QrCodeStatusClosed QrCodeStatus = "closed" )
type QrCodeTaxInvoice ¶
type QrCodeTaxInvoice struct {
// The GSTIN mentioned on the invoice. If not passed, it is picked up from the
// database.
BusinessGstin string `json:"business_gstin,required"`
// CESS Amount on the invoice in paise. If not provided, the transaction will
// default to the non-GST compliant UPI flow.
CessAmount int64 `json:"cess_amount,required"`
// Customer name on the invoice. If not provided, the transaction will default to
// non-GST compliant UPI flow.
CustomerName string `json:"customer_name,required"`
// Unix Timestamp that indicates the issue date of the invoice. If not provided, it
// will default to the current date.
Date int64 `json:"date,required"`
// GST amount on the invoice in paise. If not provided, the transaction will
// default to the non-GST compliant UPI flow.
GstAmount int64 `json:"gst_amount,required"`
// This is the invoice number against which the payment is collected. If not
// provided, the transaction will default to non-GST compliant UPI flow.
Number string `json:"number,required"`
// Indicates whether the transaction is interstate or intrastate
//
// Any of "interstate", "intrastate".
SupplyType string `json:"supply_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BusinessGstin respjson.Field
CessAmount respjson.Field
CustomerName respjson.Field
Date respjson.Field
GstAmount respjson.Field
Number respjson.Field
SupplyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tax invoice details for GST compliant transactions
func (QrCodeTaxInvoice) RawJSON ¶
func (r QrCodeTaxInvoice) RawJSON() string
Returns the unmodified JSON received from the API
func (*QrCodeTaxInvoice) UnmarshalJSON ¶
func (r *QrCodeTaxInvoice) UnmarshalJSON(data []byte) error
type QrCodeType ¶
type QrCodeType string
The type of the QR Code. Only 'upi_qr' is supported.
const (
QrCodeTypeUpiQr QrCodeType = "upi_qr"
)
type QrCodeUsage ¶
type QrCodeUsage string
Indicates if the QR Code should accept single or multiple payments.
const ( QrCodeUsageSingleUse QrCodeUsage = "single_use" QrCodeUsageMultipleUse QrCodeUsage = "multiple_use" )
type Refund ¶
type Refund struct {
// The unique identifier of the refund.
ID string `json:"id"`
// A dynamic array consisting of unique reference numbers.
AcquirerData RefundAcquirerData `json:"acquirer_data"`
// The amount to be refunded (in the smallest unit of currency).
Amount int64 `json:"amount"`
// This parameter is populated if the refund was created as part of a batch upload.
BatchID string `json:"batch_id,nullable"`
// Unix timestamp at which the refund was created.
CreatedAt int64 `json:"created_at"`
// The currency of payment amount for which the refund is initiated.
Currency string `json:"currency"`
// Indicates the type of entity. Here, it is refund.
Entity string `json:"entity"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// The unique identifier of the payment for which a refund is initiated.
PaymentID string `json:"payment_id"`
// A unique identifier provided by you for your internal reference.
Receipt string `json:"receipt"`
// The mode used to process a refund.
//
// Any of "instant", "normal".
SpeedProcessed RefundSpeedProcessed `json:"speed_processed"`
// The processing mode of the refund seen in the refund response.
//
// Any of "normal", "optimum".
SpeedRequested RefundSpeedRequested `json:"speed_requested"`
// Indicates the state of the refund.
//
// Any of "pending", "processed", "failed".
Status RefundStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AcquirerData respjson.Field
Amount respjson.Field
BatchID respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Entity respjson.Field
Notes respjson.Field
PaymentID respjson.Field
Receipt respjson.Field
SpeedProcessed respjson.Field
SpeedRequested respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Refund) UnmarshalJSON ¶
type RefundAcquirerData ¶
type RefundAcquirerData struct {
Arn string `json:"arn"`
// Bank transaction ID
BankTransactionID string `json:"bank_transaction_id"`
Rrn string `json:"rrn"`
// transaction ID
TransactionID string `json:"transaction_id"`
// Upi transaction ID
UpiTransactionID string `json:"upi_transaction_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Arn respjson.Field
BankTransactionID respjson.Field
Rrn respjson.Field
TransactionID respjson.Field
UpiTransactionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A dynamic array consisting of unique reference numbers.
func (RefundAcquirerData) RawJSON ¶
func (r RefundAcquirerData) RawJSON() string
Returns the unmodified JSON received from the API
func (*RefundAcquirerData) UnmarshalJSON ¶
func (r *RefundAcquirerData) UnmarshalJSON(data []byte) error
type RefundList ¶
type RefundList struct {
// Number of refunds returned.
Count int64 `json:"count"`
// Name of the entity. Always 'collection'.
Entity string `json:"entity"`
// List of refund objects.
Items []Refund `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RefundList) RawJSON ¶
func (r RefundList) RawJSON() string
Returns the unmodified JSON received from the API
func (*RefundList) UnmarshalJSON ¶
func (r *RefundList) UnmarshalJSON(data []byte) error
type RefundListParams ¶
type RefundListParams struct {
// The number of refunds to fetch. Maximum is 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// UNIX timestamp at which the refunds were created.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// The number of refunds to be skipped.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// UNIX timestamp till which the refunds were created.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RefundListParams) URLQuery ¶
func (r RefundListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RefundListParams's query parameters as `url.Values`.
type RefundService ¶
type RefundService struct {
Options []option.RequestOption
}
RefundService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRefundService method instead.
func NewRefundService ¶
func NewRefundService(opts ...option.RequestOption) (r RefundService)
NewRefundService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RefundService) Get ¶
func (r *RefundService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Refund, err error)
Use this endpoint to retrieve the refund using the id. [See docs](https://razorpay.com/docs/api/refunds/fetch-with-id/)
func (*RefundService) List ¶
func (r *RefundService) List(ctx context.Context, query RefundListParams, opts ...option.RequestOption) (res *RefundList, err error)
Use this endpoint to retrieve details of all refunds. By default, only the last 10 refunds are returned. You can use count and skip query parameters to change that behaviour. [See docs](https://razorpay.com/docs/api/refunds/fetch-all/)
func (*RefundService) Update ¶
func (r *RefundService) Update(ctx context.Context, id string, body RefundUpdateParams, opts ...option.RequestOption) (res *Refund, err error)
Use this endpoint to update the notes field for a particular refund. Only the notes field can be updated. [See docs](https://razorpay.com/docs/api/refunds/update/)
type RefundSpeedProcessed ¶
type RefundSpeedProcessed string
The mode used to process a refund.
const ( RefundSpeedProcessedInstant RefundSpeedProcessed = "instant" RefundSpeedProcessedNormal RefundSpeedProcessed = "normal" )
type RefundSpeedRequested ¶
type RefundSpeedRequested string
The processing mode of the refund seen in the refund response.
const ( RefundSpeedRequestedNormal RefundSpeedRequested = "normal" RefundSpeedRequestedOptimum RefundSpeedRequested = "optimum" )
type RefundStatus ¶
type RefundStatus string
Indicates the state of the refund.
const ( RefundStatusPending RefundStatus = "pending" RefundStatusProcessed RefundStatus = "processed" RefundStatusFailed RefundStatus = "failed" )
type RefundUpdateParams ¶
type RefundUpdateParams struct {
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero,required"`
// contains filtered or unexported fields
}
func (RefundUpdateParams) MarshalJSON ¶
func (r RefundUpdateParams) MarshalJSON() (data []byte, err error)
func (*RefundUpdateParams) UnmarshalJSON ¶
func (r *RefundUpdateParams) UnmarshalJSON(data []byte) error
type Settlement ¶
type Settlement struct {
// The unique identifier of the settlement transaction.
ID string `json:"id"`
// The amount to be settled (in the smallest unit of currency).
Amount int64 `json:"amount"`
// Unix timestamp at which the settlement transaction was created.
CreatedAt int64 `json:"created_at"`
// Indicates the type of entity. Here, it is settlement.
Entity string `json:"entity"`
// The total fee charged for processing all payments received from customers
// settled to you in this settlement transaction.
Fees int64 `json:"fees"`
// Indicates the settlement state.
//
// Any of "created", "processed", "failed".
Status SettlementStatus `json:"status"`
// The total tax, in currency subunits, charged on the fees collected to process
// all payments received from customers settled to you in this settlement
// transaction.
Tax int64 `json:"tax"`
// The Unique Transaction Reference (UTR) number available across banks.
Utr string `json:"utr"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
CreatedAt respjson.Field
Entity respjson.Field
Fees respjson.Field
Status respjson.Field
Tax respjson.Field
Utr respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Settlement) RawJSON ¶
func (r Settlement) RawJSON() string
Returns the unmodified JSON received from the API
func (*Settlement) UnmarshalJSON ¶
func (r *Settlement) UnmarshalJSON(data []byte) error
type SettlementListParams ¶
type SettlementListParams struct {
// Number of settlement records to be fetched. Default is 10. Possible value- 1
// to 100.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// UNIX timestamp (in seconds) from when settlements are to be fetched.
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// Number of settlement records to be skipped. Default is 0.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// UNIX timestamp (in seconds) till when settlements are to be fetched.
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SettlementListParams) URLQuery ¶
func (r SettlementListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SettlementListParams's query parameters as `url.Values`.
type SettlementListResponse ¶
type SettlementListResponse struct {
// Number of settlements returned.
Count int64 `json:"count"`
// Name of the entity. Always 'collection'.
Entity string `json:"entity"`
// List of settlement objects.
Items []Settlement `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SettlementListResponse) RawJSON ¶
func (r SettlementListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SettlementListResponse) UnmarshalJSON ¶
func (r *SettlementListResponse) UnmarshalJSON(data []byte) error
type SettlementOndemand ¶
type SettlementOndemand struct {
// The unique identifier of the instant settlement transaction.
ID string `json:"id"`
// Portion of the requested amount, in paise, yet to be settled to you.
AmountPending int64 `json:"amount_pending"`
// The settlement amount, in paise, requested by you.
AmountRequested int64 `json:"amount_requested"`
// Portion of the requested amount, in paise, that was not settled to you. This
// amount is reversed to your PG current balance.
AmountReversed int64 `json:"amount_reversed"`
// Total amount (minus fees and tax), in paise, settled to the bank account.
AmountSettled int64 `json:"amount_settled"`
// Unix timestamp at which the instant settlement was created.
CreatedAt int64 `json:"created_at"`
// The 3-letter ISO currency code for the settlement.
Currency string `json:"currency"`
// Custom note for the instant settlement.
Description string `json:"description"`
// Indicates the type of entity. Here it is settlement.ondemand.
Entity string `json:"entity"`
// Total amount (fees+tax), in paise, deducted for the instant settlement.
Fees int64 `json:"fees"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// List of payouts created for the instant settlement.
OndemandPayouts SettlementOndemandOndemandPayouts `json:"ondemand_payouts"`
// Indicates whether full balance is settled.
SettleFullBalance bool `json:"settle_full_balance"`
// Indicates the state of the instant settlement.
//
// Any of "created", "initiated", "partially_processed", "processed", "reversed".
Status SettlementOndemandStatus `json:"status"`
// Total tax, in paise, charged for the fee component.
Tax int64 `json:"tax"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AmountPending respjson.Field
AmountRequested respjson.Field
AmountReversed respjson.Field
AmountSettled respjson.Field
CreatedAt respjson.Field
Currency respjson.Field
Description respjson.Field
Entity respjson.Field
Fees respjson.Field
Notes respjson.Field
OndemandPayouts respjson.Field
SettleFullBalance respjson.Field
Status respjson.Field
Tax respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SettlementOndemand) RawJSON ¶
func (r SettlementOndemand) RawJSON() string
Returns the unmodified JSON received from the API
func (*SettlementOndemand) UnmarshalJSON ¶
func (r *SettlementOndemand) UnmarshalJSON(data []byte) error
type SettlementOndemandNewParams ¶
type SettlementOndemandNewParams struct {
// The amount, in paise, you want to get settled instantly.
Amount int64 `json:"amount,required"`
// Custom note for the instant settlement. Max 30 characters. Allowed a-z, A-Z,
// 0-9, space.
Description param.Opt[string] `json:"description,omitzero"`
// Indicates whether full balance is settled. If true, Razorpay will settle the
// maximum amount possible and ignore the amount parameter.
SettleFullBalance param.Opt[bool] `json:"settle_full_balance,omitzero"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnionParam `json:"notes,omitzero"`
// contains filtered or unexported fields
}
func (SettlementOndemandNewParams) MarshalJSON ¶
func (r SettlementOndemandNewParams) MarshalJSON() (data []byte, err error)
func (*SettlementOndemandNewParams) UnmarshalJSON ¶
func (r *SettlementOndemandNewParams) UnmarshalJSON(data []byte) error
type SettlementOndemandOndemandPayouts ¶
type SettlementOndemandOndemandPayouts struct {
Count int64 `json:"count"`
Entity string `json:"entity"`
Items []SettlementOndemandOndemandPayoutsItem `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List of payouts created for the instant settlement.
func (SettlementOndemandOndemandPayouts) RawJSON ¶
func (r SettlementOndemandOndemandPayouts) RawJSON() string
Returns the unmodified JSON received from the API
func (*SettlementOndemandOndemandPayouts) UnmarshalJSON ¶
func (r *SettlementOndemandOndemandPayouts) UnmarshalJSON(data []byte) error
type SettlementOndemandOndemandPayoutsItem ¶
type SettlementOndemandOndemandPayoutsItem struct {
ID string `json:"id"`
Amount int64 `json:"amount"`
AmountSettled int64 `json:"amount_settled,nullable"`
CreatedAt int64 `json:"created_at"`
Entity string `json:"entity"`
Fees int64 `json:"fees"`
InitiatedAt int64 `json:"initiated_at,nullable"`
ProcessedAt int64 `json:"processed_at,nullable"`
ReversedAt int64 `json:"reversed_at,nullable"`
Status string `json:"status"`
Tax int64 `json:"tax"`
Utr string `json:"utr,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Amount respjson.Field
AmountSettled respjson.Field
CreatedAt respjson.Field
Entity respjson.Field
Fees respjson.Field
InitiatedAt respjson.Field
ProcessedAt respjson.Field
ReversedAt respjson.Field
Status respjson.Field
Tax respjson.Field
Utr respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SettlementOndemandOndemandPayoutsItem) RawJSON ¶
func (r SettlementOndemandOndemandPayoutsItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*SettlementOndemandOndemandPayoutsItem) UnmarshalJSON ¶
func (r *SettlementOndemandOndemandPayoutsItem) UnmarshalJSON(data []byte) error
type SettlementOndemandService ¶
type SettlementOndemandService struct {
Options []option.RequestOption
}
SettlementOndemandService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSettlementOndemandService method instead.
func NewSettlementOndemandService ¶
func NewSettlementOndemandService(opts ...option.RequestOption) (r SettlementOndemandService)
NewSettlementOndemandService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SettlementOndemandService) Get ¶
func (r *SettlementOndemandService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *SettlementOndemand, err error)
Use this endpoint to retrieve the details of a particular Instant Settlement. [See docs](https://razorpay.com/docs/api/settlements/instant/fetch-with-id/)
func (*SettlementOndemandService) New ¶
func (r *SettlementOndemandService) New(ctx context.Context, body SettlementOndemandNewParams, opts ...option.RequestOption) (res *SettlementOndemand, err error)
Use this endpoint to create an Instant Settlement. [See docs](https://razorpay.com/docs/api/settlements/instant/create/)
type SettlementOndemandStatus ¶
type SettlementOndemandStatus string
Indicates the state of the instant settlement.
const ( SettlementOndemandStatusCreated SettlementOndemandStatus = "created" SettlementOndemandStatusInitiated SettlementOndemandStatus = "initiated" SettlementOndemandStatusPartiallyProcessed SettlementOndemandStatus = "partially_processed" SettlementOndemandStatusProcessed SettlementOndemandStatus = "processed" SettlementOndemandStatusReversed SettlementOndemandStatus = "reversed" )
type SettlementReconGetParams ¶
type SettlementReconGetParams struct {
// The month the settlement was received in the MM format. For example, 06.
Month int64 `query:"month,required" json:"-"`
// The year the settlement was received in the YYYY format. For example, 2022.
Year int64 `query:"year,required" json:"-"`
// Specifies the number of available settlements to be fetched. Possible values- 1
// to 1000.
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// The date on which the settlement was received in the DD format. For example, 11.
Day param.Opt[int64] `query:"day,omitzero" json:"-"`
// Specifies the number of available settlements to be skipped when fetching a
// count.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SettlementReconGetParams) URLQuery ¶
func (r SettlementReconGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes SettlementReconGetParams's query parameters as `url.Values`.
type SettlementReconGetResponse ¶
type SettlementReconGetResponse struct {
// Number of settlement recon records returned.
Count int64 `json:"count"`
// Name of the entity. Always 'collection'.
Entity string `json:"entity"`
// List of settlement recon objects.
Items []SettlementReconGetResponseItem `json:"items"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Entity respjson.Field
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SettlementReconGetResponse) RawJSON ¶
func (r SettlementReconGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SettlementReconGetResponse) UnmarshalJSON ¶
func (r *SettlementReconGetResponse) UnmarshalJSON(data []byte) error
type SettlementReconGetResponseItem ¶
type SettlementReconGetResponseItem struct {
// The total amount of the transaction (in the smallest unit of currency).
Amount int64 `json:"amount"`
// The 4-character code denoting the issuing bank.
CardIssuer string `json:"card_issuer,nullable"`
// The card network used to process the payment.
CardNetwork string `json:"card_network,nullable"`
// The card type used to process the payment.
CardType string `json:"card_type,nullable"`
// Unix timestamp at which the transaction was created.
CreatedAt int64 `json:"created_at"`
// The amount, in currency subunits, that has been credited to your account for
// this transaction.
Credit int64 `json:"credit"`
// The type of credit for the transaction.
CreditType string `json:"credit_type"`
// The currency of the transaction.
Currency string `json:"currency"`
// The amount, in currency subunits, that has been debited from your account for
// this transaction.
Debit int64 `json:"debit"`
// Brief description about the transaction.
Description string `json:"description,nullable"`
// The unique identifier of any dispute, if any, for this transaction.
DisputeID string `json:"dispute_id,nullable"`
// The unique identifier of the transaction that has been settled.
EntityID string `json:"entity_id"`
// The fee charged for processing the transaction.
Fee int64 `json:"fee"`
// The payment method used to complete the payment.
Method string `json:"method,nullable"`
// Key-value pair that can be used to store additional information about the
// entity.
Notes NotesUnion `json:"notes"`
// Indicates whether the account settlement for transfer is on hold.
OnHold bool `json:"on_hold"`
// Order id linked to the payment made by the customer that has been settled.
OrderID string `json:"order_id,nullable"`
// Receipt number entered while creating the Order.
OrderReceipt string `json:"order_receipt,nullable"`
// The unique identifier of the payment linked to refund or transfer that has been
// settled.
PaymentID string `json:"payment_id,nullable"`
// Unix timestamp when the transaction was posted.
PostedAt int64 `json:"posted_at,nullable"`
// Indicates whether the transaction has been settled or not.
Settled bool `json:"settled"`
// Unix timestamp when the transaction was settled.
SettledAt int64 `json:"settled_at"`
// The unique identifier of the settlement transaction.
SettlementID string `json:"settlement_id"`
// The unique reference number linked to the settlement.
SettlementUtr string `json:"settlement_utr,nullable"`
// The tax charged for processing the transaction.
Tax int64 `json:"tax"`
// Indicates the type of transaction.
//
// Any of "payment", "refund", "transfer", "adjustment".
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Amount respjson.Field
CardIssuer respjson.Field
CardNetwork respjson.Field
CardType respjson.Field
CreatedAt respjson.Field
Credit respjson.Field
CreditType respjson.Field
Currency respjson.Field
Debit respjson.Field
Description respjson.Field
DisputeID respjson.Field
EntityID respjson.Field
Fee respjson.Field
Method respjson.Field
Notes respjson.Field
OnHold respjson.Field
OrderID respjson.Field
OrderReceipt respjson.Field
PaymentID respjson.Field
PostedAt respjson.Field
Settled respjson.Field
SettledAt respjson.Field
SettlementID respjson.Field
SettlementUtr respjson.Field
Tax respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SettlementReconGetResponseItem) RawJSON ¶
func (r SettlementReconGetResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*SettlementReconGetResponseItem) UnmarshalJSON ¶
func (r *SettlementReconGetResponseItem) UnmarshalJSON(data []byte) error
type SettlementReconService ¶
type SettlementReconService struct {
Options []option.RequestOption
}
SettlementReconService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSettlementReconService method instead.
func NewSettlementReconService ¶
func NewSettlementReconService(opts ...option.RequestOption) (r SettlementReconService)
NewSettlementReconService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SettlementReconService) Get ¶
func (r *SettlementReconService) Get(ctx context.Context, query SettlementReconGetParams, opts ...option.RequestOption) (res *SettlementReconGetResponse, err error)
Use this endpoint to return a list of all transactions such as payments, refunds, transfers and adjustments settled to your account on a particular day or month. [See docs](https://razorpay.com/docs/api/settlements/fetch-recon)
type SettlementService ¶
type SettlementService struct {
Options []option.RequestOption
Recon SettlementReconService
Ondemand SettlementOndemandService
}
SettlementService contains methods and other services that help with interacting with the gomon API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSettlementService method instead.
func NewSettlementService ¶
func NewSettlementService(opts ...option.RequestOption) (r SettlementService)
NewSettlementService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SettlementService) Get ¶
func (r *SettlementService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Settlement, err error)
Use this endpoint to retrieve details of a settlement with its id. [See docs](https://razorpay.com/docs/api/settlements/fetch-with-id)
func (*SettlementService) List ¶
func (r *SettlementService) List(ctx context.Context, query SettlementListParams, opts ...option.RequestOption) (res *SettlementListResponse, err error)
Use this endpoint to retrieve details of all settlements. [See docs](https://razorpay.com/docs/api/settlements/fetch-all/)
type SettlementStatus ¶
type SettlementStatus string
Indicates the settlement state.
const ( SettlementStatusCreated SettlementStatus = "created" SettlementStatusProcessed SettlementStatus = "processed" SettlementStatusFailed SettlementStatus = "failed" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|