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

Wrong invoice retreive paramater type #123

Closed
habibimustafa opened this issue Mar 10, 2021 · 2 comments · Fixed by #124
Closed

Wrong invoice retreive paramater type #123

habibimustafa opened this issue Mar 10, 2021 · 2 comments · Fixed by #124

Comments

@habibimustafa
Copy link

Hello.

I think the id type on Retreive file should be string, because the xendit id pattern is like 579c8d61f23fa4ca35e52da4 (I got sample id from this link)

We got error on psalm check like this:

ERROR: InvalidScalarArgument - XenditInvoiceService.php:88:42 - Argument 1 of Xendit\Invoice::retrieve expects int|null, string provided (see https://psalm.dev/012)
        return \Xendit\Invoice::retrieve($xenditId);

and, this is the code that has to be changed:

trait Retrieve
{
    /**
     * Send GET request to retrieve data
     *
     * @param int|null $id ID    // << i think this is should be string|null
     *
     * @return array
     */
    public static function retrieve($id)
@stanleynguyen
Copy link
Contributor

Fixed in latest 2.9.1 https://packagist.org/packages/xendit/xendit-php

@habibimustafa
Copy link
Author

Thank you @stanleynguyen

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

Successfully merging a pull request may close this issue.

2 participants