Forum
Missing Arguement on Checkout
Hi,
I am using the shop app and have built the checkout system with Stripe integration. The operation of the checkout and payment works with notifications coming into Perch and Stripe when I test payments.
I am, however getting this error coming up below the checkout form and Stripe payment button.
Warning: Missing argument 1 for perch_shop_checkout(), called in /home/airpiie/public_html/checkout.php on line 94 and defined in /home/airpiie/public_html/perch/addons/apps/perch_shop/runtime/cart.php on line 172
On my checkout.php page the code on line 94 is: <?php perch_shop_checkout(); ?>
On my ../runtime/cart.php the code on line 172 is: function perch_shop_checkout($gateway, $opts=[], $address='stripe')
I changed the $address= from 'default' to 'stripe' but there is no difference.
Thanks, Orla
You need to pass the name of the gateway and the success and failure URLs (as an options array) to
perch_shop_checkout()
.If you look at the Stripe gateway page in the documentation, it gives an example of how to do this.
Hi Drew,
Thanks.
I should have put more info in original question. I have the following code at top of my checkout.php page;
and this in body:
Am I confined to using the success/failure URls as in docs (as below) or can I use my own (as above)?
That's fine, but in the body where you have this:
It should just be:
Ah, so simple! That's worked perfectly.
Thanks! Orla