Coder Social home page Coder Social logo

Comments (2)

anorsich avatar anorsich commented on June 24, 2024

As I know to pay to someones email you have to use paypal adaptive payments which is not yer supported by paypal rest. To achieve what you want you have to use paypal classic sdk -> https://github.com/Ideame/paypal-adaptive-sdk-nodejs.

Here is sample implementation:

var config = require('./../../config');
var Paypal = require('paypal-adaptive');

var paypalSdk = new Paypal({
    userId:    config.paypal.classicApi.userId,
    password:  config.paypal.classicApi.password,
    signature: config.paypal.classicApi.signature,
    sandbox:   config.paypal.classicApi.isSandbox
});

function withdraw(amount, userEmail, callback) {
    var payload = {
        requestEnvelope: {
            errorLanguage:  'en_US'
        },
        actionType:     'PAY',
        currencyCode:   'USD',
        feesPayer:      'EACHRECEIVER',
        memo:           'Memo goes here',
        cancelUrl:      "http://fake.com", //we no need cancel url for withdrawals from our account
        returnUrl:       "http://fake.com",//we no need return url for withdrawals from our account
        senderEmail:    config.paypal.email,
        receiverList: {
            receiver: [
                {
                    email:  userEmail,
                    amount: amount
                }
            ]
        }
    };

    paypalSdk.pay(payload, function (err, response) {
       callback(err, response);
    });
}

from paypal-pay.

ogt avatar ogt commented on June 24, 2024

Hi @anorsich , and thank you for your reply.
I guess there is not much difference between using the rest and the sdk modules... I liked the rest modules, because they didn't require the passing of userId/password as part of the setup - but using the classic sdk would be just fine as well (not sure what is the signature parameter that is required in the sample code you have pasted).

So, are you interested to do the project?

I understand that there is little to be done yet beyond the sample implementation you have pasted above, still if you are interested I can pay you $100, via the odesk contract, and you will do all the necesary work so as the corresponding module is "npm ready". (and answer any question I might have regarding its use)

Also, there are also a couple more similar node modules that I need, that I would rather someone owning the implementation - and I prefer to keeping them open source

Finally, how did you find this - I don't see you as a candidate in the odesk job...

from paypal-pay.

Related Issues (4)

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.