- 👋 Hi, I’m @bigboss978 - 👀 I’m interested in ... - 🌱 I’m currently learning ... - 💞️ I’m looking to collaborate on ... - 📫 How to reach me ... <!--- bigboss978/bigboss978 is a ✨ special ✨ repository because its `README.md` (this file) appears on your GitHub profile. You can click the Preview link to take a look at your changes. ---> var gateway = new braintree.BraintreeGateway({ accessToken: useYourAccessToken }); var saleRequest = { amount: req.body.amount, merchantAccountId: "USD", paymentMethodNonce: req.body.nonce, deviceData: req.body.device_data, orderId: "Mapped to PayPal Invoice Number", descriptor: { name: "Descriptor displayed in customer CC statements. 22 char max" }, shipping: { firstName: "Jen", lastName: "Smith", company: "Braintree", streetAddress: "1 E 1st St", extendedAddress: "5th Floor", locality: "Bartlett", region: "IL", postalCode: "60103", countryCodeAlpha2: "US" }, options: { paypal: { customField: "PayPal custom field", description: "Description for PayPal email receipt" }, submitForSettlement: true } }; gateway.transaction.sale(saleRequest, function (err, result) { if (err) { res.send("<h1>Error: " + err + "</h1>"); } else if (result.success) { res.send("<h1>Success! Transaction ID: " + result.transaction.id + "</h1>"); } else { res.send("<h1>Error: " + result.message + "</h1>"); } });app.get("/client_token", function (req, res) { gateway.clientToken.generate({}, function (err, response) { res.send(response.clientToken); }); });
Popular repositories Loading
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.