Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$gateway->findCustomer()->send()->getCustomerData() returns null #48

Open
Mark-H opened this issue Jul 19, 2019 · 0 comments
Open

$gateway->findCustomer()->send()->getCustomerData() returns null #48

Mark-H opened this issue Jul 19, 2019 · 0 comments

Comments

@Mark-H
Copy link

Mark-H commented Jul 19, 2019

While the readme isn't clear about what is and what isn't expected behaviour, I landed on the following code to check if a customer id exists:

$id = '...';
$existingCustomer = $this->instance->findCustomer($id)->send();
if ($customer = $existingCustomer->getCustomerData()) {
    return $customer->id;
}

However, getCustomerData() returns null.

This seems to be due the implementation in CustomerResponse, which is looking for $this->data->customer. In the findCustomer request however, the customer object is $this->data (so getData() does get me what I need).

https://github.com/thephpleague/omnipay-braintree/blob/master/src/Message/CustomerResponse.php#L12-L14

(Note I'm on v1.1.2 and currently unable of upgrading to Omnipay 3 due to the PHP requirement, but from a very brief look at the v2 code that doesn't seem to have changed)

What's expected here? Should getCustomerData work in the findCustomer request, or is the documentation that says getData should be used missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant