Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove UI to set Stripe API settings #88

Merged
merged 1 commit into from
Nov 12, 2019
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
Original file line number Diff line number Diff line change
@@ -1,58 +1,8 @@
<template name="stripeSettings">
{{#unless packageData.settings.api_key}}
<div class="alert alert-info">
<span data-i18n="admin.paymentSettings.stripeSettingsDescription">Don't have a Stripe API Secret Key?</span>
<a href="https://dashboard.stripe.com/account/apikeys" target="_blank">
<span data-i18n="admin.paymentSettings.stripeSettingsGetItHere">Get it here.</span>
</a>
</div>
{{/unless}}
<div>
{{#autoForm collection=Collections.Packages schema=StripePackageConfig doc=packageData type="update" id="stripe-update-form"}}
{{>afQuickField name='settings.api_key'}}
{{>afQuickField name='settings.public.publishable_key'}}
<button type="submit" class="btn btn-primary pull-right"><span data-i18n="app.saveChanges">Save Changes</span></button>
<button type="submit" class="btn btn-primary pull-right"><span data-i18n="app.saveChanges">Save
Changes</span></button>
{{/autoForm}}
</div>
</template>

<template name="stripe">
<div class="container-fluid-sm flex">
<div class="flex-item">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">Stripe Checkout</div>
</div>
<div class="list-group">
<div class="list-group-item">
{{#if packageData.settings.api_key}}
<span>API Secret Key: <button type="button" class="btn btn-link" data-event-action="showStripeSettings">**********</button></span>
{{else}}
<span>API Secret Key: <button type="button" class="btn btn-link" data-event-action="showStripeSettings">Configure Now</button></span>
{{/if}}
</div>
</div>
<div class="panel-footer">
<div class="left"></div>
<div class="right">

<div class="panel-footer-item">
{{#if packageData.settings.api_key}}
<i class="fa fa-check-circle fa-2x text-success"></i>
{{else}}
<i class="fa fa-minus-circle fa-2x text-muted"></i>
{{/if}}
</div>

<div class="panel-footer-item">
<button class="btn btn-default" data-event-action="showStripeSettings">
<i class="fa fa-gear"></i>
</button>
</div>

</div>
</div>
</div>
</div>
</div>
</template>
10 changes: 0 additions & 10 deletions imports/plugins/included/payments-stripe/client/settings/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ Template.stripeSettings.helpers({
packageData
});

Template.stripe.helpers({
packageData
});

Template.stripe.events({
"click [data-event-action=showStripeSettings]"() {
Reaction.showActionView();
}
});

AutoForm.hooks({
"stripe-update-form": {
onSuccess() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,16 @@ export const StripePackageConfig = PackageConfig.clone().extend({
type: Boolean,
defaultValue: false
},
"settings.api_key": {
type: String,
label: "API Secret Key"
},
// This field only applies to marketplace style orders where a payment is taken on behalf of another store
"settings.applicationFee": {
type: Number,
label: "Percentage Application Fee",
optional: true,
defaultValue: 5
},
"settings.connectAuth": {
type: StripeConnectAuthorizationCredentials,
label: "Connect Authorization Credentials",
optional: true
},
"settings.public": {
type: Object,
defaultValue: {}
},
// Public Settings
"settings.public.client_id": {
type: String,
label: "Public Client ID",
optional: true
},
"settings.public.publishable_key": {
type: String,
label: "Publishable Key",
optional: true
}
});

Expand Down