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

🔥 Feature: webhook-support-51 #58

Closed
wants to merge 4 commits into from

Conversation

msalbrain
Copy link
Contributor

@msalbrain msalbrain commented Nov 7, 2023

Description

This pull request addresses #51 with the following changes:

  • Two new fields added to settings table (stripe_webhook_url and stripe_webhook_id)
  • The settings queries were updated to accommodate to new fields
  • The UpdateSettings handler was update to accept a webhook url input and make update to stripe as neccesarry
  • A webhook listener handler was added at /api/_/stripe-webhook. Although it wasn't set as default
  • Removed webhook secrete field from frontend stripe setting and added a webhook url field instead. Because the webhook secrete and webhook id are retruned from updating the webhook url on stripe
  • what to do with webhook event is left unimplemented 👇🏼
    image

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

@shurco
Copy link
Owner

shurco commented Nov 8, 2023

Hi @msalbrain,

Thank you for the work done, but it's not exactly what I wrote about in #51 (comment)
I meant that litecart should send a webhook to the specified address when one of the triggers is activated.

Your code sends a webhook from Stripe. Since payment is made in a sliding mode, such hooks are not needed.

@msalbrain
Copy link
Contributor Author

thanks for the heads up. I see where you're coming from with the updates to the cart in the DB. I'll use that to trigger the webhook/API calls for payment updates.

Quick question: Should I ditch the webhook secret key, or is that part of another cool feature you've got in mind?

@shurco
Copy link
Owner

shurco commented Nov 9, 2023

Quick question: Should I ditch the webhook secret key, or is that part of another cool feature you've got in mind?

You don't have to use the webhook key.

@msalbrain msalbrain closed this Nov 12, 2023
@msalbrain msalbrain deleted the feature/webhook-support-51 branch November 12, 2023 23:24
@msalbrain msalbrain restored the feature/webhook-support-51 branch November 12, 2023 23:24
@msalbrain msalbrain deleted the feature/webhook-support-51 branch November 12, 2023 23:24
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.

2 participants