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

fix(connector): [Shift4]Add Refund webhooks #1307

Merged
merged 11 commits into from
Jun 15, 2023

Conversation

srujanchikke
Copy link
Contributor

@srujanchikke srujanchikke commented May 29, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Refund webhook support for shift4 (status mapping ref) . We always update the status by psync as we don't have source verification for shift4 .

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

payment webhook
Screenshot 2023-05-29 at 6 51 42 PM
Refund webhook
Screenshot 2023-05-29 at 6 51 05 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Signed-off-by: chikke srujan <[email protected]>
@srujanchikke srujanchikke added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement R-waiting-on-L1 Review: Waiting on L1 reviewer labels May 29, 2023
@srujanchikke srujanchikke self-assigned this May 29, 2023
@srujanchikke srujanchikke requested a review from a team as a code owner May 29, 2023 14:52
@github-actions github-actions bot added the S-conventions-not-followed Status: This PR does not follow contributing guidelines label May 29, 2023
@srujanchikke srujanchikke changed the title feat(connector):[Shift4] Add webhook support to shift4 feat(connector):[Shift4] Add webhook support May 29, 2023
@srujanchikke srujanchikke changed the title feat(connector):[Shift4] Add webhook support fix(connector): [Shift4]Add Refund webhooks May 29, 2023
@github-actions github-actions bot removed the S-conventions-not-followed Status: This PR does not follow contributing guidelines label May 29, 2023
@srujanchikke srujanchikke linked an issue May 29, 2023 that may be closed by this pull request
@ArjunKarthik ArjunKarthik added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label May 31, 2023
@srujanchikke srujanchikke removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label May 31, 2023
prasunna09
prasunna09 previously approved these changes May 31, 2023
@prasunna09 prasunna09 added R-waiting-on-L2 Review: Waiting on L2 reviewer R-L1-completed Review: L1 Review completed and removed R-waiting-on-L1 Review: Waiting on L1 reviewer labels May 31, 2023
),
))
} else {
Err(errors::ConnectorError::WebhookEventTypeNotFound).into_report()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Err(errors::ConnectorError::WebhookEventTypeNotFound).into_report()
Err(errors::ConnectorError::WebhookReferenceIdNotFound).into_report()

impl From<Shift4WebhookEvent> for api::IncomingWebhookEvent {
fn from(event: Shift4WebhookEvent) -> Self {
match event {
Shift4WebhookEvent::ChargeSucceeded | Shift4WebhookEvent::ChargeUpdated => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ChargeSucceeded is also mapped as PaymentIntentProcessing
do we get ChargeCaptured for automatic capture_method also from shift4?

Copy link
Contributor Author

@srujanchikke srujanchikke Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reference from shift4 ChargeSucceded is when charge is created sucessfully , and charge captured Occurs when a charge is captured. No we are not getting chargeCaptured for automatic but , as per their documentation i have mapped the status .

@jagan-jaya jagan-jaya added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Jun 8, 2023
@srujanchikke srujanchikke added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Jun 9, 2023
@jagan-jaya jagan-jaya added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L2 Review: Waiting on L2 reviewer labels Jun 14, 2023
@jagan-jaya jagan-jaya added this pull request to the merge queue Jun 15, 2023
Merged via the queue into main with commit 1691bea Jun 15, 2023
@SanchithHegde SanchithHegde deleted the add_webhook_support_to_shift4 branch June 17, 2023 07:25
@SanchithHegde SanchithHegde removed S-ready-for-merge R-L1-completed Review: L1 Review completed labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

feat(connector): [Shift4] Refund webhooks
5 participants