Forum
Multiple payment options
Hi there,
Our client is using the shop app to book swimming holidays, they have asked the question whether its possible to have multiple payment options i.e.
- Stripe
- PayPal
- Pay by Cheque
Is this possible? Currently I have my checkout page set up using the stripe payment gateway
<?php
if (!perch_member_logged_in()) {
PerchSystem::redirect('/shop/register');
}
if (perch_member_logged_in() && perch_post('stripeToken')) {
// your 'success' and 'failure' URLs
$return_url = '/shop/result';
$cancel_url = '/shop';
perch_shop_checkout('stripe', [
'return_url' => $return_url,
'cancel_url' => $cancel_url,
'token' => perch_post('stripeToken')
]);
}
// Include the header. You can find this in tempates/layouts/global
perch_layout('global/header');
?>
<div class="canvas">
<?php
// Show the cart with a non-interactive template
perch_shop_cart([
'template'=>'cart/cart_static.html'
]);
perch_shop_order_address_form();
?>
<div class="content clear row">
<?php
// Display the form with the T&Cs checkbox
// perch_shop_form('checkout/confirm.html');
perch_shop_payment_form('stripe');
?>
</div>
<?php
// Include the footer. You can find this in tempates/layouts/global
perch_layout('global/footer');
?>
</div> <!-- Closes Canvas Div -->
<script src="/assets/build/js/main.min.js"></script>
</body>
</html>
If its possible how would I go about integrating it into my template.
Thanks
Yes, you can do that. How you implement it depends on how you want the process to work in your user interface.
Basically the process would be, once the customer arrives at checkout. They would see
Then its up to the customer the best one that suits them.
Thanks
Yes, I've done that. It's a case of working out the flow and writing a bit of code to let people pick then sending them through the right process.
It mostly is a job of deciding what you want the experience of the customer to be. I'd start with that :)
Hi Damien,
Like you I currently have Stripe set up, and want to add a Paypal button next to the Stripe one at the last stage of checkout. I will be working on it this week, I will let you know if I work it out!
Hi,
I have this, which works, though I am not sure if it is the best approach. Have this at the top of the page:
And then this to set the
POST
:Got that next to the
perch_shop_payment_form('stripe');
so the two buttons are next to each other.Seems ok?