PayPal API with Laravel - Updating of data(带有 Laravel 的 PayPal API - 数据更新)
问题描述
我正在尝试使用 Laravel 5.1
实现 PayPal 支付
的 API
.但是当我登录到 PayPal (sandbox)
时,它使用我在我的帐户中使用的地址,并且它使用来自 PayPal 帐户的名称而不是来自我网站的数据.那是我的问题.
我想使用我网站上的数据,因为如果我从我的网站输入送货地址(例如)而不使用它是没有意义的.请参阅下面的代码以供参考(或在下面评论我的一些详细信息).
我还查看了此链接,但它似乎无法回答我的问题.另外,如果
国家有一个省怎么办?我们如何添加?
更新 1
- 添加了新的
Patch()
类. - 编辑了
Try Catch
中的代码.
<小时>
注意:accepted
答案也将收到 bounty
加上 up
.
使用教程更新 2
对于 PHP/Laravel(我目前使用的是 v5.1),安装这个包paypal/rest-api-sdk-php
在 PayPal 中创建沙盒帐户.选择使用 Paypal 购买.
继续直到看到选项,选择购物世界.
登录developer.paypal.com.
点击账户.点击创建账户.
选择你想要的国家.在帐户类型中选择个人(买方帐户).
添加邮箱地址,避免使用
-
.改用_
.输入您想要的 PayPal 余额.
点击创建帐户.
让它成为现实?
https://github.com/paypal/PayPal-PHP-SDK/wiki/上线
创建付款后,尝试更新地址,如这个例子.
<块引用>
我也查看了此链接,但它似乎无法回答我的问题.另外,如果国家有一个省呢?我们如何添加?
使用此处列出的州代码.
I'm trying to implement the API
of PayPal payment
with Laravel 5.1
. But when I log in to PayPal (sandbox)
, it uses the address I used in my account, and also it uses the name from PayPal account not the data from my website. That's my problem.
I want to use the data from my website because it doesn't make sense if I enter the shipping address (for example) from my website and not using it. Please see my code below for reference (Or comment down below for some details from me).
I also reviewed this link but it seems like it cannot answer my problem. Also, what if
the country has a province? How can we add that?
Update 1
- Added new
Patch()
class. - Edited Code in
Try Catch
.
Note: The accepted
answer will also receive the bounty
plus the up
.
Update 2 with Tutorial
For PHP/Laravel (I'm currently using v5.1), install this package paypal/rest-api-sdk-php
Create Sandbox account in PayPal. Choose Buy with Paypal.
Continue until you see options, choose Shop the world.
Login to developer.paypal.com.
Click Accounts. Click Create Account.
Choose what country you want. Choose Personal (Buyer Account) in Account Type.
Add email address, avoid to use
-
. Use_
instead.Enter how much PayPal Balance you want.
Click Create Account.
Make it live?
https://github.com/paypal/PayPal-PHP-SDK/wiki/Going-Live
After you have created the payment, try updating the address as shown in this example.
I also reviewed this link but it seems like it cannot answer my problem. Also, what if the country has a province? How can we add that?
Use the state codes listed here.
这篇关于带有 Laravel 的 PayPal API - 数据更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!