how to fix Braintree not passing "device_data" with clint js?

684 views Asked by At

I want to use user "device_data" with braintree js client, but the the data not passed and $_POST['device_data'] is valid method! I try this on sandbox! does it differ on production environment?

here are my codes!

<div style="max-width:300px; margin:20px auto;">
    <form id="checkout" method="post" action="patch/to/checkout">
        <div id="payment-form"></div>
        <input type="submit" value="Pay" />
    </form>
</div>
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
<script>
var clientToken = "clientTokenFromPHP";
braintree.setup(clientToken, "dropin", {
    dataCollector: {
        kount: {environment: 'sandbox'},
        paypal: true
    },
    onReady: function (braintreeInstance) {
        braintreeInstance.deviceData;
    },
    container: "payment-form",

});
</script>

i try to echo the $_POST['device_data'] on checkout page but it was undefined! how can i fix this?

1

There are 1 answers

4
jerry On

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

This is a known issue with braintree.js when trying to use deviceData and dropin. I would follow the github issue for updates on the matter.