tribulant

Virtual Merchant

May 3rd, 2011
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. case 'virtualmerchant'      :                          
  2.                                 global $wpcoDb, $Order;
  3.                                 $success = false;
  4.                            
  5.                                 if (!empty($_POST)) {
  6.                                     if ($_POST['ssl_result'] == 0) {
  7.                                         if (!empty($_POST['ssl_invoice_number'])) {
  8.                                             $order_id = $_POST['ssl_invoice_number'];
  9.                                             $wpcoDb -> model = $Order -> model;
  10.                                            
  11.                                             if ($order = $wpcoDb -> find(array('id' => $order_id))) {
  12.                                                 if ($Order -> total($order_id, true, true, true, true, false) == $_POST['ssl_amount']) {
  13.                                                     $success = true;
  14.                                                     $order -> pmethod = $pmethod = "virtualmerchant";
  15.                                                     $user_id = $order -> user_id;  
  16.                                                 }
  17.                                             }
  18.                                         }
  19.                                     } else {
  20.                                         $message = __('Transaction was not approved, please try again', $this -> plugin_name);
  21.                                     }
  22.                                 } else {
  23.                                     $message = __('No data was posted back from the payment gateway', $this -> plugin_name);   
  24.                                 }
  25.                                 break;
Advertisement
Add Comment
Please, Sign In to add comment