Open DowsingUK opened 4 years ago
You're not allowed to modify the text/verbiage on the receipt options page. You can add an option if you need but can't modify the current listings.
Do you have an example of how to add options? so far I can list the option but I haven't found a way to end the transaction...
`
List
currentTransaction.setAdditionalReceiptOptions(moreOptions, new TransactionContext.ReceiptOptionHandlerCallback()
{
@Override
public void receiptOptionHandler(Integer integer, String s, final TransactionRecord transactionRecord)
{
if(s.equals("Print"))
{
endCurrentTransaction()?
}
});
`
I'm confused as to what you're actually trying to accomplish. This functionality is meant to be able to add in additional options such as Print. If that was added, then within that method you would have APIs or methods that talk to your printer to print a receipt and then move to a different activity. If you simply want to close the receipt options page, you'd use the No Thanks option. Can you let me know exactly what you're trying to accomplish and I can help you with what to do?
Well I'm trying to accomplish 3 very common and simple tasks but as far as I know 2 of them are impossible to do with this RetailSDK 1. Signature Screen in Portrait mode, 2. Localization, so the only one it seems achievable is 3. Print and then close the receipt options page in the print finish callback I do not need to move to a different activity I just expect currentTransaction.setCompletedHandler to be call after Print has finished just want the same behaviour as if I'd use No Thanks option
So should I add the 3rd point to the list of impossible task to do with this RetailSDK?
I apologize as I've not had a chance to run any tests to see if the receipt options are functioning the way that they should. When you make the print call, in your example, does the receipt options page not close and return control to your app? You don't need to check the string since you're only adding the single button - unless there's an issue, that handler would be called as soon as that option is selected and then would return control back to your app.
It's not returning although it runs the print function but just get stuck at that receipt options page
I will need to run some tests and get back to you.
Ok thank you so much!
Any chance you have found something that helps me implementing the Print option?
I apologize but I've not had time to run any tests yet. I will hopefully get some time tomorrow.
Alright, I had to update Android Studio and that opened up a whole other set of issues but I finally got my environment up and running to run some test. The conclusion of the test is that the added receipt option simply gives you the opportunity to run some API (to a printer, etc) and then it's up to you to move along once your process is complete. If you'd like the code that I used for the Sample App, I can share that but you really have a couple options:
Can you please email pph-sdk@paypal.com with your business name, app name, and a simple business justification for wanting to suppress the receipt screen? I will respond there with the terms for you to accept.
currentTransaction.setAdditionalReceiptOptions(moreOptions, new TransactionContext.ReceiptOptionHandlerCallback() { @Override public void receiptOptionHandler(Integer integer, String s, final TransactionRecord transactionRecord) { if(s.equals("Print")) { endCurrentTransaction()? } });
Rtty
I've been trying to customize the receipt screen but I have no clue where to assign values, wherever I put some of the below sentences device freezes at beginPayment, would someone help me here please?
new ReceiptOptionsViewContent().title("You Paid $1.23"); new ReceiptOptionsViewContent().message("Payment"); new ReceiptOptionsViewContent().setPrompt("Would you like a receipt for this purchase");
new ReceiptEmailEntryViewContent().title("Send Email"); new ReceiptEmailEntryViewContent().sendButtonTitle("Send it now!");
new ReceiptSMSEntryViewContent().title("Send Text Message"); new ReceiptSMSEntryViewContent().sendButtonTitle("Send it now!");
And how can I modify this?
skipReceipt Booleans { "skipping": true, "charityEnabled": true }