Paypal Express Checkout API 方法 CreateRecurringPaymentsProfile - 客户帐户内的参数总计出现 0.00

Paypal Express Checkout API method CreateRecurringPaymentsProfile - the parameter total inside customer account appears 0.00

问题出在买家的贝宝账户上。问题是 Total 出现 $0.00 USD 而不是 $0.02。循环里面的金额设置为$0.02

这是我用 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'
);

我怎样才能让它工作?

实际上,您并未设置一些初始金额以立即向 customer.So 收取费用,定期配置文件已创建,将从下一个结算周期向客户收取 0.02 美元。 假设您每月向客户收取 100 美元,并且您希望在创建个人资料后立即在 API call.So 中设置初始金额 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);

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

您可以参考以下link了解更多信息:

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