Comments (8)
hi @olfek, I'm going to go ahead and close this issue since your original question was answered. If you are still having problems with the sandbox environment, please don't hesitate to open a new issue. Thanks!
from paypal-js.
@gregjopa do you know how to do this? 🙂
from paypal-js.
The workaround I'm using for now is to save subscriptionID
and then use actions.subscription.revise
when subscriptionID
exists.
from paypal-js.
If the user reloads the page, the saved subscriptionID
will be lost and a new duplicate subscription will be created.
PayPal-Request-Id
can be made constant across sessions by using the users details.
from paypal-js.
Hi @olfek, my recommendation is to create the subscription on the server. That way you can pass the paypal-request-id with the api call and persist the subscriptionID and paypal-request-id together on your back-end. The actions.subscription.*
helpers are only there for people that do not have server-side code. Ex:
// create the subscription on your server and return the id https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_create
paypal.Buttons({
createSubscription: function() {
return fetch('/your-server/subscription/create/', {
method: 'post'
}).then(function(res) {
return res.json();
}).then(function(subscriptionData) {
return subscriptionData.id;
});
},
from paypal-js.
hi @gregjopa unfortunately I can't do that, at this point in the flow, I don't have a record of the user in the db where I can save their subscription ID for future reference.
the flow is:
sign up form + paypal subscribe ➡️ create user record
from paypal-js.
I think I'll continue using this workaround #390 (comment) for now
from paypal-js.
This is unrelated to this issue, but I don't know where else I can report it, PayPal keeps logging me out every few minutes (and requires 2FA again).
Could you perhaps forward this internally to someone relevant? It's making PayPal integration and testing much harder than it should be, I'm actually considering switching to Stripe because of it.
from paypal-js.
Related Issues (20)
- [Bug] Paypal Modals hidden behind <dialog> modals HOT 1
- [Bug] npm homepage link returns 404
- [Bug] Typescript warning: `resetOptions` cannot be used in dispatch type HOT 1
- [Bug] Error: zoid destroyed all components - when using the messages component in dev mode
- [Bug] PayPalCardFieldsProvider does not render component HOT 3
- [Bug] Paypal Button Click opens Overlay to login and an empty Popup HOT 8
- [Feature] paypal javascript sdk
- How to specify tax, product quantity and other info in product_units HOT 1
- [Bug] PayPalButtons onShippingAddressChange not able to update shipping costs
- [Bug] React-JS Paypal Button Isn't Working in Production for iOS 17 Safari HOT 7
- [Feature] Feature request credit card button as a popup
- Added functionality to test negative response
- PayPal Checkout Button Opens in Same Frame on Firefox iOS
- [Bug] Getting 500 Unhandled api error in cartid API for subscriptions HOT 20
- [Feature] Feature request
- [Bug] Bug report
- Uses deprecated APIs UnloadHandler HOT 2
- [Bug] Console flooded with cookie warnings on PayPal component rerender HOT 1
- [Bug] What does .submit do? What can it return/what errors can it throw? Astounding lack of documentation HOT 7
- Cannot read properties of undefined (reading 'startsWith') HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paypal-js.