[Vuejs]-Stripe Checkout part 2.0

0👍

As I assumed trouble was in line_items. I pushed in data uncorrectly. Then I checked the documentation. Add line price data and product_data in forEach item. And that’s it. Thank u for ur attention. Also, big thanks to user: karllekko

 all.forEach(item => {
        const data = {
            price_data: {
                product_data:{

                }
            }
        };
        data.price_data.unit_amount = parseFloat(item.data().price * 100);
        data.price_data.currency = "aud";
        data.price_data.product_data.name = item.data().name;

        myProducts.forEach(q => {
            if(item.id == q[0]){
              data.quantity = q[1];
            }
        });

        results.push(data)
    });

Leave a comment