Created
June 21, 2020 11:08
-
-
Save ademcan/a2e86c7eaa6936aad78ff5f7a3f47929 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post('/createStripeCustomer', function (req, res) { | |
var stripe = require("stripe")(stripe_sk); | |
var payment_method = req.body.payment_method | |
var name = req.body.name // optional | |
var email = req.body.email // optional | |
// This creates a new Customer and attaches the PaymentMethod in one API call. | |
stripe.customers.create({ | |
payment_method: payment_method, | |
name: name, | |
email: email | |
}, function (err, customer) { | |
res.json({ | |
customer: customer.id | |
}) | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where I am now:
Subscription created with status "incomplete".
So what I have to do is to convert this code to react-native (objective C)