Magento1 headless payments
Historically, Magento1 does not support headless payments. Even though some payment providers are using APIs from their module, most of them often rely on the user’s session to persist meaningful information across checkout steps.
Front-Commerce’s Magento module provides a generic way to expose Magento payment modules headlessly and supports the relevant Front-Commerce payment workflows.
Supported Payment platforms
Our Magento1 integration currently provides native adapters for the platforms below, learn how to install each one of them from the related documentation page:
If you want to use a Payment module not yet listed above, please contact us so we can provide information about a potential upcoming native support for it.
Implement a new Magento1 Payment method
Work In Progress This section will be documented in the future. In the meantime, please contact us so we can show you the steps to create your own headless payment in Magento1.
Using the “redirect after order” flow
Payment flows: Redirect after order
Add your own payment instance on
config.xml
fileFirst, you need to create your own model implementing the
FrontCommerce_Integration_Model_Headlesspayment_Interface
interface and register it using the<config><frontcommerce><payment_instances><{payment_method_code}>{class_name}</{payment_method_code}></payment_instances></frontcommerce></config>
XML node in yourconfig.xml
file.Note: don’t forget to replace
{payment_method_code}
by your method payment code and{class_name}
by the class names you’ve just createdImplement the interface methods in your own model:
isHtml(): Boolean
if your payment return type is HTML content or notisUrl(): Boolean
if your payment return type is URL or notgetValue(Mage_Sales_Model_Order $order): String
return URL or HTML when this payment method is call on frontgetResponseSuccess(String $action, [String] $additionalData): Boolean
Failed or success payment actiongetResponseMessage(String $action, [String] $additionalData): [String]
Failed action messagein success case, return an array of
quote_id
andorder_id
:return [ (int) $additionalData['quote_id'], (int) $additionalData['order_id'] ];
in case of errors, return an array of error messages:
return [{error message}]
returnAction(String $action, [String] $additionalData): Boolean
Callback after payment, for exemple, you can add your custom code here for retrieve customer cart after cancel payment