我已经为 CreateRecurringPaymentsProfile 嵌入了这段代码,但是当我把这段代码放在 expresscheckout 模块(paypalwpp.php)中,然后在付款返回网站后显示空白页,任何人都可以解决这个问题,这里是代码。
  if(isset($_SESSION['r'])){
  $t =   $_SESSION['paypal_ec_token'];
  $amount = $_SESSION['total_amount'];
  $frequency = $_SESSION['r'];
  $d = date('c'); 
  $token = urlencode("$t");
  $paymentAmount = urlencode($amount);
  $currencyID = urlencode("USD");
  $startDate = urlencode("$d");
  $billingPeriod = urlencode("Week");
  $billingFreq = urlencode($frequency);
$nvpStr="&TOKEN=$token&AMT=$paymentAmount&CURRENCYCODE=$currencyID&PROFILESTARTDATE=$startDate";
$nvpStr .= "&BILLINGPERIOD=$billingPeriod&BILLINGFREQUENCY=$billingFreq";
$nvpStr .= "&DESC=Recurring Payment";
$httpParsedResponseAr = self::PPHttpPost('CreateRecurringPaymentsProfile', $nvpStr);
 if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" ==        strtoupper($httpParsedResponseAr["ACK"])) {
$profile_id = $httpParsedResponseAr['PROFILEID'];
$profile_id  = str_replace("%2d","-",$profile_id);
   $q = mysql_query("insert into recurring_profiles(profile_id) values('$profile_id')") or die(mysql_error());
 $recu_id = mysql_insert_id();
if($q){
    unset($_SESSION['total_amount']);
    $_SESSION['s'] = true;
    $_SESSION['recu_id'] = $recu_id;
}
else{
    echo "<h1>Sorry PROFILEID ERROR";
}
        //exit('CreateRecurringPaymentsProfile Completed Successfully:  '.print_r($httpParsedResponseAr, true));
    }    
    else  {
//echo "<br/><h1>Problem Occurs please shop again sorry for this inconvinence<br/>";
//exit('CreateRecurringPaymentsProfile failed: ' . print_r($httpParsedResponseAr,  true));
   }
   }