5

I feel like I've read quite a few threads of people wanting help with adding a gateway, but I haven't seemed to find any solution that's been shared once the asker figured out the answer. I know there have been suggestions to look at the Payum Bundle docs too, but since I can't figure out how exactly Sylius is integrating with the Payum Bundle, I'm not able to receive much help from the payum docs. Would someone be able to help explain what is necessary to get PayPal Pro to work in the sylius app?

I've added this to the config file:

payum:
    contexts:
        paypal_pro:
            omnipay:
                type: PayPal_Pro
                options:
                    username:  %paypal.username%
                    password:  %paypal.password%
                    signature: %paypal.signature%
                    testMode:  %paypal.test_mode%
            storages:
                Sylius\Component\Core\Model\Order:
                    doctrine:
                        driver: orm
                Sylius\Component\Core\Model\Payment:
                    doctrine:
                        driver: orm

and this in my services.yml file:

sylius.payum.paypal.action.capture_payment_using_credit_card:
    class: %sylius.payum.paypal.action.capture_payment_using_credit_card.class%
    tags:
        - { name: payum.action, factory: omnipay }

For the CapturePaymentUsingCreditCardAction class, I just copied over Sylius's Stripe one. I thought this would be enough since Stripe was said to work out of the box as well. When I input the fake credit card information (we're in sandbox mode), I just get an "Unknown payment error" flash message after I'm redirected to the payment method selection page. From what I understand from reading this thread, the states are automatically managed by the state machine. I had added a PaymentStatusAction briefly (copied over from the Dummy class and var_dumping what the details held), but that didn't do anything to help.

Also, would someone be able to explain the need for ExecuteSameRequestWithDetailsAction? It looks almost the same as something like CapturePaymentUsingCreditCardAction.

sabliao
  • 137
  • 3
  • 10
  • 1
    I've just tested a stripe payment in sylius master. Got same "Unknown payment error". So I think it is not the bug in your code. – Maksim Kotlyar May 31 '14 at 11:16
  • 1
    Try to use this branch https://github.com/Sylius/Sylius/pull/1539. Works for me there. – Maksim Kotlyar May 31 '14 at 11:17
  • 1
    Thanks @MaksimKotlyar! Glad to see it got merged to master. After pulling that change, the nice green success flash message was displayed. (: – sabliao Jun 02 '14 at 22:00
  • I know this is an old question, but would you be willing to share your Sylius-PayPalPro integration? I am in the same situation, and can't get it to work no matter how much I try. :( – liviucmg Aug 11 '15 at 21:16
  • 1
    @liviucmg it's been a while since I've done anything w/ sylius or worked with it, but from the looks of my question & subsequent comment, I was able to get it to work using the config and service definitions shown above as well as copying over the Sylius Stripe class for the necessary CapturePaymentUsingCreditCardAction class. Since it's much later now, I assume you have the latest version of Sylius that has the fix for the bug I was encountering last year, so that should no longer be the problem. If this wasn't enough, you might want to start a new question w/ details specific to your setup – sabliao Aug 12 '15 at 17:17

0 Answers0