subscribepro / subscribepro-magento2-ext

Subscribe Pro Magento 2 Integration Extension
MIT License
24 stars 22 forks source link

Order Callback | Unable to create order when payment method 'checkmo' #192

Closed chrismshea closed 8 months ago

chrismshea commented 1 year ago

PRs: #238

M2 order callback mechanism must support recurring orders from Subscribe Pro which include offline payment method.

Chris shows in the video where paymentMethodCode will show up in the order callback message when configured in this scenario.

Image

Report from Chris

When attempting to place a recurring order using the Magento 2 - Subscribe Pro Order Callback connection type and using checkmo as the payment method the order fails with the attached exception.

exception.log

https://www.loom.com/share/00589060e21e4959b798a6fc1bfb6857?sid=ce7bee91-3f75-497b-a5ae-257a61285c1e

eugene-shab commented 9 months ago

@garthbrantley At the moment, I see that Magento does not see the difference in order callback requests for online and offline payments.

When making online payments, the platform sends data about the card and the profile that was created for the card

"payment": {
    "paymentToken": "PYxAAiV0AM9MzA8qlsswfpSRAhB",
    "paymentProfileId": 7803297,
    "paymentProfileType": "spreedly_vault",
    "paymentMethodType": "credit_card",
    "creditcardType": "visa",
    "creditcardLastDigits": "1111",
    "creditcardMonth": "11",
    "creditcardYear": "2025"
  },

When making an offline payment(like checkmo), Magento receives only the paymentMethodCode

  "payment": {
    "paymentMethodCode": "checkmo"
  },

If we'll check the payment type only by the existing of paymentMethodCode, I am not sure of the reliability of this scheme.

Is it possible to transfer the payment type - offline/online so that the type can be added to the condition?