Skip to content

Commit 318c10f

Browse files
fix: compatible with the situation where 'cancel_url' or 'update_url' does not exist
1 parent 9c480eb commit 318c10f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/alert_parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const alertParsers = {
22
subscription_created: (req) => ({
3-
cancel_url: req.body.cancel_url,
3+
cancel_url: req.body.cancel_url || '',
44
checkout_id: req.body.checkout_id,
55
currency: req.body.currency,
66
email: req.body.email,
@@ -13,7 +13,7 @@ const alertParsers = {
1313
subscription_id: req.body.subscription_id,
1414
subscription_plan_id: req.body.subscription_plan_id,
1515
unit_price: req.body.unit_price,
16-
update_url: req.body.update_url,
16+
update_url: req.body.update_url || '',
1717
}),
1818
subscription_cancelled: (req) => ({
1919
cancellation_effective_date: req.body.cancellation_effective_date,

0 commit comments

Comments
 (0)