question

greyskymedia avatar image
greyskymedia asked greyskymedia commented

Triggering Pre-auth

Howdy folks, I'm working on starting a Pre-Auth process via a button click on my custom CFS app.
My code follows the Clover docs (https://docs.clover.com/docs/android-pay-preauth) but it's not working.

String externalPaymentId = String.valueOf(generateRandomNumbers());

Long amount = 2500L;

PreAuthRequestIntentBuilder builder = new PreAuthRequestIntentBuilder(externalPaymentId, amount);

builder.externalReferenceId(externalPaymentId);

Intent intent = builder.build(getApplicationContext());

intent.putExtra(Intents.EXTRA_AMOUNT, amount);

intent.putExtra(Intents.EXTRA_PAYMENT_ID, externalPaymentId);

startActivityForResult(intent, PAYMENT_REQUEST_CODE);


Where am I going wrong?

App Marketclover developer communitystation pro
17 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.

Blake Williams avatar image Blake Williams ♦ commented ·

How are you starting the "custom CFS app"? Is the merchant facing device a Clover device, or something else (Windows, iOS, Android, etc).

0 Likes 0 ·
gsm-tommy avatar image gsm-tommy Blake Williams ♦ commented ·

We are starting it with the CFP following the steps in the docs here; https://docs.clover.com/docs/using-customer-facing-platform#starting-custom-activities-and-getting-activity-results.

Whenever the button is been clicked on the CFS screen, a `doSendMessageToPOS` os triggered with a payload message which is then compared in the `onMessageFromActivity` on the Merchant screen. In the `onMessageFromActivity` is where the above code is been written.

0 Likes 0 ·
Blake Williams avatar image Blake Williams ♦ gsm-tommy commented ·
ok, that makes sense. Are there any errors in the log?
0 Likes 0 ·
Show more comments

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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