Hi,
We are migrating from Developer Pay V2 API to ECOM API referring to the migration guide. We were in using the hosted iFrame using all the codes provided and also we were able to charge the card using all of the process that was mentioned in the same guide.
The problem happens only when we add additional charges like to the lineItems API. The orders API does not calculate those additional charges except the items which were lined to the order id. Referring to our example, we add these additional charges as a line item to the order, Delivery fee is non taxable and Convenience fee is taxable item. XPN83AY98983Y, this is the order id which we tried doing the payment but got an error response as below;
response after payment
Array
(
[message] => 409 Conflict
[error] => Array
(
[type] => invalid_request_error
[code] => order_over_paid
[message] => Order with id XPN83AY98983Y would be over paid.
)
)
and here is the array which we are passing to https://scl-sandbox.dev.clover.com/v1/orders/$order_id/pay
$fields=array(
"amount"=>round($tot),
"tax_amount"=>round($tax),
"tip_amount"=>intval($tip*100),
"ecomind"=>"ecom",
"currency"=> "usd",
"email"=>"vishal@imerchantech.com",
"source"=> $this->input->post('cloverToken')
);
Where cloverToken refers to the token which is returned by providing card data. If you check the order using order id given above, you get order total as $23.98 which is the total amount after adding two line items but the additional charges that we add should calculate the total to $27.98. If I open the same order using Orders app then the total changes an we can make a payment but the transaction is always less paid or Partially Paid.
Please help!