Skip to content

Commit d786886

Browse files
kushthedudeiamareebjamal
authored andcommitted
fix: Stripe working on test & development mode (#3753)
1 parent 11f639a commit d786886

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

app/components/forms/wizard/basic-details-step.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import FormMixin from 'open-event-frontend/mixins/form';
1111
import { inject as service } from '@ember/service';
1212
import EventWizardMixin from 'open-event-frontend/mixins/event-wizard';
1313
import { protocolLessValidUrlPattern } from 'open-event-frontend/utils/validators';
14+
import ENV from 'open-event-frontend/config/environment';
1415

1516
export default Component.extend(FormMixin, EventWizardMixin, {
1617

@@ -366,7 +367,7 @@ export default Component.extend(FormMixin, EventWizardMixin, {
366367
.then(authorization => {
367368
this.set('data.event.stripeAuthorization', this.store.createRecord('stripe-authorization', {
368369
stripeAuthCode : authorization.authorizationCode,
369-
stripePublishableKey : this.settings.stripePublishableKey
370+
stripePublishableKey : ENV.environment === 'development' || ENV.environment === 'test' ? this.settings.stripeTestPublishableKey : this.settings.stripePublishableKey
370371
}));
371372
})
372373
.catch(error => {

app/templates/public/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="ui segment">
1212
<h3 class="ui header">{{t 'Tickets'}}</h3>
1313
</div>
14-
<div class="ui segment x-scrollable">
14+
<div class="ui segment">
1515
{{public/ticket-list eventCurrency=model.event.paymentCurrency
1616
ticketUrl=model.event.ticketUrl
1717
data=model.tickets

app/torii-providers/stripe.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import stripeConnect from 'torii/providers/stripe-connect';
22
import { alias } from '@ember/object/computed';
33
import { inject } from '@ember/service';
44
import { configurable } from 'torii/configuration';
5+
import ENV from 'open-event-frontend/config/environment';
56

67
export default stripeConnect.extend({
78
settings: inject(),
89

9-
clientId: alias('settings.stripeClientId'),
10+
clientId: ENV.environment === 'development' || ENV.environment === 'test' ? alias('settings.stripeTestClientId') : alias('settings.stripeClientId'),
1011

1112
redirectUri: configurable('redirectUri', function() {
1213
return `${window.location.origin}/torii/redirect.html`;

0 commit comments

Comments
 (0)