moltin / php-sdk

Community built SDK for using Moltin with PHP
MIT License
47 stars 19 forks source link

can't add item to an order #42

Closed mlevkovsky closed 8 years ago

mlevkovsky commented 8 years ago

While trying to add an item to the order (whether via curl or the php sdk) I always get the same:

TAX_BAND, TAX_RATE required

error.

This is my call $result = \Moltin\SDK\Facade\Order::AddItem($order['result']['id'],[ 'product'=>$product['id'], 'sku'=>$product['sku'], 'title'=>$product['title'], 'quantity'=>1, 'tax_rate'=>$product['tax_band']['data']['rate'], 'tax_band'=>$product['tax_band']['data']['id'], 'price'=>$product['price']['data']['rounded']['without_tax'] ]);

mlevkovsky commented 8 years ago

I just realized the docs aren't consistent. I stumbled upon the flow docs in forge and it states that tax band is an object: https://forge.moltin.com/flow/order_items/view

However in these docs it makes it look like you can pass in just the tax band ID

https://docs.moltin.com/orders//#add-an-item-to-an-order