Reputation: 17181
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
});
},
Upvotes: 0
Views: 433
Reputation: 30379
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)
Upvotes: 0