order total from within hook_payment_method?

Posts: 16
Joined: 01/19/2008

Is there a way to get the order total from within a hook_payment_method function?

Thanks,
Shane

Posts: 5617
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Glad you asked. Smiling I know the payment method docs are a little spotty here.

Your second argument should be a reference to the order object. Depending on which $op you're in, it will mostly contain a fully loaded order which includes a property called order_total that you should be able to check like so:

<?php
if ($arg1->order_total > 100) {
  print
'The order is more than $100.';
}
?>

Posts: 16
Joined: 01/19/2008

Thanks Ryan.