Search code examples
syliuspayupayum

Is Sylius PayumBundle handling payment details incorrectly?


I am testing Bitbag/PayUPlugin and I was stopped by gateway API with error "Required data missing".

After some debugging, I realised that Sylius Payment entity, specifically "details" property, is not fulfilled with data.

After change condition on line 53:

https://github.com/Sylius/Sylius/blob/4e06a4dfb8dc56731470016bb97165f3025947b7/src/Sylius/Bundle/PayumBundle/Action/CapturePaymentAction.php#L53

to

if ($status->isNew() || $status->isUnknown()) {

payment gateway seems to work correctly.

Is it a bug or am I doing something wrong ?

Sylius/Sylius v1.4.6 Bitbag/PayUPlugin v1.8.0


Solution

  • Unlikely there is an error in PayumBundle/CapturePaymentAction (because more people used PayumBundle than PayUPlugin, so probability of bug is less), conceptually payment object status at the beginning should be "new" instead of "unknown", so the condition should work.

    So you should find out https://github.com/BitBagCommerce/SyliusPayUPlugin/blob/master/src/Action/StatusAction.php#L58 class, why it doesn't reach markNew() line.