question

zavan avatar image
zavan asked zavan answered

Order shows as "Partially Paid" even though it's fully paid

I'm using the API to create an order. The total for the order with taxes and tips shows as 14.26, the payment shows as totalling 14.26 (including taxes and tips), so why is the order marked as "Partially Paid" not "Fully Paid"?


I'm using the staging env.

Merchant ID: 57MT86WG53R11

Order ID: GZ67XCRVQ9DKR

OrdersREST APIpaymentstate
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zavan avatar image
zavan answered

Found the problem: I was setting the order "total" attribute to the total including the tip, changing it to total minus tips and including the tipAmount in the payment works.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered zavan commented

Is this order being paid for via custom tender?

3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zavan avatar image zavan commented ·

Hi David, yes, it's a custom tender created with:

{

label: 'Spillover Online Ordering',

editable: false,

opensCashDrawer: false,

enabled: true,

visible: false

}


I create the order, then the line items and modifiers, then add the payment to the order (associated to said custom tender), all through the API.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ zavan commented ·

I am a bit rusty on custom tender payments, but I am seeing the following in the logs - "payment missing tax rates"

0 Likes 0 ·
zavan avatar image zavan David Marginian ♦♦ commented ·

Tax rates are being added to each line item, and they may be different depending on the item, so which ones should be added to the payment? All unique ones?

0 Likes 0 ·
zavan avatar image
zavan answered

I'm currently creating the payment setting the amount to the order total minus tips, and setting taxes and tips separately, like so:


payment_data = {

tender: {

id: tender_id

},

amount: value_to_cents(order.total_minus_tips),

tipAmount: value_to_cents(order.tip),

taxAmount: value_to_cents(order.tax)

}


This results in the payment having the correct total but the order being marked as "partially paid".


If instead I use the order total in the payment amount:


payment_data = {

tender: {

id: tender_id

},

amount: value_to_cents(order.total),

tipAmount: value_to_cents(order.tip),

taxAmount: value_to_cents(order.tax)

}


The order is marked as "paid", but the payment is over the value of the order because it sums amount + tip + tax...


If I don't send the taxes and tips in the payment:


payment_data = {

tender: {

id: tender_id

},

amount: value_to_cents(order.total)

}


The order is marked as "paid", but in the order receipt the order total is wrong, it doesn't includes the tip, while the payment total is "correct".

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community