Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions app/adapters/stripe-auth.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/components/stripe-connect-button.js

This file was deleted.

6 changes: 0 additions & 6 deletions app/models/stripe-auth.js

This file was deleted.

57 changes: 0 additions & 57 deletions app/routes/oauth-stripe.js

This file was deleted.

16 changes: 4 additions & 12 deletions app/routes/project/settings/donations.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,43 +44,35 @@ export default Route.extend(CanMixin, {
* Returns a promise hash, meaning hooks that follow the model hook will wait until
* all promises in the hash resolve
*
* @return {RSVP.hash} A promise hash consisting of a project and a stripeAuth record, once resolved
* @return {RSVP.hash} A promise hash consisting of a project, once resolved
*/
model() {
let project = this.modelFor('project');
// need to try and fetch an existing account
// TODO: We could consider just returning a hash of all 3 requests,
// but this way, we don't do a Stripe.Auth request if we already performed a connect
return get(project, 'organization.stripeConnectAccount').then((stripeConnectAccount) => {
if (stripeConnectAccount) {
// there is an existing account, no need to init the stripeAuth
return RSVP.hash({ project, stripeConnectAccount });
} else {
// there is no existing account. need to do stripeAuth and render connect button
let stripeAuth = get(this, 'store').queryRecord('stripe-auth', { projectId: project.id });
return RSVP.hash({ project, stripeAuth });
}
});
},

/**
* An Ember.Route hook
*
* Assingns the project and stripeAuth models as
* Assigns the project and stripeConnectAccount models as
* controller properties.
*
* If the project has no donation goals, initializes a new record.
*
* @method setupController
* @param {Ember.Controller} controller
* @param {DS.Model} modelHash.project The currently loaded project
* @param {DS.Model} modelHash.stripeAuth The stripeAuth record, for the current project
*/
setupController(controller, { project, stripeAuth = null, stripeConnectAccount = null }) {
setupController(controller, { project, stripeConnectAccount = null }) {
if (project.get('donationGoals.length') == 0) {
controller.send('addDonationGoal', project);
}

controller.setProperties({ project, stripeAuth, stripeConnectAccount });
controller.setProperties({ project, stripeConnectAccount });
}
});
2 changes: 0 additions & 2 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
@import "components/organization-header";
@import "components/organization-members";
@import "components/pager-control";
@import "components/stripe-connect-button";
@import "components/task-card";
@import "components/task-comment-list";
@import "components/task-details";
Expand Down Expand Up @@ -83,7 +82,6 @@
@import "components/user-skills-input";

@import "templates/about";
@import "templates/oauth-stripe";
@import "templates/project/index";
@import "templates/project/thank-you";
@import "templates/project/settings/contributors";
Expand Down
168 changes: 0 additions & 168 deletions app/styles/components/stripe-connect-button.scss

This file was deleted.

41 changes: 0 additions & 41 deletions app/styles/templates/oauth-stripe.scss

This file was deleted.

10 changes: 0 additions & 10 deletions app/templates/oauth-stripe-loading.hbs

This file was deleted.

10 changes: 0 additions & 10 deletions app/templates/oauth-stripe.hbs

This file was deleted.

9 changes: 0 additions & 9 deletions app/templates/project/settings/donations.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
{{#if stripeConnectAccount.isReloading}}Refreshing...{{else}}Refresh status{{/if}}
</button>
{{/if}}
{{else}}
{{#if stripeAuth}}
<div class="header-section">
<h3>Accept donations for {{project.title}}</h3>
{{stripe-connect-button url=stripeAuth.url}}
<p>To start accepting donations, you'll need to create a new Stripe account or connect with an existing Stripe account.</p>
<p>Click "Connect with Stripe" to get started. You'll be redirected to Stripe and return here to finish.</p>
</div>
{{/if}}
{{/if}}
{{#if error}}
{{error-formatter error=error}}
Expand Down
5 changes: 0 additions & 5 deletions mirage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ export default function() {
// GET /projects/:id
this.get('/projects/:id');

// GET project/:id/tasks
this.get('/projects/:projectId/stripe-auth', (schema) => {
return schema.create('stripeAuth', { url: '/oauth/stripe' });
});

// GET project/:id/tasks
this.get('/projects/:projectId/tasks', (schema, request) => {
let { projectId } = request.params;
Expand Down
4 changes: 0 additions & 4 deletions mirage/models/stripe-auth.js

This file was deleted.

22 changes: 0 additions & 22 deletions tests/acceptance/stripe-connect-test.js

This file was deleted.