2011-01-14 14 views
0

hallo jeder auf Ich habe paypal Integration während der Registrierung, d. H. Bezahlte Registrierung erstellt. meinen Code folgt in ModulIntegration von Paypal auf Drupal Website

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); 
          } 
      } 
} 

und für den Erfolg Rückkehr Seite

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); 
} 

hier alles funktioniert prima, aber die Daten nicht von PayPal zurück anzuzeigen.

wird jede Hilfe Dank

Antwort

0

Warum nicht einfach die vorhandene PayPal module für Drupal appriciated? Du erfindest das Rad hier neu.