-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: add createRefund GraphQL mutation #5354
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
Conversation
Signed-off-by: Erik Kieckhafer <[email protected]> (cherry picked from commit ecd3492)
focusaurus
left a comment
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 overall. Probably worthwhile to defend against negative amount, but that's my only change request.
imports/plugins/core/orders/server/no-meteor/mutations/createRefund.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/mutations/createRefund.test.js
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
|
@focusaurus I've added a Also added a test for this. Ready for another look. |
focusaurus
left a comment
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.
Sorry for the noise, I re-reviewed pair with Eric D to learn his Jedi review techniques.
imports/plugins/core/orders/server/no-meteor/mutations/createRefund.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/mutations/createRefund.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/mutations/createRefund.test.js
Show resolved
Hide resolved
imports/plugins/included/marketplace/server/no-meteor/util/stripeCreateRefund.js
Outdated
Show resolved
Hide resolved
imports/plugins/included/payments-stripe/server/no-meteor/util/stripeCreateRefund.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
|
@focusaurus all comments addressed, ready for another look |
Signed-off-by: Erik Kieckhafer <[email protected]>
…eateRefundGQLMutation
Part of #5158
Impact: minor
Type: feature
A new
createRefundmutation allows you to create a refund for a particular payment on an order. This was previously a meteor only method. The meteor method will be removed with #5158.Breaking changes
None
Testing
amount,orderId, andpaymentIdare required.reasonis optional. It's set up as aStringto be used with multiple payment providers, however forStripe, which is our only provider at the moment, they only accept 3 values for reason:duplicate,fraudulent, orrequested_by_customer, so be sure to use one of those values if testing with Stripe. This limit will be built into the Operator UI if Stripe is the payment method. From their docs:I've added tests here to test the permission / requirements of variables, but did not add tests to check a result, as the payment method has it's own tests for this element: https://github.com/reactioncommerce/reaction/blob/feat-kieckhafer-listRefundsGQLQuery/imports/plugins/included/payments-stripe/server/no-meteor/util/stripeListRefunds.test.js#L10