question

sujith avatar image
sujith asked thettalos commented

Flow of Clover app for payments?

I have one food item in clover inventory,I want to make an order for it and start payments. Somebody help me to give the flow of this process.

OrdersPayments
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.

thettalos avatar image thettalos commented ·

I have almost the same issue, maybe a little bit more advanced. I already have the following code ..... PaymentRequest paymentReq = new PaymentRequest(); paymentReq.setTender(cashTender); paymentReq.setOrderId(newOrder.getId()); Payment newPayment = cloverApp.getOrderConnector().pay(newOrder.getId(), paymentReq, true, null);

.... and I'm getting the error "app doesn't have the required permission" Any idea ??

Thanks in advance

0 Likes 0 ·

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered

You will use OrderConnector to create an order and add line items to the order. You initiate the payment using the intent ACTION_CLOVER_PAY (see class Intents in the Clover Android SDK for details). Note the latter step will start the payments UI, where the merchant will be able to choose a tender, initiate a credit card transaction, etc. It's not a programmatic "pay" method.

If you are attempting to programmatically pay, as the comment says, OrderConnector.pay() is a restricted operation. The reason is that there are quite a few subtle details to creating a valid payment object that aren't documented well enough. You can however use the REST API directly. It's not logical one would be exposed and not the other. We understand the inconsistency are are considering how to resolve the issue. This question,

http://devask.clover.com/question/151...

discussed how to pay using the REST API.

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