fix(client): prevent PayPal script loads in development (#38785)
parent
c0905959a0
commit
88b263fef8
|
@ -34,7 +34,7 @@ export class PayPalButtonScriptLoader extends Component {
|
|||
|
||||
loadScript(subscription, deleteScript) {
|
||||
if (deleteScript) scriptRemover('paypal-sdk');
|
||||
let queries = `?client-id=${this.props.clinetId}&disable-funding=credit,card`;
|
||||
let queries = `?client-id=${this.props.clientId}&disable-funding=credit,card`;
|
||||
if (subscription) queries += '&vault=true';
|
||||
|
||||
scriptLoader(
|
||||
|
@ -92,7 +92,7 @@ export class PayPalButtonScriptLoader extends Component {
|
|||
}
|
||||
|
||||
const propTypes = {
|
||||
clinetId: PropTypes.string,
|
||||
clientId: PropTypes.string,
|
||||
createOrder: PropTypes.func,
|
||||
createSubscription: PropTypes.func,
|
||||
donationAmount: PropTypes.number,
|
||||
|
|
|
@ -76,10 +76,15 @@ export class PaypalButton extends Component {
|
|||
render() {
|
||||
const { duration, planId, amount } = this.state;
|
||||
const isSubscription = duration !== 'onetime';
|
||||
|
||||
if (!paypalClientId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<PayPalButtonScriptLoader
|
||||
amount={amount}
|
||||
clinetId={paypalClientId}
|
||||
clientId={paypalClientId}
|
||||
createOrder={(data, actions) => {
|
||||
return actions.order.create({
|
||||
purchase_units: [
|
||||
|
|
Loading…
Reference in New Issue