bunq / sdk_php

PHP SDK for bunq API
MIT License
84 stars 54 forks source link

Can't use public functions in endpoints #172

Closed nouce closed 5 years ago

nouce commented 5 years ago

Steps to reproduce:

  1. If i want to display the user persons public nick name i need to do it like this:
    
    use bunq\Model\Generated\Endpoint\UserPerson;
    use bunq\Model\Generated\Endpoint\Payment;

$apiContext = ApiContext::restore(storage_path('bunq/bunq.conf')); $bunqContext = BunqContext::loadApiContext($apiContext);

$userPerson = UserPerson::get(); dd($userPerson->getPublicNickName());



According to the bunq sdk_php documantation.

## What should happen:
1. It should output the public nick name

## What happens:
1. I get this error 
`Call to undefined method bunq\Model\Generated\Endpoint\BunqResponseUserPerson::getPublicNickName()`

## SDK version and environment
- Tested on [0.12.4](https://github.com/bunq/sdk_php/releases/tag/0.12.4)
- [x] Sandbox
- [ ] Production

## Extra info:
[//]: # (Please provide any other relevant information here)
basst85 commented 5 years ago

Hello @nouce , i think you forget to use "getValue()" first 🙂

This works:

$userPerson = UserPerson::get();
echo $userPerson->getValue()->getPublicNickName();
nouce commented 5 years ago

Jup, that works! Thanks for the help men 👍🏻