Implementation of Direct Debit in the shared layer

Edit on GitHub

This document provides step-by-step instructions on how to identify the new payment type using some unique constants. We are going to define those constants under the Shared namespace, since they’re needed both for Yves and Zed.

To identify the new payment type, do the following:

  1. Create the PaymentMethodsConstants interface under the Shared namespace, where you’ll define these unique constants.

Code sample:

namespace Pyz\Shared\PaymentMethods;

interface PaymentMethodsConstants
	public const PROVIDER = 'PaymentMethods';
	public const PAYMENT_METHOD_DIRECTDEBIT = 'paymentMethodsDirectDebit';
  1. Enrich the Payment transfer file with a new property that corresponds to the new Direct Debit payment method.

Code sample:

<?xml version="1.0"?>
<transfers xmlns="spryker:transfer-01"

    <transfer name="Payment">
        <property name="paymentMethodsDirectDebit" type="PaymentDirectDebit"/>

    <transfer name="PaymentDirectDebit">
        <property name="idPaymentDirectDebit" type="int"/>
        <property name="fkSalesOrder" type="int"/>

        <property name="bankAccountHolder" type="string"/>
        <property name="bankAccountBic" type="string"/>
        <property name="bankAccountIban" type="string"/>
  1. To have the PaymentTransfer class updated, run the following command:
vendor/bin/console transfer:generate

What’s next?

After you’ve completed the front end, back end and shared implementation of the Direct Debit payment method, you can test it. See Testing your Direct Debit Implementation for information on how to do that.