Do not create a Payment entity until a payment has succeeded

Created on 14 June 2023, over 1 year ago
Updated 27 June 2023, over 1 year ago

6. Stop creating the payment in advance on the redirect payment form; it should be created once youโ€™ve validated the return payload.

The PluginForm used to build the form on the payment redirect page could use a rename (to remove "Offsite") and a refactor to avoid creating a Payment entity when the form is presented. Generally speaking, the mere loading of a page should not result in the creation of anything in the database. In this case, it appears the goal was to have a payment ID to pass to the front-end for use in validating the transaction after the fact.

As I read it, this just isn't necessary. The integration guide doesn't seem to indicate passing a payment ID is necessary, and I can only see it being used self-referentially. I think we can just defer creating the entity, remove checks for it from various parts of the code, and then actually create it in the gateway plugin's processFeedback() function.

The idea here is just that a Payment entity should only be created after a successful payment has been validated via the receipt request.

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States rszrama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024