I'm working on a project that's using Sofort to accept payments. Sofort strong-arms me into adopting this paradigm:
- I send a request to Sofort, containing
a) my API-token (so that Sofort sends the captured payment to my bank account)
b) a user_variable. Here I just input my local UID of the the user who wishes to make a payment. This enables me to use my own local UIDs to cross-reference Sofort-payments with my local user database.
c) A notification_url, essentially a webhook URL which enables me to asynchronously listen to payment updates (pending, completed, rejected etc.)
Sofort then returns a URL which handles the entire payment process. I send this URL to the front-end where it's opened in a webview.
If my webhook then receives a "completed" notification object, it checks the user variable (my own local UID which Sofort forwards to the webhook, a key piece of functionality that makes this work. Don't know if Paypal has something similar), the amount, and credits that amount to the user.
In anyone's Paypal API experience, is it possible to create a PP data flow which at least rhymes with this paradigm?
Two keynotes:
- These are one-time payments. Not subscriptions.
- The actual under-the-hood logic is essentially a bank. There is a local registry of users, each with a UID and a balance. Any payment made by a particular user should be credited to their account.