mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
bccc8790f0
no-issue This removes the logic to check if stripe connect is allowed into the stripe connect service, which makes the feature easier to maintain, as well as fixes the v3 API - which previously did not have this check.
30 lines
952 B
JavaScript
30 lines
952 B
JavaScript
const membersService = require('../../services/members');
|
|
|
|
module.exports = {
|
|
docName: 'members_stripe_connect',
|
|
auth: {
|
|
permissions: true,
|
|
options: [
|
|
'mode'
|
|
],
|
|
validation: {
|
|
options: {
|
|
mode: {
|
|
values: ['live', 'test']
|
|
}
|
|
}
|
|
},
|
|
query(frame) {
|
|
// This is something you have to do if you want to use the "framework" with access to the raw req/res
|
|
frame.response = async function (req, res) {
|
|
function setSessionProp(prop, val) {
|
|
req.session[prop] = val;
|
|
}
|
|
const mode = frame.options.mode || 'live';
|
|
const stripeConnectAuthURL = await membersService.stripeConnect.getStripeConnectOAuthUrl(setSessionProp, mode);
|
|
return res.redirect(stripeConnectAuthURL);
|
|
};
|
|
}
|
|
}
|
|
};
|