I need access to the Commerce 2 SKU in the Payment Gateway to check for a product ID at Stripe during the Checkout. It apparently available now for auto complete due the committed code of issue link number 2 below
$sku = $orderItem->getPurchasedEntity()->getSku(); – does this work now ?? Or does something shorter work now ?
reference https://www.drupal.org/project/commerce/issues/3083123 and https://www.drupal.org/project/commerce/issues/3005944#comment-14458978
I need to use code in the payment Commerce Stripe gateway to summon products from Stripe – which are stored there as product ID’s that I use as a SKU and search for a match, and if found use it in checkout and if not create the product
for instance
// Try to find existing Stripe product and payment method attached to the product and customer. try { $product = Product::all([‘limit’ => 1, ‘SKU’ => $sku]); more . . .
Since the second issue above was comitted and is in my code . . . so does $sku = $orderItem->getPurchasedEntity()->getSku(); – work now ?? Or does somethuing shorter work now ?