Stripe payment has empty form action

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
iresults
Posts: 18
Joined: 28 Aug 2020, 13:36

Stripe payment has empty form action

Post by iresults » 28 Sep 2020, 16:40

Hello

We want to switch our main payment provider to Stripe.

The setup is working so far that we can click the buy-button and be forwarded to https://example.com/onlineshop/checkout/co/process where we can insert the credit card information (strangely without a field to insert the credit card owner).

Problem:
After we submit this form, a POST request to the same URL will be sent with a payload like `cp_payment=1&paymenttoken=tok_ABC123XYZ`, resulting in a page showing "You will now be forwarded to the next step". From there we can not proceed, because a click on the button brings us back to the same URL and we will see the credit card form again.

We noticed that the form on the final page "You will now be forwarded to the next step" has an empty action attribute:

Code: Select all

<form method="POST" action="">
Do you have an idea what the problem could be?

System:
TYPO3 9.5.21 / PHP 7.2
Aimeos TYPO3 Extension 20.7.3
aimeos/ai-payments 2020.07.2

iresults
Posts: 18
Joined: 28 Aug 2020, 13:36

Re: Stripe payment has empty form action

Post by iresults » 29 Sep 2020, 10:52

We now tried the setup using a Composer based TYPO3 installation. Unfortunately we experience the same issue.

I think we have tracked the problem down a bit further. We somehow slip into the else statement in https://github.com/aimeos/ai-client-htm ... d.php#L280, although the request's POST body has `cp_payment` set.

Code: Select all

if( $view->param( 'cs_order', null ) !== null )
{
    ...
}
elseif( $view->param( 'cp_payment', null ) !== null )
{
    ...
}
else
{
    // we are here
    return;
}

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Stripe payment has empty form action

Post by aimeos » 29 Sep 2020, 13:52

Is the "cp_payment" parameter missing so it uses the "else" case?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

iresults
Posts: 18
Joined: 28 Aug 2020, 13:36

Re: Stripe payment has empty form action

Post by iresults » 29 Sep 2020, 13:57

No, i don't think so. But it is sent as "Form data" and not as GET parameter (but I think it's the same for the Paypal provider)

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Stripe payment has empty form action

Post by aimeos » 29 Sep 2020, 14:12

That's no problem, you only have to find out why the URL for the form is missing
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

iresults
Posts: 18
Joined: 28 Aug 2020, 13:36

Re: Stripe payment has empty form action

Post by iresults » 29 Sep 2020, 14:17

Can you tell me where the request data will be "transferred" into the view? So maybe I could have a look, why it doesn't seem to be set in Process\Standard?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Stripe payment has empty form action

Post by aimeos » 29 Sep 2020, 14:21

Maybe there's a JS error somewhere. Stripe does send the payment data via JS and returns only a token. Afterwards, the customer should be redirected to the checkout confirm page.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

iresults
Posts: 18
Joined: 28 Aug 2020, 13:36

Re: Stripe payment has empty form action

Post by iresults » 29 Sep 2020, 14:32

The payment token that Stripe generates is also sent to the page alongside `cp_payment=1`...

There aren't any JS errors as far as I can tell.

Would it be possible to fix this via the professional support package?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Stripe payment has empty form action

Post by aimeos » 29 Sep 2020, 15:49

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Stripe payment has empty form action

Post by aimeos » 12 Oct 2020, 06:40

The problem has been fixed in latest aimeos/ai-client-html:2020.07 and in 2020.10
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply