Heidelpay - Easy Credit

Setup

The following configuration should be implemented after Heidelpay has been installed and integrated.

Configuration

Configuration Key Type Description
HeidelpayConstants::CONFIG_HEIDELPAY_EASYCREDIT_CRITERIA_REJECTED_DELIVERY_ADDRESS string Criteria to reject by delivery address (for example 'Packstation')
HeidelpayConstants::CONFIG_HEIDELPAY_EASYCREDIT_CRITERIA_GRAND_TOTAL_LESS_THAN int Criteria to reject if grand total less than (for example 200)
HeidelpayConstants::CONFIG_HEIDELPAY_EASYCREDIT_CRITERIA_GRAND_TOTAL_MORE_THAN int Criteria to reject if grand total greater than (for example 5000)
HeidelpayConstants::CONFIG_HEIDELPAY_TRANSACTION_CHANNEL_EASY_CREDIT string Transaction channel for Easy Credit payment method (provided by Heidelpay)
  1. Activate Heidelpay Easycredit payment method.
  2. Add Easycredit checkout steps to StepFactory:
  3. Extend CheckoutPageFactory to change step factory creation:
  4. Extend CheckoutController to add Easycredit step action:
  5. Extend CheckoutPageControllerProvider to add Easycredit actions:
  6. Update CheckoutPageDependencyProvider with Easycredit related modifications:
  7. Update payment.twig template with Easycredit payment method:
  8. Update summary.twig to template to display Easycredit related fees:

Checkout Payment Step Display

Displays payment method name with a radio button. No extra input fields are required.

Payment Step Submitting

No further actions are needed, the quote being filled with payment method selection as default. After selecting Easy Credit as a payment method "HP.IN" request will be sent. In the response, Heidelpay returns an URL string which defines where the customer has to be redirected. If everything was ok, the user would be redirected to the Easy Credit Externally.

Summary Review and Order Submitting

Once the customer is redirected back to us, the response from Easy Credit is sent to the Heidelpay, and Heidelpay makes a synchronous POST request to the shop's CONFIG_HEIDELPAY_PAYMENT_RESPONSE_URL URL (Yves), with the result of payment (see EasyCreditController::paymentAction()). It is called "external response transaction," the result will be persisted in spy_payment_heidelpay_transaction_log as usual. The most important data here - is the payment reference ID which can be used for further transactions like finalize/reserve/etc.

After that, the customer can see the order summary page, where they can review all related data.

There the user will see:

  • rate plan (CRITERION.EASYCREDIT_AMORTISATIONTEXT)
  • interest fees (CRITERION_EASYCREDIT_ACCRUINGINTEREST)
  • total sum including the interest fees (CRITERION.EASYCREDIT_TOTALAMOUNT)

If the customer has not yet completed the HP.IN they must do that again.

On the "save order" event - save Heidelpay payment per order and items, as usual.

When the state machine is initialized, an event "send authorize on registration request" will trigger the authorize on registration request. In case of success, the state will be changed.

Finalize - later on, when the item is shipped to the customer, it is time to call "finalize" command of the state machine. This will send HP.FI request to the Payment API. This is done in FinalizePlugin of the OMS command.

 

See also:

 

Last review date: Jun 6th, 2019