PayPal Sandbox subscription webhook response not getting - paypal-sandbox

I'm trying to get notified via webhooks when a simple payment is made and subscription, however I don't receive any request from paypal on the specified URL. Here is what I've done:
I have 2 sandbox accounts: Facilitator and Buyer
Create an app (sanbox mode) for the facilitator account
Add a webhook URL in that app
Login into sanbox.paypal.com with the sandbox facilitator username and password
Get payment through express checkout and customer also agree for subscription
Received success response from PayPal
Prepare query string to create subscription for that customer and send data through REST Api
Received response from PayPal related to subscription.
When I login to business account or Facilitator account, I can see bot payment and subscription transaction but the webhook page on my server is not called.
Also if I go to Developer Account -> Webhook Notifications and select the app I have this message: You don't have any events for the selected application
NOTE: If I add the URL in the webhook simulator everything works great.
Am I doing something wrong?
Thanks

You can try to add "All events" for your webhook endpoint.
Then check if you received anything after completing your order in Developer Account -> Webhook Notifications.
If you still get nothing there, consider cross checking your clientId + secret that you use while creating your order.

Related

Firebase Auth subscription

I'm working on a app which uses Firebase Auth to signup and login, but I'm facing some things which I don't know how to start. Users need to registrate on a website and they need to pay a subscription before the user is created in firebase, when they don't pay anymore, the user account should be disabled. So basically, users registrate on the web and after they pay, they can log into the app with their credentials.
Edit:
Since yesterday I'm trying to implement either mollie or stripe, but I can't get myself started, online there are very few video's about payments in combination with firebase
There are basically two ways off the top of my headto do this:
A) Secure but it involves cloud function and creating custom authentication token to login.
User registers with email.
User keys in login information and posts to cloud function.
Find user's uid/email and check for password.
Fetch the subscription document and check if it is active.
If it is inactive, return an error message accordingly.
If it is active, create an authentication token and return to user to login.
B) Client side checking, less secure but will do the trick.
User logins
Fetch subscription using user's uid. Check its validity
Force redirect user to subscription page if it is inactive with
error message. OR Autologout user if it is inactive with error message.
May I also suggest Stripe for their subscription service (Not sponsored)? Unless you already have an implementation in place.

MFP 8 Push Notification to Particular USER ID

Trying to send Push Notification based on DEVICE_ID, In MFP 8 Console, My device ID is showing under DEVICES section but if i try to send notification, Console throws error as "An error occurred while the notification was sent. Internal server error. No devices found."
Scope - push.mobileclient
Initialize, isPushSupported and then RegisterDevice is triggered and in logs, it shown the token as well. how to resolve ?
Device registration showing up in the Devices console does not mean that push registration is successful. Even if push registration is complete, it will depend entirely on the application logic that there is a user identity associated with the subscription.
When you attempt to send notification by userid and it says "No devices found", this means that there are no subscriptions against this userid. It is possible there is no subscription at all , or the subscriptions have been made against a different user - or even anonymous user.
Use get push registrations and get push subscriptions REST calls to verify your current registration and subscription. If these are with anonymous user identity verify your scope -> security check mapping and your application logic.

Waiting for Paypal Payment Notification ASP.NET

I am implementing an ASP.NET web app where the user will fill an application that spans over multiple steps/Pages, with previous/Next buttons on each page to navigate back and forth to each step.
On the second step/page, I have a paypal payment button, so the user can pay for the services they selected on the first page.
My requirements is to wait for the user to pay with paypal and get the notification that a payment was received then navigate to the next page automatically. The user should not be able to proceed without payment.
The paypal payment button opens a new window with paypal site where the user makes the payment.
I looked at Paypal IPN (Instant Payment Notification), Paypal can send the notification to a service on the back-end in the web app, but how can I forward the user to the next page once this notification is received, since this service is not tied directly to the page that the user has opened on his browser?
The one way I am thinking to do is to store the payment in some table with the userid and a unique code and have a javascript function with setInterval(checkPayment, 5000); so every 5 seconds, it calls a service to check if there was a payment and forward the user.
Is there any better solution ?
Better solution is to NOT involve IPN in your checkout flow. As stated:
Because IPN is not a real-time service, your checkout flow should not wait for the IPN message before it is allowed to complete.
REF: https://developer.paypal.com/docs/classic/products/instant-payment-notification/
Paypal has an extensive API that handles your flow - e.g
Express Checkout
REST

Silent payment using paypal without redirecting to paypal url

Is there a way I can pass the sellers credentials to the Paypal API and it can make a transaction without taking him to Paypal URL?
TL. DR.
I am trying to build an eCommerce website for a shop with Paypal as the payment medium. The payment for user has been implemented where he is redirected to the Paypal website and he can purchase an item. But under certain conditions he is allowed to cancel his purchase and his payment must be credited back to him.
I need this transaction to happen without navigating to the Paypal URL.The reason is that, the buyer is the one initiating the transaction. So there is no way he can authorize a transfer from sellers to buyers account. The buyer should be able to press the "Cancel Order" button and the payment should be immediately credited back to his paypal account.
I can store the sellers credentials in the server and send it to the API which should be able to authorize him but I was looking for an API which Paypal provides to make this happen.
My requirement is different from the anser provided in this question as here they still show a popup of paypal webpage.

PayPal asynchronous notification

Now information about the successful transaction I get with a redirect the user back to my site from paypal. And then I make additional requests to api paypal.
But if the user cancels the redirect to my site, for some reason, I do not get the information about the transaction.
Is there an asynchronous notification from Paypal for Website Payments Standard or Express Checkout?
Instant Payment Notification (IPN) works for all payment methods through PayPal. The Developer.PayPal.com document you linked is a list of variables for the Express Checkout feature and it is telling you that you can only pass the NOTIFYURL variable successfully in the DoExpressCheckoutPayment API call.
In Payments Standard transactions you'll use the notify_url variable.
You can also just enable IPN within your account to have an IPN post sent to your notification page when any payment completes - regardless of whether or not you define a URL in the button code or API request (the URL you define in the code will always override what is set in your account).

Resources