-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added cancellation reasons #406
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: superman <[email protected]>
Signed-off-by: od-hunter <[email protected]>
The PR message doesn't have any details. Update the PR template for |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you resolve these failing tests?
- try running the tests locally to ensure they pass before pushing
you can install ganache and run a local blockchain with HD_WALLET_MNEMONIC="media nerve fog identify typical physical aspect doll bar fossil frost because"; ganache -m "$HD_WALLET_MNEMONIC" --chain.chainId 1337 -l 21000000
then run the tests with go tests -v ./...
// t.Run("fetch orders with cancellation reasons", func(t *testing.T) { | ||
// // Create a test order with cancellation reasons | ||
// order, err := test.CreateTestLockPaymentOrder(map[string]interface{}{ | ||
// "gateway_id": uuid.New().String(), | ||
// "provider": testCtx.provider, | ||
// "cancellation_reasons": []string{"Out of stock", "Payment failed"}, | ||
// }) | ||
// assert.NoError(t, err) | ||
|
||
// var payload = map[string]interface{}{ | ||
// "timestamp": time.Now().Unix(), | ||
// } | ||
|
||
// signature := token.GenerateHMACSignature(payload, testCtx.apiKeySecret) | ||
|
||
// headers := map[string]string{ | ||
// "Authorization": "HMAC " + testCtx.apiKey.ID.String() + ":" + signature, | ||
// "Client-Type": "backend", | ||
// } | ||
|
||
// res, err := test.PerformRequest(t, "GET", fmt.Sprintf("/orders?timestamp=%v", payload["timestamp"]), nil, headers, router) | ||
// assert.NoError(t, err) | ||
|
||
// // Assert the response body | ||
// assert.Equal(t, http.StatusOK, res.Code) | ||
|
||
// var response types.Response | ||
// err = json.Unmarshal(res.Body.Bytes(), &response) | ||
// assert.NoError(t, err) | ||
// assert.Equal(t, "Orders successfully retrieved", response.Message) | ||
|
||
// data, ok := response.Data.(map[string]interface{}) | ||
// assert.True(t, ok, "response.Data is not of type map[string]interface{}") | ||
// assert.NotNil(t, data, "response.Data is nil") | ||
|
||
// // Check cancellation_reasons for the first order | ||
// orders := data["orders"].([]interface{}) | ||
// assert.Greater(t, len(orders), 0) | ||
// cancellationReasons := orders[0].(map[string]interface{})["cancellationReasons"].([]interface{}) | ||
// assert.Equal(t, []string{"Out of stock", "Payment failed"}, cancellationReasons) | ||
// }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary comment
@od-hunter can you attend to the above requests? |
@sundayonah are you taking this ticket over the finish line. |
|
By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.
Description
I updated GetLockPaymentOrders controller to include cancellation reasons in response
I updated GetLockPaymentOrderByID controller to include cancellation reasons in response
References
closes #400
Testing
Checklist
main