Skip to content

Conversation

@talha-core
Copy link

I think it would be nice if just have the function to get the list of supported tax types as an array

@CLAassistant
Copy link

CLAassistant commented Aug 13, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@prathmesh-stripe
Copy link
Contributor

This file is autogenerated and we can't add this method to the TaxId resource. However you could use the following snippet in your code to get the list of all TaxID.

function getTaxIds()
{
    $taxIdClass = new ReflectionClass(\Stripe\TaxId::class);

    return array_filter($taxIdClass->getConstants(), function ($key) {
        // For PHP 8+
        return str_starts_with($key, 'TYPE_');
        // For PHP 7 or older
        // return substr($key, 0, 5 ) === "TYPE_";

    }, ARRAY_FILTER_USE_KEY);
}

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 this pull request may close these issues.

3 participants