When a transaction is submitted through the Square Payment Gateway, there's no way to pass along the Catalog Object ID to the Square Connect Catalog API.

Code should be added to allow setting the Catalog Object ID on Product Variations which will then be passed to the Commerce Order Item object in the Commerce Order during the transaction. The code in \Drupal\commerce_square\Plugin\Commerce\PaymentGateway\Square should then check if the Catalog Object ID is set on the Commerce Order Items and call \SquareConnect\Model\OrderLineItem::setCatalogObjectId if so. The \SquareConnect\Model\OrderLineItem::setName should not be called when setting the Catalog Object ID.

I plan to work on a patch for this soon.

Comments

jrobison created an issue. See original summary.

jrobison’s picture

Adding patch to add BaseFieldDefinition for catalog object id and passing it across to Square Catalog API.

jrobison’s picture

New patch to include catalog id on commerce_product as well.

mglaman’s picture

Status: Active » Needs review

Patch, moving to review

socialnicheguru’s picture

Status: Needs review » Needs work

WSOD when I tried to save /admin/config/people/profile-types/manage/customer/fields/profile.customer.address

I updated the customer profile.
I set the default country
I hit enter
I got a WSOD

Argument 1 passed to commerce_square_entity_base_field_info() must be an instance of EntityTypeInterface, instance of Drupal\\Core\\Entity\\ContentEntityType given in drupal-commerce-8/web/modules/contrib/commerce_square/commerce_square.module on line 55