Stripe void invoice action error

Wappler Version : 4.5.0
Operating System : mac intel
Server Model: node
Database Type:
Hosting Type:

Expected behavior

The Stripe Void Invoice action should work

Actual behavior

500 error

{
  "status": "500",
  "message": "stripe.invoices.void is not a function",
  "stack": "TypeError: stripe.invoices.void is not a function\n    at App.exports.voidInvoice (/Users/pauka/WapplerProjects/mpp/lib/modules/stripe.js:1927:30)\n    at App._exec (/Users/pauka/WapplerProjects/mpp/lib/core/app.js:481:57)\n    at App.exec (/Users/pauka/WapplerProjects/mpp/lib/core/app.js:421:20)\n    at App.repeat (/Users/pauka/WapplerProjects/mpp/lib/modules/core.js:72:28)\n    at App._exec (/Users/pauka/WapplerProjects/mpp/lib/core/app.js:481:57)\n    at App._exec (/Users/pauka/WapplerProjects/mpp/lib/core/app.js:452:28)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async App.exec (/Users/pauka/WapplerProjects/mpp/lib/core/app.js:421:9)\n    at async App.exec (/Users/pauka/WapplerProjects/mpp/lib/modules/core.js:197:13)\n    at async App._exec (/Users/pauka/WapplerProjects/mpp/lib/core/app.js:481:30)"
}

How to reproduce

Add Void Invoice action, provide a valid id, and execute

@patrick @George

This change appears to fix

In /lib/modules/stripes.js

// /v1/invoices/{invoice}/void - post
exports.voidInvoice = function (options) {
    options = this.parse(options);
    var __extra = options.__extra;
    if (options.__extra) {
        __extra = convertExtraOptions(__extra);
        delete options.__extra;
    }

    const invoice = this.parseRequired(options.invoice, 'string', 'stripe.voidInvoice: invoice is required.');
    delete options.invoice;
    return stripe.invoices.voidInvoice(invoice, __extra);
};

Changed

return stripe.invoices.void(invoice, __extra);

to

return stripe.invoices.voidInvoice(invoice, __extra);

This might have the same issue since it is trying to call “void” , but I haven’t tried it:

// /v1/credit_notes/{id}/void - post
exports.voidCreditNote = function (options) {
    options = this.parse(options);
    var __extra = options.__extra;
    if (options.__extra) {
        __extra = convertExtraOptions(__extra);
        delete options.__extra;
    }

    const id = this.parseRequired(options.id, 'string', 'stripe.voidCreditNote: id is required.');
    delete options.id;
    return stripe.creditNotes.void(id, __extra);
};
1 Like

This has been fixed in Wappler 4.9.1

This topic was automatically closed after 2 days. New replies are no longer allowed.