Hi Bryan
I had shared the location id
Please reply me back
Hi Bryan
I had shared the location id
Please reply me back
Yes, thank you. The team is looking into this.
Hi Team
It s more than 1 week. I am waiting for the solution.
If your sdk is not stable , then please do not waste our time and money.
The team is looking into why there wasn’t a callback. However are you testing in one of our supported regions?
Hi
Yes we are testing in USA
Hi Bryan
I am waiting for your reply.
Client is very disappointed due to your sdk is not working properly
Hi Bryan
I am waiting for your reply.
At this time I don’t have an update from the team. They are still looking into this. I’ll definitely post any updates as I get them.
Can you provide the snippet of code where you call:
ReaderSdk.checkoutManager().addCheckoutActivityCallback(..)
and ReaderSdk.checkoutManager().startCheckoutActivity(..)
CheckoutManager checkoutManager = ReaderSdk.checkoutManager();
checkoutCallbackRef = checkoutManager.addCheckoutActivityCallback(this::onCheckoutResult);
private void onCheckoutResult(Result<CheckoutResult, ResultError> result) {
isSuccessOrFailure=true;
if (result.isSuccess()) {
ExampleApplication.paymentDone = true;
BluetoothService.working=false;
CheckoutResult checkoutResult = result.getSuccessValue();
progressBar.setVisibility(View.VISIBLE);
Set<Tender> tenders=checkoutResult.getTenders();
Tender[] tenders1=new Tender[tenders.size()];
int counter=0;
for (Tender tender2 : tenders) {
tenders1[counter]=tender2;
counter+=1;
}
//Tender[] tenders1= (Tender[]) tenders.toArray();
String last4= tenders1[0].getCardDetails().getCard().getLastFourDigits();
String locationId = checkoutResult.getLocationId();
Log.d("checkPay", "onCheckoutResult: " + last4 + " " + locationId);
SquareClient client = new SquareClient.Builder()
.environment(Environment.PRODUCTION)
.accessToken("EAAAFANnrd7-Bfh_GvcyBcGxfEtykC7EQJ72Z2-hpYiGnoekY1TLtQYJKqagjkF6")
.build();
PaymentsApi paymentsApi = client.getPaymentsApi();
paymentsApi.listPaymentsAsync(
null,
null,
null,
null,
locationId,
null,
last4,
null,
null)
.thenAccept(results -> {
String name=results.getPayments().get(0).getCardDetails().getCard().getCardholderName().toString();
//String name="MAYFIELD/ SAMIR ";
if (name.contains("CARD") || !name.contains("/") || name==null){
PrefConfig.saveState(getApplicationContext(),8);
Intent intent=new Intent(getApplicationContext(),ContinuousMode.class);
startActivity(intent);
finish();
}else {
name=name.replace(" ", "");
String[] parts = name.split("/");
String firstName = parts[1];
String LastName = parts[0];
Character LastNameLetter=LastName.charAt(0);
firstName = firstName.substring(0, 1).toUpperCase() + firstName.substring(1).toLowerCase();
name=firstName+" "+LastNameLetter+".";
PrefConfig.saveTopListName(getApplicationContext(),name);
PrefConfig.saveState(getApplicationContext(),19);
Intent intent=new Intent(getApplicationContext(),ContinuousMode.class);
startActivity(intent);
finish();
}
})
.exceptionally(exception -> {
System.out.println("Failed to make the request");
System.out.println(String.format("Exception: %s", exception.getMessage()));
Log.d("paymentcancel", "onCheckoutResult: ");
PrefConfig.saveState(getApplicationContext(),8);
Intent intent=new Intent(getApplicationContext(),ContinuousMode.class);
startActivity(intent);
finish();
return null;
});
}else {
ResultError<CheckoutErrorCode> error = result.getError();
PrefConfig.saveState(getApplicationContext(),12); // initially 6 but 12 is working fine for all condition DO NOT TOUCH
Intent intent=new Intent(getApplicationContext(),ContinuousMode.class);
startActivity(intent);
finish();
Log.d("errorCode", "onCheckoutResult: " + error.getCode());
switch (error.getCode()) {
case SDK_NOT_AUTHORIZED:
goToAuthorizeActivity();
break;
case CANCELED:
Log.d("checkoutError", "onCheckoutResult: " + error);
break;
case USAGE_ERROR:
showErrorDialog(error);
Log.d("checkoutError", "onCheckoutResult: " + error);
break;
}
}
}
Thanks for providing the snippet. Where is this code called from? Which class?
CheckoutManager checkoutManager = ReaderSdk.checkoutManager(); checkoutCallbackRef = checkoutManager.addCheckoutActivityCallback(this::onCheckoutResult);
I have write the code inside the checkoutActivity
CheckoutManager checkoutManager = ReaderSdk.checkoutManager();
CheckoutParameters.Builder params = CheckoutParameters.newBuilder(checkoutAmount);
params.additionalPaymentTypes(AdditionalPaymentType.MANUAL_CARD_ENTRY);
//params.note(“Hello World!”);
params.skipReceipt(true);
params.noTip();
params.collectSignature(false);
params.allowSplitTender(false);
params.noNote();
checkoutManager.startCheckoutActivity(this, params.build());
Is this code located inside an onCreate()
method or onResume()
method of the CheckoutActivity
? Or some button click listener? If not, where? We want to understand the entry point that leads to the code you shared with us.
Do you see your code getting executed again right after the attempt to make a payment fails? As if it retries to make a payment? Logs we see on the device suggest that startCheckoutActivity
was called at least two more times after first attempt to make a payment failed. Was is a result of user interaction or a retry mechanism in your code?
The code is executed on tap of button.
Lets suppose i enetered the incorrect details , then app is stucked and kill the app and then goes to same screen and then onCheckoutResult method is called automatically without doing any operation and display the error message that “transacytion is already in progress”
There is no retry mechnism
Are you saying that payment gets stuck and never finishes with incorrect details? Meaning that you see a “processing” screen with a spinner that never closes?
What kind of incorrect payment details lead to this error? We want to try to reproduce it.