Dismiss Google payment sheet - google-tasks-api

I have unique business logic requirement where I need to cancel or stop user from proceeding with Google pay if timer that is running in the background runs out.
Suppose user clicked Google pay button, then we use
AutoResolveHelper.resolveTask<PaymentData>(futurePayTask, this, LOAD_PAYMENT_DATA_REQUEST_CODE)
This should return onactivityresult if user performs cancel or success but I want to forcefully cancel if timer runs out.
Google sheet open as shown here:

I will post my answer after discussion with official google pay team, they told its not possible, so I myself just put one alert dialog before showing payment sheet informing user to finish transaction within stipulated time

Related

PayPal window is not closing and onApprove is not called

I had a working PayPal flow for buying subscription using PayPal buttons. User had to click the button, PayPal window opened, after filling all the data, PayPal window disappear, onApprove hook was fired and I can handle the rest in my code.
But for few days, flow changed, and now, when user enters correct data, PayPal windows is not closing by itself, but showing information what user bought, who is the seller, how to remove subscription. onApprove hook is not fired, so I can't handle the result. All user can do, is close popup by himself, but then onCancel hook is called, instead onApprove.
Payments are proceeding correctly, following webhooks are handled by backend etc. I just don't know what happened to my onApprove hook.
It was a paypal bug which has now been fixed

Paypal Cancelation - Recurring Payment

I have googled this for a while and I don't think I was able to get a clear cut answer.
We have an application that displays a Subscribe button. Once clicked, It takes the user to the Paypal website where s/he can complete the txn.
Later on, Paypal sends an IPN to our site indicating whether payment was successful. This integration is done by setting hidden html variables.
Now, there is a need to allow the user to cancel their subscription. So far, most of my readings indicate that the user must login to paypal and manage his/her subscription there.
In addition to that, I was able to find some other people mentioning that It would work with using CreateRecurringPaymentsProfile.
The problem is that the later requires ProfileId which is returned thru CreateRecurringPaymentsProfile. it looks like there is a gap. I would appreciate if somebody can pinpoint to the right direction.
Thanks,

Paypal subscription button. upgrade subscription amount

I am using paypal subscription button. if there is any method so that if user want to update his/her subscription amount after some time how could this achieve.
And how user can cancel his/her subscription ?
You can use a modify button to update the subscription. If want to cancel the subscription, you as the merchatn can cancel this or the buyer can cancel this as well. You can find more on using the modify and cancel features for subscriptions here. If your subsriptions start with I- instead of S-, you can also use the ManageRecurringPaymentsProfileStatus API to cancel the subscription as well.

Paypal Standard - time limit

I am sending customers to Paypal using Paypal Standard and a classic html form.
I need to ensure that customers pay within 10 minutes.
I was hoping to fund a variable that wold allow me to set a datetime beyond which the transaction could not be accepted any more by Paypal.
I went through the variables at
https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
I did not find anything
Does anybody know how to set such a time limit?
Thank you
There is not a variable within the PayPal button variables that allows you to set a time limit on how long the buyer has to pay. The only thing that may be close to working for you, and this would also depend on how many buttons you will be creating and having at one time would created hosted buttons on the fly when they are ready to pay. You could use the BMCreateButton API to create the button. Then have your system generate the code on your website so that the buyer can click the button. When the button is created, store it in a database along with a time stamp. Then set your set up to run a cron job every so often, checking the time stamp. If the time stamp is outside of the period of time that you are wanting the buyer to be able to click the button, have your system use the BMManageButtonStatus API to delete the button from your account. This will then prevent the buyer from clicking on it and making a payment with the button.

In-App purchase , Cancel the purchase because of long processing time

I was implementing In-App purchase to my game and its working fine. No problem with the purchases and other stuffs. But today i was stuck at a weird point.
When the user tries to purchase , sometimes it takes more than a minute to get respond from Apple. (Sandbox environment).
What i want to do is just to put a cancel button in an UIAlertView , which will help the user to cancel the whole purchase. So the user can cancel the purchase, if there is a delay in Sandbox respond. How can i do this ?
I already have a UIAlertView which starts with the purchase button click and ends with the SKPaymentTransactionStatePurchased method. I want to add that cancel button to that alertview.
Confused and here is my question in short again ,
But what is the method should be called to cancel the whole In-App processes while it is on the SKPaymentTransactionStatePurchasing state ?
You cant interrupt the request once it sent. You should wait until Apple responds.