[SOLVED] E-Commerce bundle advanced demo gets stalled on payment step

#1

Hello,
I downloaded the advanced demo from pimcore website, because I wanted to try the e-commerce bundle on my local machine, but when I try to buy a product and complete the checkout process, it always says “failure during payment”.

I tried modifying the controller that has the configuration of the url for accessing the payment method, but it still doesn’t work.

Anyone knows a way of fixing this? I read the docs but im stuck and cant find a solution.
Thanks in advance!

0 Likes

#2

Hi,
does the payment provider integration open, or do you get the error message right away?
Which payment provider are you using?
Any additional info in the logs?

BR
Christian

0 Likes

#3

Hi,
the payment provider integration doesn’t open; the error message appears when I complete the confirm step (the one with a checkbox) and im redirected automatically to the provider, but it always gives me the error and turns me back to the confirm step.

The update-payment.log gives me this message

2019-03-26T17:11:31+0100 : Update payment called with status: Pimcore\Bundle\EcommerceFrameworkBundle\PaymentManager\Status Object
(
[status:protected] => cancelled
[internalPaymentId:protected] => payment_3368268518-1~12480
[paymentReference:protected] =>
[message:protected] => CONFIRMURL is invalid.
[data:protected] => Array
(
[qpay_amount] =>
[qpay_paymentType] =>
[qpay_paymentState] => FAILURE
[qpay_response] => Array
(
[mode] => failure
[message] => CONFIRMURL is invalid.
[consumerMessage] =>
[paymentState] => FAILURE
[orderIdent] => payment_3368268518-1~12480
[submitbutton] =>
[_token] => 2UwHiiRAjPXSX7Pgz9TGOzs4Ie53PXNQyxHPvotYHcM
)

    )

)

2019-03-27T15:35:42+0100 : Update payment called with status: Pimcore\Bundle\EcommerceFrameworkBundle\PaymentManager\Status Object
(
[status:protected] => cancelled
[internalPaymentId:protected] => payment_3702121855-1~12483
[paymentReference:protected] =>
[message:protected] => CONFIRMURL is invalid.
[data:protected] => Array
(
[qpay_amount] =>
[qpay_paymentType] =>
[qpay_paymentState] => FAILURE
[qpay_response] => Array
(
[mode] => failure
[message] => CONFIRMURL is invalid.
[consumerMessage] =>
[paymentState] => FAILURE
[orderIdent] => payment_3702121855-1~12483
[_token] => OYTlIQeCADODiipQBq7e1ybrCtUBrWNaEg5ucU4uwWA
)

    )

)

I tried to modify manually the confirm URL in the code for the correct URL, but still didn’t worked; although it gave me a success as a response when I putted it on the browser with the special code.

Thanks

0 Likes

#4

Hi,
the confirm URL is set in the controller, when payment config is created … see here.

How does your confirm URL look like?

BR
Christian

0 Likes

#5

Hi,

I changed the URL to see if it worked that way, because in the browser it gave me a ‘success’ as a response when I typed it with the token, but when I typed it on the controller I still had the same error.

I put in comments the lines of code that originally were there

elseif ($payment instanceof QPay) {
            // wirecard
            $url = $request->getSchemeAndHttpHost() . $this->generateUrl('action', ['controller' => 'payment', 'action' => 'payment-status', 'prefix' => $language]) . '?mode=';
            
            $config = [
                'language' => $language,
                'successURL' => $url . 'success',
                'cancelURL' => $url . 'cancel',
                'failureURL' => $url . 'failure',
                'serviceURL' => $url . 'service',
                //'confirmURL' => $request->getSchemeAndHttpHost() . $this->generateUrl('action', ['controller' => 'handle-payment', 'action' => 'server-side-q-pay', 'prefix' => $language, 'elementsclientauth' => 'disabled']),
                'confirmURL' => $request->getSchemeAndHttpHost() . $this->generateUrl('action', ['controller' => 'handlePayment', 'action' => 'server-side-q-pay', 'prefix' => $language, 'elementsclientauth' => 'disabled']) . "&orderIdent=" . $paymentInformation->getInternalPaymentId(),
                'confirmMail' => 'christian.fasching@pimcore.com',
                'orderDescription' => 'My Order at pimcore.org',
                'imageURL' => 'https://www.pimcore.org/static/css/skins/default/logo.png',
                'orderIdent' => $paymentInformation->getInternalPaymentId()
            ];
        }

Thank you

0 Likes

#6

Hi,
actually this is a error message that we get from wirecard, so you would need to check that with them. What is your url, is it a valid domain, or something like localhost, IP-address or something like that?

But actually, confirmURL is optional, so you could remove it completely to just test it. In production, it is highly recommended though.

BR
Christian

0 Likes

#7

It works now! It was just like you said, I put the confirmURL as a comment and I could complete in the demo the payment and the order this time.

Thanks for the support!

0 Likes