Meteor: connect a Stripe user to an existing (GitHub-created) account
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I have a Meteor application with users that sign in with their GitHub account.

I want each user to be able to add Stripe authorization to their account -- by (I suggest) signing in with Stripe Connect from within their account settings page. It is essential that all users create their account with GitHub first (i.e. creating their account with Stripe alone is not an option).

The code I am looking for is to handle users connecting their Stripe account to their existing GitHub-created account within my application. The reason is I'm creating a marketplace and want payment to go straight to the users.

Will tip for thorough solutions.

--

FWIW, here's how the original user is being created:

Accounts.onCreateUser(function(options,user){
var accessToken = user.services.github.accessToken,
    result,
    profile;

result = Meteor.http.get('https://api.github.com/user',{
    params : {
        access_token : accessToken
    },
    headers: {"User-Agent": "Meteor/1.0"}
});

if(result.error){
    console.log(result);
    throw result.error
}

profile = _.pick(result.data,
    'login',
    'name',
    'avatar_url',
    'url',
    'company',
    'blog',
    'location',
    'email',
    'bio',
    'html_url'
);

user.profile = profile;

return user;
});
@cavill you should tweet @debergalis with a link to this bounty and make them aware of this bounty!
akshatpradhan over 5 years ago
@akshatpradhan Yeah I did that yesterday, though they haven't retweeted it.
cavill over 5 years ago
awarded to boloo

Crowdsource coding tasks.

1 Solution

Winning solution

This is not possible with the current version of Meteor