Node.js 接受没有网站的贝宝付款

Node.js 接受没有网站的贝宝付款,node.js,paypal,paypal-rest-sdk,Node.js,Paypal,Paypal Rest Sdk,我没有一个网站,我想只发送一个链接给用户,并得到适当的回应,无论他们是否支付贝宝网站和处理其余 基本上我不想将用户重定向到任何地方 配置我的PayPal凭据后,我有以下几点 var create_payment_json = { "intent": "sale", "payer": { "payment_method": "paypal" }, // I WANT TO REMOVE THAT BUT IF I DO I GET AN ERROR

我没有一个网站,我想只发送一个链接给用户,并得到适当的回应,无论他们是否支付贝宝网站和处理其余

基本上我不想将用户重定向到任何地方

配置我的PayPal凭据后,我有以下几点

var create_payment_json = {
    "intent": "sale",
    "payer": {
        "payment_method": "paypal"
    },
    // I WANT TO REMOVE THAT BUT IF I DO I GET AN ERROR IN RESPONSE
    "redirect_urls": {
        "return_url": "http://return.url",
        "cancel_url": "http://cancel.url"
    },
    "transactions": [{
        "item_list": {
            "items": [{
                "name": "item",
                "sku": "item",
                "price": "1.00",
                "currency": "USD",
                "quantity": 1
            }]
        },
        "amount": {
            "currency": "USD",
            "total": "1.00"
        },
        "description": "This is the payment description."
    }]
};


paypal.payment.create(create_payment_json, function (error, payment) {
    if (error) {
        throw error;
    } else {
        console.log("Create Payment Response");
        console.log(payment);
    }
});

var paymentId = 'PAYMENT id created in previous step';

//check if user payed or not
paypal.payment.execute(paymentId, execute_payment_json, function (error, payment) {
    if (error) {
        console.log(error.response);
        throw error;
    } else {
        console.log("Get Payment Response");
        console.log(JSON.stringify(payment));
    }
});