贝宝PHP-不设置运费 [英] PayPal & PHP - Set no shipping

查看:65
本文介绍了贝宝PHP-不设置运费的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用其REST API通过PayPal创建付款.

I'm in the process of creating a payment with PayPal with their REST API.

我已经完成所有工作并可以正常工作,但是当我创建WebProfile并调用setNoShipping(1)时,什么都没有改变:

I have everything set up and working but when I create a WebProfile and call setNoShipping(1), nothing changes:

我的代码:

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

$webProfile = new WebProfile();
$webProfile->setName('test' . uniqid())->setInputFields($inputFields);

并且根据这篇关于StackOverflow的帖子不可能,但是1年后仍然吗?

And according to this post on StackOverflow it's not possible, but is that still the case 1 year later?

推荐答案

我遇到了同样的问题,但经过一些研究和许多尝试,错误,我可以使用它.

I had the same problem but after some research and many try & error i got it to work.

您必须创建"配置文件并将其ID添加到付款"中.

You have to "create" the profile and add its id to the Payment.

[...]
$webProfileId = $webProfile->create($apiContext)->getId();

$payment = new Payment();
$payment->setExperienceProfileId($webProfileId);

这篇关于贝宝PHP-不设置运费的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆