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

@vizvasrj
Copy link

@vizvasrj vizvasrj commented Dec 3, 2024

Note :- Please follow the below points while attaching test cases document link below:

- If label Tested is added then test cases document URL is mandatory.

- Link added should be a valid URL and accessible throughout the org.

- If the branch name contains hotfix / revert by default the BVT workflow check will pass.

Test Case Document URL
Please paste test case document link here....

TestOrderCreate for test

https://github.com/razorpay/razorpay-go/blob/master/resources/order_test.go

i have try to use struct instead of map[string]interface{} for order.Create.

…me and GetNotes methods

- Added OrderCreateResponse struct with fields for order creation response.
- Implemented GetNotes method to retrieve notes as a map of strings.
- Implemented CreatedTime method to convert CreatedAt to time.Time.
- Added OrderCreateRequest struct with fields for order creation request.
…ted with interface{} type because i need to give struct here it can then convert it to jsonbytes after, i will be better this way
…eResponse structs

- Updated Order.Create method to accept OrderCreateRequest struct instead of map[string]interface{}.
- Modified Order.Create method to return OrderCreateResponse struct instead of map[string]interface{}.
- Added JSON marshaling and unmarshaling to convert between structs and JSON data.
- Improved type safety and readability by using defined structs for request and response data.

Refactor TestOrderCreate to use resources.OrderCreateRequest instead of map[string]interface{}

- Updated TestOrderCreate to use resources.OrderCreateRequest struct for request parameters.
- Replaced map[string]interface{} with resources.OrderCreateRequest in the test.
- Ensured the test setup and assertions remain consistent with the new struct.
@vizvasrj vizvasrj marked this pull request as draft December 3, 2024 14:46
@vizvasrj vizvasrj marked this pull request as ready for review December 3, 2024 14:47
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.

1 participant