use test stripe token when connected to api on localhost

This commit is contained in:
Alex Grintsvayg 2017-08-25 16:49:12 -04:00
parent 010534cc16
commit 1f6b477d24
3 changed files with 9 additions and 7 deletions

View file

@ -1,12 +1,8 @@
import React from "react";
import lbry from "lbry.js";
import lbryuri from "lbryuri.js";
import Link from "component/link";
import FormField from "component/formField";
import FileTile from "component/fileTile";
import rewards from "rewards.js";
import lbryio from "lbryio.js";
import { BusyMessage, Thumbnail } from "component/common.js";
import { BusyMessage } from "component/common.js";
class FileList extends React.PureComponent {
constructor(props) {

View file

@ -1,7 +1,7 @@
import React from "react";
import { CreditAmount } from "component/common";
import Link from "component/link";
import CardVerify from "component/cardVerify";
import lbryio from "lbryio.js";
class UserVerify extends React.PureComponent {
constructor(props) {
@ -44,7 +44,7 @@ class UserVerify extends React.PureComponent {
label={__("Link Card and Finish")}
disabled={isPending}
token={this.onToken.bind(this)}
stripeKey="pk_live_e8M4dRNnCCbmpZzduEUZBgJO"
stripeKey={lbryio.getStripeToken()}
/>
</p>
<p>

View file

@ -205,4 +205,10 @@ lbryio.authenticate = function() {
return lbryio._authenticationPromise;
};
lbryio.getStripeToken = () => {
return CONNECTION_STRING.startsWith("http://localhost:")
? "pk_test_NoL1JWL7i1ipfhVId5KfDZgo"
: "pk_live_e8M4dRNnCCbmpZzduEUZBgJO";
};
export default lbryio;