Skip to content

Commit

Permalink
Merge pull request #54 from manishkatyan/package-update
Browse files Browse the repository at this point in the history
update: added error handling, webhook URL
  • Loading branch information
nishekh-e-r authored Nov 15, 2022
2 parents 3a06d2f + 29d3d60 commit 38146c0
Show file tree
Hide file tree
Showing 14 changed files with 1,243 additions and 549 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ We are following the [official Node.js releases timelines](https://nodejs.org/en

**Supported Strapi versions**:

- Strapi v4.3.0 (recently tested)
- Strapi v4.5.0 (recently tested)

- Strapi v4.x

> The Stripe Payments plugin is designed for **Strapi v4.x**. It won't work with Strapi v3.x.
Expand Down Expand Up @@ -178,6 +179,16 @@ The Stripe Payments plugin also provides the payment transaction report. To view
<img style="width: 100%; height: auto;" src="https://higheredlab.com/wp-content/uploads/strapi-stripe-payment_report-v2.gif" alt="strapi-stripe-payment-report" />
<br/><br/>

## Webhook URL

The stripe Payments plugins also provides ability to add webhook URL. The response from Stripe will be posted to provided Webhook URL.
<br/>
To test this Functionality visit this [Link](https://webhook.site/)

1. Copy the unique URL and paste it in webhook URL field.
2. Whenever successfull stripe payment happens webhook URL recieve stripe data.
<br/><br/>

<br/>

## 📝 License
Expand Down
16 changes: 15 additions & 1 deletion admin/src/components/Configuration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Configuration = () => {
checkoutSuccessUrl: '',
checkoutCancelUrl: '',
currency: undefined,
callbackUrl: '',
});

const [showAlert, setShowAlert] = useState(false);
Expand All @@ -48,7 +49,7 @@ const Configuration = () => {
checkoutCancelUrl: '',
currency: '',
});

console.log('stripe configuration', stripeConfiguration);
useEffect(() => {
(async () => {
const response = await getStripeConfiguration();
Expand All @@ -63,6 +64,7 @@ const Configuration = () => {
checkoutSuccessUrl,
checkoutCancelUrl,
currency,
callbackUrl,
} = response.data.response;
setStripeConfiguration({
...stripeConfiguration,
Expand All @@ -74,6 +76,7 @@ const Configuration = () => {
checkoutSuccessUrl,
checkoutCancelUrl,
currency,
callbackUrl,
});
}
})();
Expand Down Expand Up @@ -380,6 +383,17 @@ const Configuration = () => {
</Select>
</Box>
</GridItem>
<GridItem col={6} s={12}>
<Box paddingBottom={2}>
<TextInput
name="callbackUrl"
label="Webhook URL"
value={stripeConfiguration.callbackUrl}
onChange={handleChange}
hint="The response from Stripe will be posted to this URL."
/>
</Box>
</GridItem>
</Grid>
</Box>
</Box>
Expand Down
Loading

0 comments on commit 38146c0

Please sign in to comment.