Complete Payments

I am have a couple of questions regarding the Complete Payments functionality and wondered if someone could help?

I have a customer app which places an order and performs a card authorisation (payment not completed). This order can be accepted, partially accepted or rejected by the vendor. At this point the idea is to complete payment with full amount (on accepted), complete with partial amount (on partially accepted) or cancel the payment (if rejected).

I cannot see a way in the documentation to complete the payment with a reduced amount (although I may have an idea, described below)

Also I am using C# to complete the payment… This is the documentation page POST /v2/payments/{payment_id}/complete - Square API Reference
The example C# code shows the following, but CompletePaymentRequest is not recognised as a Square class (I do have a CompletePaymentResponse, but clearly thats not something I should use here)… I assume this CompletePaymentRequest is where I would declare the new lower payment for a partial payment? (My current Square SDK version is 8.0 which was released 16th Dec 2020 in line with the documentation). Much appriciated if someone could point me in the right direction… Thanks in advance.

var body = new CompletePaymentRequest.Builder()

  var result = await client.PaymentsApi.CompletePaymentAsync

Unfortunately there is not a way to lower the amount on the payment at this time, so you would need to create an entirely new payment if you wished to change the amount. Also, as for the CompletePaymentRequest not existing, this is a known issue in the API Explorer (reported late last week) and we’re working to remove it. In the actual SDK, no model/object is required, you simply pass the payment_id to the CompletePayment function.

I’ll DM you for more information on your use-case, though.

1 Like