question

clover-faq avatar image
clover-faq asked clover-faq edited

How can I tell whether a Partial Auth has occurred?

How can I tell whether a Partial Auth has occurred?
FAQ
10 |2000

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

1 Answer

clover-faq avatar image
clover-faq answered clover-faq edited
To find out whether a partial authorization has occurred, compare the payment response amount with the payment request amount. If they differ, the customer was only able to pay a portion of the sale. If this is the case, you'll need to complete the sale, then issue a second sale for the remaining amount.

//Create a Sale with a specific amount
var pendingSale = new SaleRequest();
pendingSale.ExternalId = ExternalIDUtil.GenerateRandomString(13);
pendingSale.Amount = 100000;
totalAmount = pendingSale.Amount;
pendingSale.AutoAcceptSignature = true;
pendingSale.DisableDuplicateChecking = true;
cloverConnector.Sale(pendingSale);
//In your DefaultCloverConnectorListener implementation
public override void OnSaleResponse(SaleResponse response)
{
   base.OnSaleResponse(response);
   totalAmount -= response.Payment.amount;
   if (totalAmount != 0)
   {
      Console.WriteLine("Partial auth was taken.");
      //Handle however you find suitable
   }
}
A partial auth also occurs when the CONFIRM_PARTIAL_AUTH deviceEvent starts.

ExampleCloverConnectorListener.prototype.onDeviceActivityStart = function(deviceEvent) {
  if (deviceEvent.eventState === clover.remotepay.DeviceEventState.CONFIRM_PARTIAL_AUTH) {
    // then a partial auth occured
      }
    }
  }
}
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