Skip to content
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

Merged
merged 3 commits into from
Apr 15, 2020

Conversation

tarunkumar2
Copy link
Contributor

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

@@ -86,7 +81,7 @@ export default class RefundPaymentClass extends Vue {
}

const payload: RefundPaymentPayload = {
idempotencyKey: this.formData.idempotencyKey,
idempotencyKey: uuidv4(),
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@kristinfritsch kristinfritsch left a 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

@MasterXen MasterXen merged commit 7ce42c4 into circlefin:master Apr 15, 2020
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