-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Description
PayPal PayFlow provides the optional COMMENT1 field for passing along any custom information desired to be saved with the transaction in PayPal (documentation here).
Magento 2 attempts to use this field to store the order ID. However, the use of setComment1() to add this value to the request creates the key comment_1 rather than comment1. As such, PayPal ignores it and so the field appears empty when viewing PayPal transactions.
Preconditions
- Magento version >= 2.3.3*
- PayPal Payflow Pro payment method is enabled and working
*Confirmed in these versions, but also affects all previous M2 releases assuming that the parsing of setData magic method names wasn't changed at some point.
Steps to reproduce
- Complete any order using PayPal Payflow Pro as the payment method.
Expected result
- When viewing the transaction for the order in PayPal, the "Comment 1" field contains the order ID.
Actual result
- The "Comment 1" field is missing/empty on the transaction.
Proposed Resolution
| ->setComment1($orderIncrementId); |
Change the ->setComment1($orderIncrementId); line to ->setData('comment1', $orderIncrementId);
That's assuming that a numeral being treated like a capital letter here when converting camelCase set method names to snake_case data keys is not itself a bigger issue. If not, I'm happy to submit a pull request for the above change if desired.