-
Notifications
You must be signed in to change notification settings - Fork 7
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
Updating the idempotency key in refund APIs #35
Updating the idempotency key in refund APIs #35
Conversation
pages/debug/payments/refund.vue
Outdated
@@ -86,7 +81,7 @@ export default class RefundPaymentClass extends Vue { | |||
} | |||
|
|||
const payload: RefundPaymentPayload = { | |||
idempotencyKey: this.formData.idempotencyKey, | |||
idempotencyKey: uuidv4(), |
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.
This is not a safe idempotency value: it's not generated based on the request values so each request is guaranteed to be unique.
Instead, these idempotency values should be "stable" across a single request type so that we can catch out duplicate submissions. Two options:
- We can leave the functionality as-is (user input)
- We can remove the user-input and generate a input-based key
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.
Yeah. Thank you for the feedback @MasterXen . I will make both the idempotency key to be user input
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.
Looks good to me after addressing the comment. Just kicked to rebuild
The idempotencykey was an input in the refund APIs in merchant and market place API. This has been updated to be auto generated by the application as done in the cancel payments API