我正在使用 PayPal Express Checkout 进行参考付款。现在,sdk 从资源文件 (sdk_config.properties) 加载 PayPal 凭据(用户 ID、密码、签名) - 有没有办法从代码中设置凭据(用户 ID、密码、签名)?
2 回答
I'm not familiar with their SDK but you should be able to just update the values of those constants or whatever types of variables they're using with your own dynamic values.
Alternatively, you might want to look into the Permissions API as it sounds like you're attempting to make calls on behalf of 3rd party users..??
我们在集成步骤上对 PayPal Java SDK 做了一些很好的改进。我们不再需要 sdk_config.properties 文件,因为它们不能很好地工作,特别是对于多配置设置。
现在,您只需使用 、 和 来创建一个APIContext
实例。从那里为任何 API 操作传递该上下文对象。clientId
clientSecret
mode
下面是代码的样子:
APIContext context = new APIContext(clientId, clientSecret, "sandbox");
Payment payment = new Payment();
// Fill in all the details.
payment.create(context);
这是解释该 wiki 页面:https ://github.com/paypal/PayPal-Java-SDK/wiki/Making-First-Call