question

Alexey avatar image
Alexey asked Alexey commented

Looking for a proper way of adding payment for order

Hello,

I add payment to an order using this request:

https://sandbox.dev.clover.com/v3/mer...

{ "tender": { "id": "0C43K09N1XFBG" }, "amount": 1100, "cardTransaction": { "entryType": null, "last4": "0000", "authCode": null, "avsResult": "SUCCESS", "cardType": "VISA", "transactionNo": "XXX", "type": null, "first6": "0000*", "token": null, "cloverVaultedCard": null, "endBalance": null, "cardHolderName": "Not specified", "state": "CLOSED" }, "taxAmount": 100, "result": "SUCCESS" }

Is that a proper way to create payment for order? Should I add lineitem payments and taxrates and etc? What are restricted payment parameters to provide correct work?

1 comment
10 |2000

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

Miguel avatar image Miguel commented ·

What type of payment tender are you trying to add?

0 Likes 0 ·
sam avatar image
sam Deactivated answered Alexey commented

You can use https://sandbox.dev.clover.com/v3/merchants/{merchid}/orders/{orderid}/payments to add payments with external tender type such as 'external payment' or 'cash', but we currently don't allow you to add native credit or debit payments.

You can keep it as simple as just your tender and amount:

{ "tender": { "id": [your_tender_id] }, "amount": 100}

Specificity of your payment information will be determined by your own needs. We encourage you add tax information but these optional params are used in your own discretion:

{ 
   "tender": { "id": [tender_id] }, 
   "taxAmount": 100, 
   "note": "notes", 
   "tipAmount": 100, 
   "cashbackAmount": 100, 
   "cashTendered": 100, 
   "employee": { "id": [employee_id]}, 
   "clientCreatedTime": 1483228800000, 
    "lineItemPayments": [
    {
      "binName": "thisisthebin",
      "percentage": 100,
      "refunded": false,
      "id": [line_item_id]
    }
  ]
}
2 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.

Alexey avatar image Alexey commented ·

Specificity of your payment information will be determined by your own needs. We encourage you add tax information but these optional params are used in your own discretion. By these words I still in doubt. Is my way correct for now and wiil not cause any problems later? I mean global process of merchant activity. For example if I will not send taxes for payment it would be wrong and probably this app will be banned for cheating.

0 Likes 0 ·
sam avatar image sam commented ·

@alexey, to be compliant with PCI regulations, we strongly recommend at following our best practices guide: https://docs.clover.com/build/working... While params are options, taxes are important in order for merchants to gather correct aggregate numbers in their reporting.

0 Likes 0 ·
jvictor avatar image
jvictor answered sam Deactivated commented

Hello,

 We are able to make the payment using Spreedly and the https://api.clover.com/v3/merchants/xxxxxx/orders/xxxxxx/payments endpoint. We are using the id of "External Payment" as tender. But accessing the Orders tab of the Clover dashboard the order is nowhere to be found. Accessing the Payments tab, we can see the payment and the associated correct order id. Clicking on the order id brings up the order details but clicking on the receipt link get us the error below. 1) How do we get the order to show up in the Orders tab and 2) why is no receipt generated.

// https://sandbox.dev.clover.com/tx/p/<... id="">

{ "message": "We couldn't find that receipt. The payment id was 'BT812VSTMH2VJ'" }

Thanks in advance.

1 comment
10 |2000

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

sam avatar image sam commented ·

Hi @jvictor It sounds like when you created your order, you did not set the state param. Add "state" in your order create request body.

{
   "state": "open"
}

PS. To get more timely support, please post your question on a separate thread.

0 Likes 0 ·
Alexey avatar image
Alexey answered

"Specificity of your payment information will be determined by your own needs. We encourage you add tax information but these optional params are used in your own discretion." By these words I still in doubt. So if I don't need any other info from payment, my way of creating payment is correct and will not cause any problems later? I mean global process of merchant activities (problems with taxes or something like that).

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