O'Reilly logo

PHP 5 e-commerce Development by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Payment method

The final configurable option for the customer is the payment method. We simply need to generate a list of available payment methods, and present them to the customer.

private function selectPayment()
{// If the customer has set the payment method, we save that and then redirect the customer.
if( isset( $_POST['eagle_payment'] ) )
{
$method = intval( $_POST['payment_method']);
$this->basket->setPaymentMethod( $method );
$this->registry->redirectUser('checkout/confirm/', 'Payment method saved', 'Your preferred payment method has been saved', false );
}

If the customer has not selected a payment method, we show them the list.

else { $this->registry->getObject('template')->getPage()-> addTag('pagetitle', 'Select your payment method'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required