mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-16 18:07:31 +01:00
WIP chargebee integration sketch
This commit is contained in:
@@ -130,9 +130,27 @@ SpacedeckUsers = {
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
create_user(name, email, password, password_confirmation, invite_code, function(session) {
|
||||
create_user(name, email, password, password_confirmation, invite_code, function(res) {
|
||||
this.creating_user = false;
|
||||
this.login_submit(email, password, null, on_success);
|
||||
|
||||
if (res.chargebee_checkout) {
|
||||
var chargebeeInstance = Chargebee.init({
|
||||
site: "spacedeck-test",
|
||||
enableRedirectMode: true,
|
||||
enableFriendbuyTracking: false
|
||||
});
|
||||
|
||||
chargebeeInstance.openCheckout({
|
||||
hostedPage: function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
resolve(res.chargebee_checkout);
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// user created, login
|
||||
this.login_submit(email, password, null, on_success);
|
||||
}
|
||||
}.bind(this), function(req) {
|
||||
this.creating_user = false;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user