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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | commerce-square-add-catalog-object-id-3011562-3.patch | 4.14 KB | jrobison |
| #2 | commerce-square-add-catalog-object-id-3011562-2.patch | 3.85 KB | jrobison |
Comments
Comment #2
jrobison commentedAdding patch to add BaseFieldDefinition for catalog object id and passing it across to Square Catalog API.
Comment #3
jrobison commentedNew patch to include catalog id on commerce_product as well.
Comment #4
mglamanPatch, moving to review
Comment #5
socialnicheguru commentedWSOD 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