dthy81285 2015-03-11 16:08
浏览 30

应用Paypal Web配置文件禁用“以访客身份退房”

I am trying to create a paypal payment page, but for some reason when I try to add a custom web profile to the payment the option of checking out as a guest suddenly disappears.

First I am creating the web profile this way:

        $flowConfig = new FlowConfig();
        $flowConfig
            ->setLandingPageType("billing")
            ->setBankTxnPendingUrl("...");
        $presentation = new Presentation();
        $presentation
            ->setLogoImage("...")
            ->setBrandName("...")
            ->setLocaleCode("...");

        $inputFields = new InputFields();
        $inputFields
            ->setNoShipping(1)
            ->setAddressOverride(0);

        $webProfile = new WebProfile();
        $webProfile->setName("PROFILE" . uniqid())
            ->setFlowConfig($flowConfig)
            ->setPresentation($presentation)
            ->setInputFields($inputFields);
        $request = clone $webProfile;

        try {
            $createProfileResponse = $webProfile->create($apiContext);
        } catch (PayPal\Exception\PayPalConnectionException $ex) {
            ...
        }
        $profileId = $createProfileResponse->getId();

Then, I have updated the payment code in this way

        $paypalPayment = new PayPalPayment();
        $paypalPayment->setIntent("sale");
        $paypalPayment->setPayer($payer);
        $paypalPayment->setRedirectUrls($redirectUrls);
        $paypalPayment->setTransactions(array($transaction));
        $paypalPayment->setExperienceProfileId($profileId);

The weird thing is that if I comment the last line I can perform payments as a guest without any issue. If, instead, I leave it this way, I get the customized page but the "Check out as a guest" button is replaced by "Create an account".

Do I really have to choose between having a customized checkout page and the possibility to perform payments without creating paypal accounts? Or am I missing something? I didn't find anything related to this issue in the documentation nor here in stackoverflow, and it seems at least strange!

Thank you

  • 写回答

1条回答 默认 最新

  • drvjlec1767 2015-03-12 09:07
    关注

    Are you using Express Checkout? It looks like recurring payments without a PayPal account are only compatible with Website Payments Pro accounts.

    You can still create recurring payments with EC but they will need a PayPal account to accept them, no guest checkout allowed by the looks of it.

    https://www.paypal-community.com/t5/Merchant-services-Archive/How-to-accept-recurring-payments-from-buyers-who-don-t-have-a/td-p/178232

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么