2011-01-14 57 views
0

嗨,您好每一個 我已經創建了paypal集成,同時註冊,即付費註冊。 我的代碼是按照模塊在Drupal站點上整合paypal

function paidregistration_user($op, &$edit, &$account, $category = NULL){ 

       switch ($op) { 
     case 'validate': { 

           $paypal = array(); 
           $paypal['cmd'] = '_xclick'; 
           $paypal['business'] = '[email protected]'; // doing this here prevents email harvesting 
           $paypal['page_style'] = 'Primary'; 
           $paypal['bn'] = 'PP-DonationsBF'; 
           $paypal['item_name'] = 'Donation'; 
           $paypal['amount'] = '200'; 
           $paypal['currency_code'] = 'USD'; 
           $paypal['no_shipping'] = '1'; 
           $paypal['tax'] = '0'; 
           $paypal['lc'] = 'US'; 
           $paypal['rm'] = '1'; 
           $paypal['return'] = 'http://localhost/drupaldemo/pay'; 
           $paypal['cancel_return'] = 'http://localhost/drupaldemo/user/register'; 

           // Append the Paypal data to the $form_values['submitted_tree'] 
           $data = array_merge($edit, $paypal); 

           // Put the data in a query string 
           $query = http_build_query($data, '', '&'); 

           // Set the URL to Paypal's processing site and append the query string 
           $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?' .$query; 
           drupal_goto($url); 
           print_r($_REQUEST); 
           // Set the webform's confirmation page to Paypal 
           //$node->webform['confirmation'] = $url; 

      //drupal_goto();exit; 
          } 
      case 'insert' :{ 
          print_r($_REQUEST); 
          } 
      } 
} 

併成功返回頁面

function imagemenu_menu() 
{ 
    $items['imagemenu'] = array(
    'title' => 'Add Image', 
    'type' => MENU_NORMAL_ITEM, 
    ); 

    $items['pay'] = array(
     'title' => 'Add Image', 
     'access arguments' => array('all'), 
     'page callback' => 'pay', 
     'type' => MENU_NORMAL_ITEM, 
    ); 

return $items; 
} 





function imagemenu_perm() 
{ 
    return array('all'); 
} 

function pay() 
{ 
    print_r($_REQUEST); 
} 

這裏每一件事情是工作的罰款,但不顯示來自PayPal返回的數據。

任何幫助將appriciated 感謝

回答