WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@ankitdas13
Copy link
Contributor

@ankitdas13 ankitdas13 commented Apr 25, 2025

feat: add api request and response structs

  • Add OrderRequest and OrderResponse struct for create order & fetching order by id

Comment on lines 3 to 6
type OrderRequest struct {
Amount int `json:"amount"`
Currency string `json:"currency"`
Receipt string `json:"receipt"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add all the request/resp params specified in docs as well?
https://razorpay.com/docs/api/orders/create

so, let's add first_payment_min_amount and partial_payment as well here.

Comment on lines 1 to 2
package types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add these definitions in the resources/order.go file itself but probably at the top of the file.

Comment on lines 279 to 280
// Call makes an HTTP request to the Razorpay API
func (request *Request) Call(method, path string, params interface{}, result interface{}) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's have separate fields for params and payload. POST can have both params and payload

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call(method, path string, payload any, params interface{}, result interface{})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants