-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
467 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
`import Ember from "ember";` | ||
`import Utils from "balanced-dashboard/lib/utils";` | ||
`import AnalyticsLogger from "balanced-dashboard/utils/analytics_logger";` | ||
|
||
Controller = Ember.Controller.extend( | ||
needs: ["notification_center"] | ||
|
||
userMarketplaces: Ember.computed.reads("auth.user.user_marketplaces") | ||
marketplaces: Ember.computed.filterBy("userMarketplaces", "production") | ||
|
||
isStartingMigration: false | ||
|
||
getConnection: (apiKey) -> | ||
require("balanced-dashboard/lib/connections/api-connection").default.create( | ||
apiKey: apiKey | ||
) | ||
|
||
createMigration: (marketplace, emailAddress) -> | ||
deferred = Ember.RSVP.defer() | ||
AnalyticsLogger.trackEvent("Stripe migration started", | ||
data_marketplace_id: marketplace.get("id") | ||
data_email_address: emailAddress | ||
) | ||
|
||
Ember.$ | ||
.ajax("https://api.balancedpayments.com/stripe/", | ||
method: "POST" | ||
data: | ||
email: emailAddress | ||
headers: | ||
Authorization: Utils.encodeAuthorization(marketplace.get("secret")) | ||
) | ||
.done -> | ||
deferred.resolve() | ||
.fail (xhr, error, message) -> | ||
AnalyticsLogger.trackEvent("Stripe migration error", | ||
data_marketplace_id: marketplace.get("id"), | ||
data_email_address: emailAddress, | ||
xhr_text: xhr.responseText | ||
) | ||
|
||
deferred.reject(xhr.responseJSON.errors) | ||
deferred.promise | ||
|
||
actions: | ||
startMigration: (marketplace, emailAddress, isAccepted) -> | ||
@set "errors", [] | ||
@get("controllers.notification_center").clearAlerts() | ||
if marketplace && emailAddress && isAccepted | ||
@set("isStartingMigration", true) | ||
@createMigration(marketplace, emailAddress) | ||
.then => | ||
marketplace.reload() | ||
.then => | ||
@transitionTo("migrateSuccess", marketplace) | ||
.catch (errors) => | ||
for error in errors | ||
error.isStripeUnderwritingError = (error.category_code == "stripe-underwriting-error") | ||
@set("errors", errors) | ||
.finally => | ||
@set("isStartingMigration", false) | ||
else | ||
@get("controllers.notification_center").alertError("Please fill all of the fields") | ||
) | ||
|
||
`export default Controller;` |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
`import Ember from "ember";` | ||
`import TitleRoute from "./title";` | ||
|
||
Route = TitleRoute.extend( | ||
pageTitle: "Connect Stripe account" | ||
|
||
model: (params) -> | ||
@container | ||
.lookupFactory("model:marketplace") | ||
.findById(params.marketplace_id) | ||
|
||
setupController: (controller, model) -> | ||
controller.set("model", model) | ||
) | ||
|
||
`export default Route;` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
`import Ember from "ember";` | ||
`import TitleRoute from "./title";` | ||
|
||
SUCCESS_MESSAGE = | ||
"Migration request received: The migration process will take 2-3 business days. You'll receive an email confirmation upon completion." | ||
|
||
Route = TitleRoute.extend( | ||
pageTitle: "Migrate" | ||
|
||
model: (params) -> | ||
@container | ||
.lookupFactory("model:marketplace") | ||
.findById(params.marketplace_id) | ||
|
||
setupController: (controller, model) -> | ||
controller.set("model", model) | ||
@controllerFor("notification_center").alertSuccess(SUCCESS_MESSAGE) | ||
) | ||
|
||
`export default Route;` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
`import Ember from "ember";` | ||
`import AuthRoute from "./auth";` | ||
|
||
Route = AuthRoute.extend( | ||
pageTitle: "Migrate" | ||
setupController: (controller) -> | ||
@controllerFor("notification_center").clearAlerts() | ||
) | ||
|
||
`export default Route;` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.spin-animation { | ||
-webkit-animation: fa-spin 2s infinite linear; | ||
animation: fa-spin 2s infinite linear; | ||
} | ||
|
||
@-moz-keyframes fa-spin { | ||
from { -moz-transform: rotate(0deg); } | ||
to { -moz-transform: rotate(360deg); } | ||
} | ||
@-webkit-keyframes fa-spin { | ||
from { -webkit-transform: rotate(0deg); } | ||
to { -webkit-transform: rotate(360deg); } | ||
} | ||
@keyframes fa-spin { | ||
from {transform:rotate(0deg);} | ||
to {transform:rotate(360deg);} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
@import "./loading-spinner.less"; | ||
|
||
.container.column { | ||
margin: 45px auto; | ||
min-width: initial !important; | ||
width: 100% !important; | ||
max-width: 940px !important; | ||
|
||
h3 { | ||
font: normal normal normal 16px "Proxima Nova Semi Bold", arial, sans-serif; | ||
} | ||
|
||
.group-label { | ||
font: normal normal normal 12px "Proxima Nova Semi Bold", arial, sans-serif; | ||
} | ||
|
||
.help-block { | ||
font-size: 12px; | ||
} | ||
.padded-section { | ||
margin: 40px 0; | ||
} | ||
|
||
.button-spinner { | ||
text-align: center; | ||
width: 135px; | ||
} | ||
|
||
i.icon-loading { | ||
.spin-animation(); | ||
background: transparent url("/images/loading.png") center center no-repeat; | ||
display: inline-block; | ||
height: 26px; | ||
overflow: hidden; | ||
width: 26px; | ||
} | ||
|
||
.btn.btn-lg { | ||
padding: 10px 16px; | ||
font-size: 18px; | ||
line-height: 1.3333333; | ||
} | ||
|
||
label { | ||
font: normal normal normal 15px "Proxima Nova Reg", arial, sans-serif; | ||
&::after { | ||
content: ""; | ||
padding: 0; | ||
} | ||
|
||
input[type=radio], input[type=checkbox] { | ||
margin: 5px 6px 10px 0; | ||
} | ||
} | ||
|
||
.form-item { | ||
margin-bottom: 30px; | ||
} | ||
|
||
.alert { | ||
border-radius: 0; | ||
font: normal normal normal 14px "Proxima Nova Semi Bold", arial, sans-serif; | ||
margin: 75px 0; | ||
} | ||
|
||
.alert.alert-info { | ||
background-color: #EFF0F1; | ||
border: 1px solid #CBCFD3; | ||
color: #000; | ||
text-align: center; | ||
} | ||
} | ||
|
||
.letterhead { | ||
text-align: center; | ||
.logo { | ||
display: inline-block; | ||
} | ||
.logo.logo-dots { | ||
img { | ||
width: 35px | ||
} | ||
} | ||
} | ||
|
||
.page-title.title-1 { | ||
color: #000; | ||
font: normal normal normal 44px "Proxima Nova Semi Bold",arial,sans-serif; | ||
letter-spacing: .1em; | ||
line-height: 52px; | ||
margin: 70px 0; | ||
text-align: center; | ||
text-transform: uppercase; | ||
} | ||
|
||
.migrate-form { | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{render "notification_center"}} | ||
<section class="container column"> | ||
<header class="letterhead"> | ||
<a class="logo logo-dots" href="https://www.balancedpayments.com"> | ||
<img src="/images/logo_3dots.png"/> | ||
</a> | ||
</header> | ||
|
||
<div class="contents"> | ||
{{yield}} | ||
</div> | ||
</section> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<h1 class="page-title title-1">Stripe migration</h3> | ||
|
||
<hr> | ||
|
||
<h3>Migration information</h3> | ||
<div class="form-section clearfix col-md-offset-4"> | ||
<h4 class="group-label">Migrate production marketplace</h4> | ||
<div class="form-item"> | ||
{{model.name}} | ||
{{#if model.isMigrationStarted}} | ||
<strong>(migration started)</strong> | ||
{{/if}} | ||
</div> | ||
|
||
<h4 class="group-label">Migrate data</h4> | ||
<p> | ||
Card, bank account, and seller identity data | ||
</p> | ||
</div> | ||
<hr> | ||
|
||
<h3>Migration agreement</h3> | ||
<div class="form-section clearfix col-md-offset-4"> | ||
<div class="form-item"> | ||
By clicking below, you indicate your acceptance of the | ||
<a href="https://www.balancedpayments.com/terms/stripe-migration" target="_blank">Migration Agreement</a> | ||
</div> | ||
</div> | ||
<hr> | ||
<div class="form-section form-footer"> | ||
<a {{bind-attr href=view.activateAccountHref}} class="btn btn-info pull-right"> | ||
Connect Stripe account | ||
</a> | ||
</div> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<h1 class="page-title title-1">Next step</h3> | ||
|
||
<div style="text-align: center;"> | ||
<div class="padded-section"> | ||
<h3>Activate your stripe account</h3> | ||
</div> | ||
<p> | ||
Provide your personal and business information to obtain process access to stripe.<br/> | ||
You will not be able to process live until you've activated your account.</p> | ||
<div class="padded-section"> | ||
<a {{bind-attr href=view.activateAccountHref}} class="btn btn-lg btn-info">Activate Stripe account</a> | ||
</div> | ||
</div> |
Oops, something went wrong.