Skip to content

Commit

Permalink
optional null value for callbackUrl
Browse files Browse the repository at this point in the history
sendDataToCallbackUrl fails when stripeSettings.callbackUrl is null. It is not required in the admin panel, so should take this into account.
  • Loading branch information
semics-tech authored Feb 7, 2023
1 parent 0060754 commit 5c2c8b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/services/stripeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ module.exports = ({ strapi }) => ({
async sendDataToCallbackUrl(session) {
try {
const stripeSettings = await this.initialize();

// Return if no callbackUrl is set
if (!stripeSettings.callbackUrl) return;

await axiosInstance.post(stripeSettings.callbackUrl, session);
} catch (error) {
throw new ApplicationError(error.message);
Expand Down

0 comments on commit 5c2c8b6

Please sign in to comment.