0

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?

Osiris
  • 131
  • 3
  • 16

1 Answers1

0

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.

jerry
  • 312
  • 1
  • 5
  • i include braintree-2.17.5.min.js but it doesn't fix the problem! – Osiris Dec 31 '15 at 16:01
  • could you please gimme a working sample for both PayPal and credit card. – Osiris Dec 31 '15 at 16:02
  • 2.17.5 hasn't fixed the issue, it is still being worked on. An alternative would be to use [Hosted Fields](https://developers.braintreepayments.com/guides/hosted-fields/overview). You would have to do your own styling, but it is presently working with `deviceData`. – jerry Dec 31 '15 at 16:28
  • I think we should stamp a very very Big BETA on Braintree. triy this but not work for me! and something more how can i hide card fields if user choose pay with PayPal? Braintree documents are so so Concise and unclear. – Osiris Jan 10 '16 at 16:14