【问题标题】:Paypal Express Checkout API method CreateRecurringPaymentsProfile - the parameter total inside customer account appears 0.00Paypal Express Checkout API 方法 CreateRecurringPaymentsProfile - 客户账户内的参数 total 出现 0.00
【发布时间】:2015-09-12 08:15:31
【问题描述】:

问题出在买家的 paypal 帐户中。问题是 Total 出现 $0.00 USD 而不是 $0.02。循环内的金额设置为 $0.02

这是我用 CreateRecurringPaymentsProfile 设置的参数:

$padata = array(
'L_PAYMENTREQUEST_0_NAME0' => '我的产品',
'PROFILEREFERENCE' => 'RPInvoice123',
'PROFILESTARTDATE' => date('Y-m-d') . 'T' . date('H:i:s').'Z',
'SUBSCRIBERNAME' => 'Mr Sub Scriber',
'TOKEN' => urlencode($token),
'DESC' => '我的产品 + 第二个产品',
'AMT' => '0.02',
'BILLINGPERIOD' => '月',
'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_BILLINGAGREEMENTDESCRIP TION0' => '我的产品 + 第二个产品',
'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => '数字'
);

我怎样才能让它工作?

【问题讨论】:

    标签: php paypal express-checkout recurring


    【解决方案1】:

    如果您想在创建循环配置文件时收取初始金额,则需要传递变量“INITAMT=0.02”,它将显示在您附加的图片的第一行。这将是一次性收费,对常规经常性金额没有影响。

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

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

    【讨论】:

    • 非常感谢 Eshan,这正是我想要的
    【解决方案2】:

    实际上,您并没有设置一些初始金额以立即向客户收取费用。因此,循环配置文件已创建,并将从下一个计费周期向客户收取 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);
    

    【讨论】:

    • 你知道初始金额相关的API方法吗?或者可能是一些与 CreateRecurringPaymentsProfile 方法相关的附加参数?
    • 我使用了 Paypal 文档中的 PHP Mercahnt SDK 并使用 SOAP not named value 来进行 API 调用示例代码就像上面的答案
    猜你喜欢
    • 1970-01-01
    • 2014-03-03
    • 2016-10-02
    • 2012-10-28
    • 2010-12-26
    • 1970-01-01
    • 2014-12-26
    • 2020-06-26
    • 2012-07-01
    相关资源
    最近更新 更多