Search code examples
phpstripe-paymentssku

Stripe - SKUS without a name are not supported by checkout


I'm implementing a stripe checkout system.

Every time i try to call checkout view i have a weird javascript error: IntegrationError: SKUs for Checkout require a name attribute.

In dashboard the button for checkout integration is greyed out.

Any clues on how to pass the name in the creation of the SKU?

Here is my PHP for posting a SKU via stripe api curl call:

$sku = [
        'active' => 'true',
        'inventory' => ['type' => 'infinite', 'value' => null],
        "currency" => "eur",
        "price" => $price,
        "product" => $stripe_product_id
    ];

Solution

  • After many combinations, and deep analysis of stripe API, find the answer i was looking for.

    Products Creation:

    $pacoteSMS = [
            'name' => $name,
            'type' => 'good',
            'active' => 'true',
            'description' => $description,
            "attributes" => [
                "name"
            ],
        ];
    

    SKU creation:

    $sku = [
            'product' => $stripe_product_id,
            "attributes" => [
                "name" => $name,
            ],
            "price" => $price,
            "currency" => "eur",
            "inventory" => [
                "type" => "infinite",
            ],
            "active" => "true",
        ];