1

我正在尝试在我的网站上进行定期付款。但我在这里遇到了问题。

它正在给出 ack=Fail

[TIMESTAMP] => 2012-06-21T04:36:01Z
[CORRELATIONID] => fe0a920b9dee5
[ACK] => Failure
[VERSION] => 65.1
[BUILD] => 3067390
[L_ERRORCODE0] => 11549
[L_SHORTMESSAGE0] => Start Date is required
[L_LONGMESSAGE0] => Subscription start date is required
[L_SEVERITYCODE0] => Error

而我正在传递的重新发生的代码是

function DoRecuringPayment($paymentInfo=array()){ 
    /** 
     * Get required parameters from the web form for the request 
     */ 

    $paymentType =urlencode('Sale'); 
     $firstName =urlencode($paymentInfo['Member']['first_name']); 
    $lastName =urlencode($paymentInfo['Member']['last_name']); 
     $creditCardType =urlencode($paymentInfo['CreditCard']['credit_type']); 
     $creditCardNumber = urlencode($paymentInfo['CreditCard']['card_number']); 
     $expDateMonth =urlencode($paymentInfo['CreditCard']['expiration_month']); 
    $padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT); 
     $expDateYear =urlencode($paymentInfo['CreditCard']['expiration_year']); 
     $cvv2Number = urlencode($paymentInfo['CreditCard']['cv_code']); 
    $address1 = urlencode($paymentInfo['Member']['billing_address']); 
     $address2 = urlencode($paymentInfo['Member']['billing_address2']); 
    $country = urlencode($paymentInfo['Member']['billing_country']); 
     $city = urlencode($paymentInfo['Member']['billing_city']); 
     $state =urlencode($paymentInfo['Member']['billing_state']); 
     $zip = urlencode($paymentInfo['Member']['billing_zip']); 

     $bperiod=urlencode( $paymentInfo['Bill']['month']); ;
     $bfrequency=urlencode($paymentInfo['bill']['frequency']);
    $amount = urlencode($paymentInfo['Order']['theTotal']); 
     $currencyCode="USD"; 
     $time22= date('Y-m-d',time());
     $startdate=urlencode(date('Y-m-d',time()));
     $paymentType=urlencode('Sale'); 

    $ip=$_SERVER['REMOTE_ADDR']; 

    /* Construct the request string that will be sent to PayPal. 
       The variable $nvpstr contains all the variables and is a 
       name value pair string with & as a delimiter */ 

      $nvpstr="&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=".$padDateMonth.$expDateYear."&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state".
"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode&PROFILESTARTDATE=$startdate&BILLINGPERIOD=$bperiod&BILLINGFREQUENCY=$bfrequency";


    /* Make the API call to PayPal, using API signature. 
       The API response is stored in an associative array called $resArray */ 
    $resArray=$this->hash_call("CreateRecurringPaymentsProfile",$nvpstr); 

    /* Display the API response back to the browser. 
       If the response from PayPal was a success, display the response parameters' 
       If the response was an error, display the errors received using APIError.php. 
       */ 

    return $resArray; 
    //Contains 'TRANSACTIONID,AMT,AVSCODE,CVV2MATCH, Or Error Codes' 
} 

我收到错误Subscription start date is required.

4

0 回答 0