Implement the Authorization request

Created on 20 February 2023, over 1 year ago
Updated 14 June 2023, about 1 year ago

With the PaymentGateway settings in place and the tokenizer saving payment methods, we now need to implement the Authorization request: https://integrate.clover.com/developers/cardconnect-api/#authorization

When the PaymentProcess checkout pane is submitted, it will invoke the createPayment() method on the relevant PaymentGateway plugin. Our create method needs to send an Authorization request that can also signal a capture based on the payment gateway configuration. (Note: we do not have to implement the Capture request yet for that, just pass in the capture parameter as Y in the request.)

The PaymentGateway plugin should not be implementing the API request directly. The API request should be submitted via a function in the CardPointeApi service we previously stubbed out. For now, log every API request and response to the watchdog, though we will want to make that configurable eventually.

A successful authorization should result in a Payment entity, and that Payment entity should either be left in a pending state if not capture or created in the completed state if it was a full, successful capture.

For now, I don't think we need separate createPayment() and doCreatePayment() functions like HostedFields has ... I also don't think we need an ErrorHelper service like the Braintree module uses. Let's keep it simple ... single function, and we evaluate the response codes inline and throw the appropriate Commerce Core payment exception accordingly.

(That said, the ErrorHelper service from the Braintree module has good logic to follow!)

πŸ“Œ Task
Status

Fixed

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.69.0 2024