ApplePaySession.canMakePaymentsWithActiveCard not working in private mode - applepay

I have implemented Apple Pay on my website. If the payment method is configured it shows 'Checkout with Apple Pay' and if the payment method not configured then it shows 'Setup Apple Pay'.
I am using ApplePaySession.canMakePaymentsWithActiveCard() to check if the payment mode is configured or not.
This implementation is normally working correctly on Safari.
But when I run the application in Private (incognito) mode, it does not work as expected.
In Private mode ApplePaySession.canMakePaymentsWithActiveCard() always returns true irrespective of whether Payment Method setup is done or not. So it always shows me 'Checkout with Apple Pay'.
Any Suggestions, please?

Related

Custom google home action should always reconnect to get it working

i have a custom google home action implemented as described in the documentation (Oauth2 setup, sync, execute, etc... setup) and all works as expected on my Google home app and my google home physical devices.
Now, every now and then i need to reconnect the app in the Google Home App because it seems the app cannot reach my devices after some time. I checked my Oauth server if the refresh tokens are working ok and they do. Also my access token expires after 20 minutes and me reconnecting to the app should be done after some hours so the refreshing works in my opinion.
Now, are there any restrictions in using the TEST of the google home action?
The case i wrote is specific for personal use (intergration with personal server and domotica system) so i am actually not planning on releasing it, I just want to use it for myself. Is this allowed? Can i just leave my action in 'test' forever for such purposes?
EDIT: 18/05/2022: custom actions still working flawlessly after 6 months in test :-)
EDIT: 02/02/2023: custom actions still working flawlessly in test :-)
Additional question:
If i have to submit the app for release, i cannot meet the expectation in implementing state report as i have no control over the usage of buttons pressed at my home domotica. Is State Reporting also accepted when i report the state of my devices over time (let's say, every hour?)
tnx
EDIT:
So it seems there is something wrong with my refreshing of the tokens but i don't know what. When i try through postman, all works as expected, in stackdriver logs i see this :
jsonPayload: {
#type: "type.googleapis.com/google.identity.accountlinking.type.AccountLinkingError"
errorReason: "Failed to get response from 3P. 3P returned malformed response like invalid response code or un-inflatble body."
request: {
body: "grant_type=refresh_token&refresh_token=REDACTED_VALUE&client_id=qbusauth&client_secret=REDACTED_VALUE"
method: "POST"
uri: "https://******.azurewebsites.net/token"
}
sessionId: -1039956344
step: "REFRESH_ACCESS_TOKEN"
If you don't plan to submit your Action for release, you'll just need to occasionally re-enable device testing through the console.
To minimize the number of query intents to your fulfillment, you should implement Report State and proactively send device states to update HomeGraph. You would have to implement this if you decide to release your Action.

Changing policy name on device didn't remove old policy apps from the device

When I change the policy name firstpolicy to secondpolicy on the device, the patch API response is 200 ok and it removes apps of first policy to apps of second policy from the play store app, but it did not remove them from the device. It still shows apps of the first policy.
I am using an update mask.
Testing fully managed device
Any help appreciated.
The stack overflow thread at Android Device Policy sync does not work until done manually mentions a reboot will force apply a policy, which isn't ideal but it does at least ensure a policy is updated. I'm also testing a fully managed device.
https://developers.google.com/android/management/reference/rest/v1/enterprises.devices/issueCommand details the standard for sending a command to a device. You can test it against live data with the API explorer on that page, so navigate towards the bottom of the page where it says 'Request Parameters' -> 'Name', and put in your enterprise & device ids of the form 'enterprises/your-enterprise-id/devices/your-device-id'. Then go to 'Request Body' and use the '+' sign to add 'type' : 'REBOOT' as a parameter. Press the execute button, in which you will be prompted to choose an account for OAuth2.0. After this, you will see the results, and if successful (returns a 200 code), it will issue the reboot command, with the policy being updated after rebooting.
To reiterate, I know this isn't ideal, but it at least does do an update, so just providing that info.
Good luck and let me know if everything worked out.
It may take a while for the policy to sync and apply any changes, including removal of apps. You can force sync by opening the Android Device Policy app and touching the sync button. The other way is to issue a reboot command to the device to make sure that the new policy is applied. You can check the issueCommand method for more information.

Local receipt doesn't get updated after (automatically) renewing a subscription

I have an app that uses in-app purchases (IAP), specifically auto-renewable subscriptions.
Occasionally it seems that, when a subscription automatically get renewed, the local receipt doesn't get updated automatically. As a result, checking locally if an active subscription is available results false. Performing the same validation remotely (using Apple servers) returns true.
How and when is the local stored receipt updated or is this something that can only be triggered manually? If so, does this need to happen using SKReceiptRefreshRequest or SKPaymentQueue's restoreCompletedTransactions? Based on Apple's documentation the former seems to be the way to go:
A request to refresh the receipt, which represents the user's transactions with your app.
Unfortunately, this fails, perhaps because it thinks there's noting to update? However there is: as the local receipt is outdated as it doesn't contain the renewed subscription status.
I want to ensure I'm doing things correctly and this behavior (that again happens occasionally) is not something on Apple's end.
Thanks for any feedback.

Magento-paypal payflow-pro- test credit/debit card works with live mode

I have configured Paypal Pay-flow Pro, and live mode is set, but when I use test card details for any card type then it accepts it and successfully checks out.
When I have set Payment Action -Authorization in admin payment settings then it works fine, but not when Payment action will be Sale.
CC.php from model file of payment has been overwritten and changes are below :
$info->setCcCidEnc($info->encrypt($info->getCcCid()));
This line is uncommented in prepareSave() function.
What is the exact issue here, I am unable to trace it!
I have got response from paypal support team and they had an issue whereby some of the processed transaction is not appearing in their PayPal account.
their developers fixed it and it's working properly now.
I am posting answer so it may help someone in future.

iOS9 in-app purchase error code changed for user cancellation?

On iOS8, in my app (which is working fine), if the user is not logged in with their Apple Id, and they attempt an in-app purchase, they get the following Apple alert:
Now, if the user presses "Cancel",in the code, we get an error code 2 with the SKPaymentTransaction. This has the enum code SKErrorPaymentCancelled
On iOS9, in the same situation, we now get error code 0,
Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store"
UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}
This has enum code SKErrorUnknown, which doesn't seem useful.
Anyone else run into this? The difficult here is in my app UI. If I get an error code, SKErrorPaymentCancelled, I don't present any info to the user as it is clear that the user has explicitly done a cancellation.
With SKErrorUnknown, I can't tell what has gone on, so I present an error alert to the user. Which, if they have explicitly cancelled, is just annoying. Thoughts?
May be :
Your app is enabled only for other location, test user was localized for other - and with this setup does not work. You should enabled the app for USA and created a test user localized in USA and it seems to work (no code change at all). And I think that proves that the code is ok, just the apple sandbox has some problems with non USA test users.
And don't login from settings. When this login form comes from your app, try it.

Resources