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

Adding Tax to payment form errors #375

Open
splendidrob opened this issue Nov 7, 2023 · 3 comments
Open

Adding Tax to payment form errors #375

splendidrob opened this issue Nov 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@splendidrob
Copy link

splendidrob commented Nov 7, 2023

Description

Error thrown when adding Tax to a payment form. Tax has been created in Stripe and is shown in Stripe Payments but adding to the payment form throws the following error:

TypeError
in_array(): Argument #2 ($haystack) must be of type array, null given
1. in /home/bristolcrewco/stage.bristolcrew.co.uk/craft/vendor/enupal/stripe/src/services/Vendors.phpat line 89
80818283848586878889909192939495969798        $connect->rate = $settings->globalRate;
        $connect->allProducts = false;
 
        $connects = Stripe::$app->connects->getConnectsByVendorId($vendor->id, false);
        if (!empty($connects)) {
            $connect = $connects[0];
            if (is_string($connect->products)){
                $products = json_decode($connect->products, true);
                $productId = "".$paymentForm->id;
                if (!in_array($productId, $products)) {
                    $products[] = $productId;
                } else {
                    return false;
                }
            }
        }
 
        $connect->products = json_encode($products);
'''
![screenshot_1249](https://github.com/enupal/stripe/assets/25520763/6e2914f7-0a1e-4561-8c36-0efcac243b96)
![screenshot_1248](https://github.com/enupal/stripe/assets/25520763/e4b01137-821a-4a8c-aee5-b7c470e78e30)
![screenshot_1247](https://github.com/enupal/stripe/assets/25520763/ef9729cc-3300-452a-8bfb-16e741410e50)

### Additional info

- Craft version: Craft Pro 4.5.9
- PHP version: 8.0.30
- Database driver & version: MySQL 5.7.43
- Plugin version: 5.5.0
- Is [SCA](https://docs.enupal.com/stripe-payments/getting-started/sca.html) and Stripe Checkout enabled?: YES
@splendidrob
Copy link
Author

@andrelopez Just updating this - it seems making any change to a payment form or creating a new payment form causes this error...so payment forms can no longer be created at all...

@splendidrob
Copy link
Author

Just to update this as per the error above this seems to be to do with Stripe Connect...I deleted all my connect data and turned off connect (turning off by its self didn't help) and now I am able to use payment forms again....

@andrelopez
Copy link
Member

Thanks for following up and for sharing your findings

@andrelopez andrelopez self-assigned this Dec 8, 2023
@andrelopez andrelopez added the bug Something isn't working label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants