Get Free Audit

Advanced Payment API in Prestashop

Oct 1, 2015

930 Alex Simonchik

Advanced Payment API in Prestashop

I have found an interested comment in Trello about Advanced Payment API in Prestashop and want to share it with our readers.

Standard payment modules in PrestaShop register the displayPayment hook and return HTML from this hook, which makes it very hard to keep only one “Order Confirmation” button on the last page of the checkout.

In order to be compliant with the stricter of EU regulations, a new, parallel payment API was introduced, called Advanced Payment API.

Payment modules complying with the Advanced Payment API register the advancedPaymentOptions hook.

From the advancedPaymentOptions hook, modules MUST RETURN an ARRAY of zero, one, or more instances of Core_Business_Payment_PaymentOption:

Igor Dragun
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Igor

ecommerce development

Ecommerce Development

Take your online store to the next level with BelVG ecommerce development

Visit the page

When checking out an order, if the PS_ADVANCED_PAYMENT_API configuration value is set, the PrestaShop core MUST only use payment methods from advancedPaymentOptions and not even call displayPayment.

When checking out an order, if the PS_ADVANCED_PAYMENT_API configuration value is set, there must be on the last step of the checkout process:

  • a list of available payment options that can be selected but do NOT trigger an action by the simple fact of being selected
  • only ONE button that confirms the order (disabled unless the T&C checkbox is checked)

When PS_ADVANCED_PAYMENT_API is disabled, the old process is used, and ONLY the displayPayment hook is called.

Please do not implement the $form option, which is a bit flaky and might be removed from the API.

Looking for an experienced PrestaShop development partner? Turn to BelVG!

Igor Dragun
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Igor

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *