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

Report and point and webhook not upadted with the documentation and typescript validation #391

Open
Akta3d opened this issue Feb 16, 2024 · 0 comments

Comments

@Akta3d
Copy link

Akta3d commented Feb 16, 2024

To create a wallet report on a javascript project I use these columns list :

        'Id',
        'Tag',
        'CreationDate',
        'Owners',
        'Description',
        'BalanceAmount',
        'BalanceCurrency',
        'FundsType',

on typescript project these columns are not valid from the typescript checking. But If I request these columns (as the typescript types and documentation):

    const reportOptions: MangoPay.report.CreateReport = {
      ReportType: 'WALLETS',
      CallbackURL: `...`,
      DownloadFormat: 'CSV',
      Sort: 'CreationDate:DESC',
      Preview: false,
      Filters: {
        AfterDate: moment().subtract(24, 'months').unix(),
        MinDebitedFundsAmount: 100,
        MinDebitedFundsCurrency: 'EUR',
      } as MangoPay.report.Filters,
      Columns: [
        'Id',
        'Tag',
        'CreationDate',
        'AuthorId',
        'DebitedFundsAmount',
        'CreditedFundsAmount',
        'FeesCurrency',
        'Type',
      ] ,
    };

I have an error

"errors": {
        "Columns": "Invalid column(s): AuthorId, DebitedFundsAmount, CreditedFundsAmount, FeesCurrency, Type"
}

To solve the issue I use previous columns list with any in my code

      Columns: [
        'Id',
        'Tag',
        'CreationDate',
        'Owners',
        'Description',
        'BalanceAmount',
        'BalanceCurrency',
        'FundsType',
      ] as any,

Then when I received the hook, I retreive the RessourceId with :
const { Date: date, EventType: eventType, RessourceId: ressourceId } = req.query;

the the query object has no RessourceId but a ResourceId
I need to write

  const date = req.query.Date;
  const eventType = req.query.EventType;
  const ressourceId = (req.query as any).ResourceId; // fuc**g MangoPay the query response is ResourceId and not RessourceId on this webhook ????

What I do wrong, or it's buggy.

Tested with mangopay2-nodejs-sdk version 1.31.1 and 1.42.1

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

No branches or pull requests

1 participant