Skip to content

PayPal PayFlow Pro: "Comment 1" field set incorrectly #15163

@dccampbell

Description

@dccampbell

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.

Metadata

Metadata

Labels

Component: PaypalEvent: mm19inIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions