bunq / sdk_php

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

Scheduled payments are not decoded because of a typo #70

Closed mbernson closed 6 years ago

mbernson commented 6 years ago

There is a typo in the bunq\Model\Generated\Endpoint\SchedulePayment class. It has the constant const OBJECT_TYPE = 'SchedulePayment'; while the API returns an object of type ScheduledPayment. When I change the constant to this, it works fine.

Steps to reproduce:

  1. Run this piece of code: https://gist.github.com/mbernson/dd8c966e277b4acd820463335cd47e24

What should happen:

  1. I see a var_dump of my scheduled payments.

What happens:

  1. PHP Notice: Undefined index: SchedulePayment in /Users/mathijs/Code/bunqapibouwsel/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php on line 115

Extra info:

OGKevin commented 6 years ago

Hey Mathijs,

Thanks for this report, will try and reproduce shortly and see whats going on here. Unfortunately because this file is in the generated folder this requires a change on bunq’s side and therefore is not a quick fix. This means that it won’t be fixed in the release of this week.

On 13 Nov 2017, at 12:26, Mathijs Bernson notifications@github.com wrote:

There is a typo in the bunq\Model\Generated\Endpoint\SchedulePayment class. It has the constant const OBJECT_TYPE = 'SchedulePayment'; while the API returns an object of type ScheduledPayment. When I change the constant to this, it works fine.

Steps to reproduce:

Run this piece of code: https://gist.github.com/mbernson/dd8c966e277b4acd820463335cd47e24 https://gist.github.com/mbernson/dd8c966e277b4acd820463335cd47e24 What should happen:

I see a var_dump of my scheduled payments. What happens:

PHP Notice: Undefined index: SchedulePayment in /Users/mathijs/Code/bunqapibouwsel/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php on line 115 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bunq/sdk_php/issues/70, or mute the thread https://github.com/notifications/unsubscribe-auth/ARGTBrV-fm22cLS0qhm2xfQ131rf1MgBks5s2CdPgaJpZM4QbniM.

OGKevin commented 6 years ago

Well, it can of course be hotfixed as well because it’s a 🐜 .

OGKevin commented 6 years ago

FYI @mbernson