set('checkout',$this->co) ->set('cart',$co); $output .= Form::open(sprintf('https://%s/cgi-bin/webscr',$this->test_mode ? $this->url_test : $this->url_prod),array('method'=>'POST')); $output .= Form::hidden('cmd','_cart'); $output .= Form::hidden('business',$this->test_mode ? 'deon_1260578114_biz@graytech.net.au' : 'deon@graytech.net.au'); $output .= Form::hidden('bn','Graytech_BuyNow_WPS_AU'); $output .= Form::hidden('cancel_return',URL::site('checkout/cancel/'.$this->co->id,TRUE)); $output .= Form::hidden('custom',$co->id()); // @todo This should be dynamic $output .= Form::hidden('currency_code','AUD'); $output .= Form::hidden('notify_url',URL::site('checkout/notify/'.$this->co->id,TRUE)); $output .= Form::hidden('return',URL::site('checkout/after/'.$this->co->id,TRUE)); $output .= Form::hidden('upload','1'); $c = 1; foreach ($co->contents() as $cio) { $output .= Form::hidden('item_number_'.$c,$cio->id); $output .= Form::hidden('item_name_'.$c,$cio->item()->i); $output .= Form::hidden('amount_'.$c,$cio->item()->t); $c++; } $output .= Form::hidden('item_number_'.$c,'0:PAYFEE'); $output .= Form::hidden('item_name_'.$c,'Paypal Fee'); $output .= Form::hidden('amount_'.$c,$this->co->fee($co->total())); $output .= Form::submit('submit','Pay Now'); $output .= Form::close(); return $output; } } ?>