Paypal Express Checkout API方法CreateRecurringPaymentsProfile - 客户帐户内的参数总计显示为0.00

时间:2015-09-12 08:15:31

标签: php paypal express-checkout recurring

问题出在买方paypal帐户中。问题是Total显示 $ 0.00 USD $ 0.02 。重复出现的金额设置为 $ 0.02 enter image description here

这是我使用CreateRecurringPaymentsProfile设置的参数:

$padata = array(
'L_PAYMENTREQUEST_0_NAME0' => 'My Product',
'PROFILEREFERENCE' => 'RPInvoice123',
'PROFILESTARTDATE' => date('Y-m-d') . 'T' . date('H:i:s').'Z',
'SUBSCRIBERNAME' => 'Mr Sub Scriber',
'TOKEN' => urlencode($token),
'DESC' => 'My Product + Second Product',
'AMT' => '0.02',
'BILLINGPERIOD' => 'Month',
'BILLINGFREQUENCY' => '1',
'TOTALBILLINGCYCLES' => '12',
'REGULARTOTALBILLINGCYCLES' => '1',
'VERSION' => '74.0',
'MAXFAILEDPAYMENTS' => '1',
'L_PAYMENTREQUEST_0_AMT0' => '0.02',
'L_PAYMENTREQUEST_0_NUMBER0' => '10101',
'L_PAYMENTREQUEST_0_QTY0' => '1',
'L_BILLINGTYPE0' => 'RecurringPayments',
'L_BILLINGAGREEMENTDESCRIPTION0' => 'My Product + Second Product',
'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => 'Digital'
);

我怎样才能使这个工作?

2 个答案:

答案 0 :(得分:0)

实际上,您并未设置一些初始金额,以便立即向客户收费。因此,重复的个人资料将被创建,并将从下一个结算周期向客户收取0.02美元。 假设您每月向客户收取100美元的费用,并且您希望在API调用中立即向首先收取100美元的费用。因此,在创建配置文件后,将向该配置文件发送100美元(或您希望第一次向客户收取的任何其他金额)交易。 。 SOAP API调用示例

$profileDetails = new RecurringPaymentsProfileDetailsType();
$profileDetails->BillingStartDate = gmdate("Y-m-d\TH:i:s\Z");
$profileDetails->ProfileReference = 'user_id=' . $_SESSION['userid'].'|plan_id='.$_SESSION['plan_id'];
$activationDetails = new ActivationDetailsType();
/*
 * (Optional) Initial non-recurring payment amount due immediately upon profile creation. Use an initial amount for enrolment or set-up fees.
 */
$activationDetails->InitialAmount = new BasicAmountType($this->currency, $_SESSION['amount']);

$paymentBillingPeriod = new BillingPeriodDetailsType();
$paymentBillingPeriod->BillingFrequency = 1;
$paymentBillingPeriod->BillingPeriod = "Month";
$paymentBillingPeriod->Amount = new BasicAmountType($this->currency, $_SESSION['amount']);

$scheduleDetails = new ScheduleDetailsType();


$scheduleDetails->Description = "recurring";
$scheduleDetails->PaymentPeriod = $paymentBillingPeriod;
$scheduleDetails->ActivationDetails = $activationDetails;

$createRPProfileRequestDetails = new CreateRecurringPaymentsProfileRequestDetailsType();
$createRPProfileRequestDetails->Token = $_SESSION['token'];

$createRPProfileRequestDetails->ScheduleDetails = $scheduleDetails;
$createRPProfileRequestDetails->RecurringPaymentsProfileDetails = $profileDetails;

$createRPProfileRequest = new CreateRecurringPaymentsProfileRequestType();
$createRPProfileRequest->CreateRecurringPaymentsProfileRequestDetails = $createRPProfileRequestDetails;

$createRPProfileReq = new CreateRecurringPaymentsProfileReq();
$createRPProfileReq->CreateRecurringPaymentsProfileRequest = $createRPProfileRequest;

$config = array(
    'mode' => $this->environment,
    'acct1.UserName' => $this->username,
    'acct1.Password' => $this->password,
    'acct1.Signature' => $this->signature
);
$paypalService = new PayPalAPIInterfaceServiceService($config);
$createRPProfileResponse = $paypalService->CreateRecurringPaymentsProfile($createRPProfileReq);

答案 1 :(得分:0)

你需要传递变量" INITAMT = 0.02"如果您想在创建周期性配置文件时收取初始金额,它将显示在您附加的图像的第一行中。这将是一次性收费,对正常的经常性金额没有影响。

您可以参考以下链接获取更多信息:

https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/