add config

This commit is contained in:
Cihan Bebek
2017-07-06 13:32:37 +03:00
parent 09e3d56fcb
commit 5be8ba8cf4
3 changed files with 9 additions and 19 deletions

View File

@@ -1,12 +0,0 @@
{
"production": {
"stripe": {
"publicKey": "pk_live_xrnwdLNXbt20LMxpIDffJnnC"
}
},
"development": {
"stripe": {
"publicKey": "pk_test_OmNve9H1OuORlmD4rblpjgzh"
}
}
}

View File

@@ -8,7 +8,8 @@
"scripts": {
"start": "rm -rf public && gulp",
"build": "rm -rf public && gulp build",
"dev": "SERVER=http://localhost:9000/ npm start",
"dev": "SERVER=http://localhost:9000/ ENV=development npm start",
"prod": "ENV=production npm start",
"lint": "eslint src",
"test": "mocha src/**/__tests__/*.js --compilers js:babel-core/register --require test/test-helper"
},

View File

@@ -3,10 +3,11 @@
var request = require('axios');
var React = require('react');
var classSet = require('classnames');
var api = require('../api');
import StripeCheckout from 'react-stripe-checkout';
var api = require('../api');
var config = require('../../config.js')();
module.exports = React.createClass({
getInitialState() {
return {
@@ -46,15 +47,15 @@ module.exports = React.createClass({
return <img src="../images/ajax-loader.gif" alt="Odota hetki..." height="42" width="42"></img>
} else {
return (<StripeCheckout
amount = {1000}
amount = { 1000 }
currency = 'EUR'
description = 'Jäsenmaksu'
email = {this.props.userInfo.email}
email = { this.props.userInfo.email }
image = 'https://avatars3.githubusercontent.com/u/10520119?v = 3&s = 200'
locale = "en"
name = 'Koodiklinikka ry'
stripeKey = 'pk_test_OmNve9H1OuORlmD4rblpjgzh'
token = {this.onSubmit}
stripeKey = { config.stripe.publicKey }
token = { this.onSubmit }
>
<button className="btn btn-primary">
Maksa kortilla