Sylius: Gateway variants

Created on 4 Mar 2016  ·  12Comments  ·  Source: Sylius/Sylius

Good afternoon!

I do not know when it happened, but in my local copy and in your demo site disappeared from the gateway list all options except "Offline". I think Sylius must have at least one option preconfigured Omnipay gateway.

Documentation

Most helpful comment

@Arminek I absolutely agree with @pamil, your font in a terminal is unacceptable :imp:

All 12 comments

Hi @BlackIceWizard! We have removed default configurations to simplify installation. We need to document how to configure them, this is quite straightforward.

Installation was really long. But it is quite clear all configured options of payment systems discourage those who had not previously worked with the payment systems. How about to make gateways customizable through the administrative part of the site? Or make these settings in the additional console command...

Hey! I am one of _those who had not previously worked with the payment systems._
I already spent a reasonable while trying to figure out how to implement a payment-gateway (no specific, just for testing) and feel quite lost since neither the docs nor the code seem to give me any hints. Any quick recommendations and/or code-snippets? Thanks!

Hi @macro64 , could you please tell me what are you going to do. Do you need this for some kind of CI or only to test it by your own in your local environment ? I will show you an example how to configure payment gateway check this pull request https://github.com/Sylius/Sylius-Docs/pull/415/files here is example of paypal checkout express configuration. For more examples you should check this https://github.com/Payum/PayumBundle/blob/master/Resources/doc/configuration_reference.md
Don't forget to enable your new configured payment method in your channel ;)

Hey @Arminek , Thank you very much for your help!
With the code and reference you provided I was able to add the payment options and continue further.
I'm working in a local enviroment and try to evaluate if Sylius fits my needs for a upcoming project. Thanks again!

@Arminek could you elaborate on how you knew what the config values are supposed to be called ("paypal_express_checkout", "paypal_express_checkout_nvp")? Where do I find out what config values I need for other Payment-Providers I might want to activate?

Sure i will explain this on simple example. Let's assume that you need for example some kind of offline payment method maybe cash on delivery.

payum:
    gateways:
        your_method_name:
            predefined_gatway_factory_name:
                specific_arguments_based_on_gateway:
                    .
                    .

So your configuration will look like:

payum:
    gateways:
        cash_on_delivery:
            offline: ~

Advanced example:

payum:
    gateways:
        paypal_express_checkout:
            paypal_express_checkout_nvp:
                username: [email protected]
                password: test_acc
                signature: signature_from_paypal
                sandbox: true

There is one more configuration for admin side (UI)

sylius_payment:
    gateways:
        offline: Offline
        cash_on_delivery: Cash on delivery
        paypal_express_checkout: Paypal Express Checkout

Sylius uses payum bundle for handling payments for more examples check https://github.com/Payum/PayumBundle/blob/master/Resources/doc/configuration_reference.md
Also there is a command for payment method debugging it displays some information about configured payment gateways.
app/console payum:gateway:debug
Example output:
zrzut ekranu 2016-03-16 o 22 54 32

Just a follow-up question. If I tried using a payum bundle that did not came with the standard version of payum (https://packagist.org/packages/payum/sofort) would I have to register it somewhere in the Symfony/PayumBundle?

Because in the SofortGatewayFactory I see

'payum.factory_name' => 'sofort'

but when I edit the config.yml like so:

        sofort_ueberweisung:
            sofort:
                config_key: "cjwvqehtzavb"
                abort_url: "http://127.0.0.1:8000"

I get

Unrecognized option "sofort" under "payum.gateways.sofort_ueberweisung"

From the payum:gateway:debug command.

Do I have to edit /vendor/sylius/sylius/src/Sylius/Bundle/PayumBundle/Resources/config/services.xml?

@Arminek the font in your terminal needs to be fixed :racehorse: :water_buffalo: :snail:

@Arminek I absolutely agree with @pamil, your font in a terminal is unacceptable :imp:

@janrop

Do I have to edit /vendor/sylius/sylius/src/Sylius/Bundle/PayumBundle/Resources/config/services.xml?

No, You dont have to edit it.

Unrecognized option "sofort" under "payum.gateways.sofort_ueberweisung"

There is not a factory in the bundle for sofort official extension. There are two ways to go.

  • Use unofficial sofort extension.
  • Write a factory like this: StripeJsGatewayFactory
  • Make Sylius work with PayumBundle 2.x (Contains BC breaks). The official extension is supported by PayumBundle 2.x

There are already docs for these issues -> http://docs.sylius.org/en/latest/book/payments.html and http://docs.sylius.org/en/latest/cookbook/paypal.html
I think we can close this issue @pjedrzejewski @michalmarcinkowski ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

inssein picture inssein  ·  3Comments

Chrysweel picture Chrysweel  ·  3Comments

bnd170 picture bnd170  ·  3Comments

loic425 picture loic425  ·  3Comments

eb22fbb4 picture eb22fbb4  ·  3Comments