Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

buyer field not populated when getting invoice from client #25

Open
petzsch opened this issue Jan 10, 2020 · 0 comments
Open

buyer field not populated when getting invoice from client #25

petzsch opened this issue Jan 10, 2020 · 0 comments

Comments

@petzsch
Copy link
Collaborator

petzsch commented Jan 10, 2020

When processing an IPN and getting an Invoice via the API, I am not able to query the buyerEmail via:

$buyerEmail = $invoice->getBuyerEmail();

All I get is an empty string.

The code is mainly taken from the tutorial code of this repo: IPNlogger.php

After some discussion on MM I think I narrowed the problem down to this function:

https://github.com/btcpayserver/btcpayserver-php-client/blob/master/src/BTCPayServer/Client/Client.php#L106

It is lacking the population of the Buyer Data fields.

My first attempt at fixing the issue with:

->setBuyer(array_key_exists('buyer', $data) ? $data['buyer'] : '')

failed with the following error:
PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to BTCPayServer\Invoice::setBuyer() must be an instance of BTCPayServer\BuyerInterface, array given,

It would be greatly appreciated if someone could supply a fix for this.

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

No branches or pull requests

1 participant