Giter Club home page Giter Club logo

Comments (8)

wsbrunson avatar wsbrunson commented on September 23, 2024 1

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.

olfek avatar olfek commented on September 23, 2024

@gregjopa do you know how to do this? 🙂

from paypal-js.

olfek avatar olfek commented on September 23, 2024

The workaround I'm using for now is to save subscriptionID and then use actions.subscription.revise when subscriptionID exists.

from paypal-js.

olfek avatar olfek commented on September 23, 2024

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.

gregjopa avatar gregjopa commented on September 23, 2024

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.

olfek avatar olfek commented on September 23, 2024

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.

olfek avatar olfek commented on September 23, 2024

I think I'll continue using this workaround #390 (comment) for now

from paypal-js.

olfek avatar olfek commented on September 23, 2024

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).

https://stackoverflow.com/questions/28586586/get-paypal-sandbox-to-remain-signed-in-for-longer-than-5-minutes

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.

@gregjopa

from paypal-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.