Paiement gateway issue


#1

I’m trying to configure my first paiement gateway (using sylius’ stripe default form)

when I submit the form, I’ve got this error :

An exception occurred while executing ‘INSERT INTO sylius_gateway_config (id) VALUES (null)’:

when I debug, the ResourceController create a valid $newResource but when the repository try to persist it, only the Id is used to create the SQL.

the problem seem to come from vendor/sylius/sylius/src/Sylius/Bundle/PayumBundle/Resources/config/doctrine/model/GatewayConfig.orm.xml

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                  http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
        >
    <mapped-superclass name="Sylius\Bundle\PayumBundle\Model\GatewayConfig" table="sylius_gateway_config">
        <id name="id" column="id" type="integer">
            <generator strategy="AUTO" />
        </id>
    </mapped-superclass>
</doctrine-mapping>

the rest of the entity ORM conf. has been removed in this commit https://github.com/Sylius/Sylius/commit/6b28f694f5a1b4faa07459e451fe345fccd4904f a year ago.

So, I guess that I’m missing something, but I can’t figure out what…


#2

I worked on this issue all day long what I conclude is :

the doctrine mapping of Payum\Core\Model\GatewayConfig is not loaded so only the mapping of Sylius\Bundle\PayumBundle\Model\GatewayConfig is read, an so on only the fields declared there are persisted, I can’t find out what gone wrong…


#3

I solved my issue by adding this conf:

doctrine:
    orm:
        entity_managers:
            default:
                mappings:
                    payum:
                        is_bundle: false
                        type: xml
                        dir: %kernel.root_dir%/../vendor/payum/payum/src/Payum/Core/Bridge/Doctrine/Resources/mapping
                        prefix: Payum\Core\Model

but its wrong on so many levels… That I skill humbly ask for any help to obtain a proper auto configuration.

(note : my Sylius codebase is two years old, so I may have missed an upgrade step, furthermore until now we only provided free products)


#4

You can do it more easily by following the steps from hp customer support and it will not take too much time.