Google transactions is waiting for userInput and then leaves the conversation - google-pay

I am trying to create an action for the google assistant using google transactions, when I take it out of Development Sandbox to allow real orders and transactions, it will prepare the order and the receipt. Then it is supposed to check if the order will be accepted or rejected and wait for the user to say that they want to make the order, however, it waits for the user but then closes the action straight away and doesn't let the user input anything.

Related

A good way to check if the payment form was left off in between

We use PayPal to accept donations on our website. The problem we're facing is usually this happens that a user clicks on the pay button on our website but then for some reason drops from PayPal.
Is there a way through the PayPal API we could check that the user for some reason left off the transaction or maybe his transaction was denied.
No there is not; keep track of that drop off yourself if they don't come back or you don't get a resulting transaction.
If you are not using an API to accept the donations, then to be notified of resulting transactions you can use Webhooks. A parameter you can use for reconciliation is custom, which can be set at the moment the user clicks 'Pay' and you redirect them to PayPal.
(But if you are using an API, then the API is your notification already)

Instant app and GDPR

I imagine that even instant apps must be compliant with the GDPR and then show the privacy policy and ask the user for explicit permission to profiling and processing data.
Do I have to show the views needed to ask user consent every time the instant app is opened?
Is there a way to persist the data the first time so as not to show the screens all the other times?

Mixpanel user tracking- track registred user from different device

I am using mixpanel user profile tracking.
1 : If a new user, say A , visit my site and go through some pages without sign-up. That time mixpanel is tracking events to a unknown profile.
2 : Then the user A, sign up in my site and placed an order.
That time mixpanel is tracking previous events and the events after sign up also to a the same profile. (mentioned in above point).
3 : Then the user comes to my site using his mobile, then he go through the pages without login
That time mixpanel track the events to different a profile.
4 : The user then logged in in his mobile and continue to place order.
Then the mixpanel track events after the login into the previous profile mentioned in the 1st and 2 nd step.
My problem is I would like to re-map the tracking done in the 3rd step also to the profile which is used to track in 1st and 2nd step
There are 2 routes
1-) Queue anonymous events: the idea would be that instead of sending Mixpanel the events when the user is still anonymous, you save them either on the device (if it's a mobile app) or on your server. Then, when the user logs in, or creates the account, you can flush the stored events since now you know who the user is. As you might realize, the downside is that if the user never logs in or signs up, then the events are never sent (unless you build a mechanism in your server to flush them in that case).
2-) You could so as you currently do, but when the person goes to step 4, and logs in, before changing the ID to the correct one, you could create a People profile with the anonymous ID, mark it with a flag that it's an orphaned profile, and save the correct ID for it. That way, you can schedule a task to look at those profiles every so often, export their events, and import them back with the correct ID. That would essentially duplicate the data for those events, but you would have the full history with the correct ID. You could also try to filter events based on the "orphaned" flag later on, but it does mean you will always have to have it mind.

Is this processus to pay a user, reliable and safe?

I'm working on a project that require my application to pay the user to his paypal account when he asks it.
Here's how I did it so far:
The (logged) user goes to the Pay page that will list all his Payments (received or not)
He enters his Paypal email and his application (mine) password (for security)
The POST page get a list of all the Payments that have status="UNPAID" for that user and update the status to "WORKING" (to avoid the user to refresh the page before the whole process is done and resend the same amount of money)
We count the total amount to pay in that list (a simple for)
The amount is sent to Paypal via Paypal Adaptive Payment API (request: PAY)
The response is checked, if completed, the list status is set to "COMPLETED", if not, the list is reverted to "UNPAID" (the SQL update is made via a WHERE id IN(x, y, z) in case a second Payment request has been made during that time.
A message is then displayed to the user
But I need your help, I'm in front of one risky problem I'd like to avoid, and I would know how you would do:
If the user hit refresh on the process page, I don't want to send him twice (or more) the amount (The "WORKING" lock is here for that, but what happens if the user hit refresh before I set the lock ?)
Rare possible: what happens if the user hit f5 after the lock "WORKING" is made, but before the request to paypal, and a new payment is received. By following what I did, just one item (the new) would be get and set to WORKING, but all others previous payment would be losts
How would you do? What is the best way to make it to be 100% reliable?
Thanks for your help
Note:
The steps between 4 to 6 is made via a PlayFramework jobs, called with now() and awaiting() the result
you can:
prevent double post via JQuery
use the checkAuthenticity() method to validate the request
do a GET redirect after processing the POST (so they can't submit the same 2 times even by mistake)
do the payment processing asynchronous (see below)
For the payment, instead of calling the job, set the id's of payments in a queue (or table in the database) and a job that runs once per minute that processes that table if it has some data. When the user does the POST you redirect to a page that says that you are processing the payments and will notify if there is some issue. You can notify the user later via a UI warning using comet or via mail.
That way you don't link the request to the processing, and you won't have threading/racing issues, as well as being able to detect stale requests (payments already done) if you do a sequential processing.

How to solve the problem of not being informed of successful payments by the 3rd party system used by my website?

I have a subscription based website that interacts with a 3rd party system to handle the payments. The steps to process a new subscriber registration are as follow:
The subscriber enters his/her details in the subscription form and click on the submit button.
Assuming the details specified are valid, a new record is created in the database to store these details.
The subscriber is then redirected to the website of the 3rd party system (similar to paypal) to process the payment.
Once the payment is succesful, the 3rd party website then redirect the subscriber back to our website.
At this time, I know that the payment was succesful, so the record in the database is updated to indicate that payment has been made successfully.
A problem that I have found occurring quite often is that if a subscriber pays but does not complete the process correctly (e.g. uses the back browser, closes the window), his/her record in the database doesn't get updated about this. Accordingly, I don't know if s/he has paid by just looking the record and need to wait for the report from the 3rd party system to find this out.
How do you solve this problem?
PS. One of the main reasons to store their details into the database before the payment process is done is so they can come back to complete the payment without re-entering their details again. For example, when their credit cards were rejected by the 3rd party system and they need to sort this out with their financial institution which may take a while.
The third-party payment system should inform you of the successful transaction regardless of what the user does.
For example, in PayPal, an IPN (instant payment notification) is sent to your server as POST data to a URL that you specify. Your server then verifies with Paypal that the transaction is genuine, and if so, updates the database record to indicate the subscription is valid. At a point in the future, PayPal may or may not then redirect the user back to your website. (The "may not" can occur in cases such as the user closing their browser, hitting Back, or jumping to a new URL)
Note that this "conversation" between Paypal and your server is independent of the user's session - it is a "private conversation" between you and PayPal about that user's transaction.
Obviously there can be communications outages and server failures, so if Paypal does not get the validation request from your server immediately it will periodically send retries to your server to ensure that the transaction is eventually completed.
If your payment system doesn't have at least some basic mechanism for ensuring transaction reliability, then choose a different provider. Chances are that they do, but you will have to implement things correctly on your server to be sure that the system works properly.
P.S. It is quite normal to require a user to log in (and thus be registered in the database) before they initiate any financial transaction. You need to gather all the relevant information before they go to purchase, as after the purchase you have no way of guaranteeing that they will return to you to provide any further information.