1

i am working on laravel api, integrated omnipay/braintree, i have successfully created my customer, what i need to get customer data through this,

 $mycustomer = $omnipay_gateway->findCustomer(5)->send();

but it giving me bad response like,

<pre>Omnipay\Braintree\Message\CustomerResponse Object
(
    [request:protected] => Omnipay\Braintree\Message\FindCustomerRequest Object
        (
            [braintree:protected] => Braintree\Gateway Object
                (
                    [config] => Braintree\Configuration Object

its a huge chunck of data which i am not pasting here, how i get my customer details through this type of data, and it shows in this format, why not in proper json or some other format?

Note: Not only findCustomer , all functions give same sort of response, how we can traverse it.

2 Answers2

0

Call $mycustomer = $omnipay_gateway->findCustomer(5)->send()->getData(); please

Avik Aghajanyan
  • 993
  • 9
  • 14
0

The simple answer for future readers is something like

// Process response
if ($response->isSuccessful()) {

    // Payment was successful
    // $url = $response->getRedirectUrl();
    print_r($response->getData());

} elseif ($response->isRedirect()) {

    // Redirect to offsite payment gateway
    $response->redirect();

} else {

    // Payment failed
    echo $response->getMessage();
}
MR_AMDEV
  • 1,712
  • 2
  • 21
  • 38