Swedbank-SPP / swedbank-payment-portal

Swedbank Payment Portal API library for PHP
Other
36 stars 21 forks source link

Not handling status 22 in SwedbankPaymentPortal\SharedEntity\Type\PurchaseStatus #9

Closed DmitryRasko closed 6 years ago

DmitryRasko commented 7 years ago

Hello, found not a bug, but unhandled status. We work on Symfony 2 and used ORM Doctrine's default UUID as merchantReferenceId in HPS SetupRequest. It Appeared that Doctrine's UUID is a bit longer than allowed max length for this parameter (30 symbols). This was found out during debugging Your library which cost time. Exception that was thrown by Your library was not very understood:

"code": 500, "message": "Unknown value '22' was given for enum SwedbankPaymentPortal\SharedEntity\Type\PurchaseStatus"

It would be nice to make this error more obvious. Thanks!

Swedbank-SPP commented 6 years ago

Hi, sorry for that.
Now we've fixed this and also added merchant field validation rules inside a library, library throws exception during construction of the request object. Field validation rules is: length must be between 6 and 30 characters and valid characters are ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _-/

jsakars commented 6 years ago

@Swedbank-SPP don't You think You should inform Your clients before making a change like this and give them some time to adopt? Most of You examples and official documentation states to use unique merchant reference WITHOUT any restrictions and validation rules. In fact - they still do.

spp

Recently we encountered the issue where user was not able to make a purchase because of this change - our generated merchant reference e.g. "59cu8d46e57a5" was not considered valid anymore.

Common guidelines state that a change like this is a backwards incompatible change and corresponding release should be created e.g. "v1.0.0" but instead it was released as a minor change "v0.8.22".

I would love to hear how similar cases are going to be handled in the future?