简体   繁体   中英

Hiding the PayPal Credit button on Braintree JavaScript v4 SDK

I'm posting this here in the hope there are some Braintree/PayPal engineers looking at StackOverflow for support issues. I have submitted a support ticket through their new form twice, but have had no reply.

We have noticed very recently that the "PayPal Credit" button has appeared on our payment page without any code changes by us to turn this on.

How we would disable this?

贝宝信用

Also, is it default behaviour to display this on sandbox accounts only? This does not seem to be affecting our production environment (yet).

We are using v4 of the JavaScript SDK:

braintreeClient: "https://js.braintreegateway.com/web/3.87.0/js/client.min",
hosted_fields: "https://js.braintreegateway.com/web/3.87.0/js/hosted-fields.min",
checkoutJs: "https://www.paypalobjects.com/api/checkout.min",
paypalCheckout: "https://js.braintreegateway.com/web/3.87.0/js/paypal-checkout.min"

I have tried passing through offerCredit: false , but this has had no effect:

// Set up PayPal with the checkout.js library
paypal.Button.render({
    env: '{{ braintree_env }}', // 'sandbox' or 'production'
    style: {
        label: 'paypal',
        size:  'responsive',    // small | medium | large | responsive
        shape: 'rect',     // pill | rect
        color: 'white',     // gold | blue | silver | black
        tagline: false,
        width: 500,
        height: 55
    },
    payment: function () {
        return paypalCheckoutInstance.createPayment({
            flow: 'vault', // required to allow us to charge the account in future without re-authentication
            offerCredit: false
        });
    },

For the (v4) checkout.js, which is deprecated, enabling or disabling the credit button on an existing account likely requires an account-level toggle, so Braintree/PayPal will need to do it for you.

Edit: try adding this within the paypal.Button.render( :

    funding: {
        disallowed: [window.paypal.FUNDING.CREDIT]
    },

Current (v5) JS SDK integrations have fundingSource parameter to render specific buttons. (as well as a disable-funding script parameter if rendering multiple smart ones, but it's not as useful with Braintree)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM