I'm working on a patch for the Commerce Square Connect contrib module as described here:
The patch I've developed provides basic functionality, but it has some issues that I'd like to address. I'm hoping someone who's more familiar with Commerce APIs can point me in the right direction.
The patch doesn't address shipping tax correctly. Right now it incorrectly assumes that shipping adjustments aren't taxable. Is there some function I can call to determine if a shipping adjustment is taxable?
The patch also doesn't handle payments for additional order items properly. Here's the use case:
- An order is created, and payment is processed successfully.
- The order is edited, and a new item is added to the order.
- Payment is submitted for the item that's been added to the order.
The issue here is that the list of processed order items includes all items associated with the order, not just the added item. As a result, the order cost (for all items) and the amount paid (for only the new item) are inconsistent, and Square rejects the payment.
Is there some way to identity a new order item and ignore items that have already been paid for?