<?php 

require_once('braintree_init.php');
require_once 'lib/Braintree.php';

$result = Braintree_Customer::create([
	        'firstName' => 'Mike',
            'lastName' => 'Jones',
            
            'paymentMethodNonce' => $_GET["nonce"]
	    
	    
	    ]);
	    
	    if ($result->success) {
            echo $result->customer->id;
            echo "<br>";
            echo $result->customer->paymentMethods[0]->token;
        } else {
    
            foreach($result->errors->deepAll() AS $error) {
                echo $error->code . ": " . $error->message;
            }
        }

?>