-
Notifications
You must be signed in to change notification settings - Fork 54
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
Allow access to merchant_category_code
in the counterparty_alias
#171
Comments
@timvdalen Good wish 👍🏻 This field (merchant_category_code) is also not in the documentation (https://doc.bunq.com/#/payment/Read_Payment_for_User_MonetaryAccount), that is probably the cause @kojoru ? |
Indeed, I found it through raw requests to the API |
Any update on this? |
🤷♂️, you could always edit the generated code manually and use that until this is fixed. |
If you can provide a raw response example i could show you where/how to change the generated code. |
Sure! Considering this raw payment (with a bunch of fields omitted): {"Payment":{
...,
"counterparty_alias":{
"iban":null,
"is_light":null,
"display_name":"AH",
"avatar":{},
"label_user":{
"uuid":null,
"display_name":"AH",
"country":"NL",
"avatar":null,
"public_nick_name":"AH"
},
"country":"NL",
"merchant_category_code":"5499"
},
...
}} I'm trying to get the |
Add the following
/**
* Why does it take so long to fix this.....
*
* @var string
*/
protected $merchantCategoryCode;
/**
* @return string
*/
public function getMerchantCategoryCode(): string
{
return $this->merchantCategoryCode;
} in and it should magically work fine. |
Works great, thanks! |
Np. I told them to let me maintain my maintainer status even thought i dont work there anymore (as an outside contributer/maintainer) but 🤷♂️. This takes 5 mins to fix in the generator :(. |
Steps to reproduce:
Payment
made with a card at a merchant POS$payment->getCounterpartyAlias()->getMerchantCategoryCode()
What should happen:
What happens:
getMerchantCategoryCode()
is not defined onLabelMonetaryAccount
(rightly so, as it is a more generic model than a specific merchant alias)SDK version and environment
Extra info:
Alternatively, getting access to the raw JSON through a
BunqResponse
would be a good compromise if there is no way to fit this into the existing models. That way, users can extract extra fields they need themselves.The text was updated successfully, but these errors were encountered: