Paypal Rest Api自定义物流地址(跳过填写物流地址)
PayPal之前的Rest Api是不支持自定义物流地址的,最新升级版本的提供了这个服务(Payment Experience),大概步骤如下:
1.申请一个自定义的配置ID
自定义配置包括Logo,Url,Shipping物流地址方案,允许填写备注等等
2.生成订单付款的时候,将该ID传送
示例代码在最新的SDK中都有Demo;如下:
一、Payment Experience Create
var apiContext = Configuration.GetAPIContext();
// Setup the profile we want to create
var profile = new WebProfile()
{
name = Guid.NewGuid().ToString(),
presentation = new Presentation()
{
brand_name = "Sample brand",
locale_code = "US",
logo_image = "https://www.paypal.com/"
},
input_fields = new InputFields()
{
address_override = ,
allow_note = true,
no_shipping =
}
,
flow_config = new FlowConfig()
{
bank_txn_pending_url = "https://www.paypal.com/",
landing_page_type = "billing"
}
};
// Create the profile
var response = profile.Create(apiContext);
#region Cleanup
// Cleanup by deleting the newly-created profile
var retrievedProfile = WebProfile.Get(apiContext, response.id);
retrievedProfile.Delete(apiContext);
#endregion
InputFields.no_shipping:
// 摘要:
// Determines whether or not PayPal displays shipping address fields on the
// experience pages. Allowed values: `0`, `1`, or `2`. When set to `0`, PayPal
// displays the shipping address on the PayPal pages. When set to `1`, PayPal
// does not display shipping address fields whatsoever. When set to `2`, if
// you do not pass the shipping address, PayPal obtains it from the buyer's
// account profile. For digital goods, this field is required, and you must
// set it to `1`.
如何传递用户的ShippingAddress?
ItemList itemList = new ItemList();
itemList.items = itms;
//设置运送地址
ShippingAddress payaddress = new ShippingAddress();
payaddress.city = temp.City + "," + temp.Province; payaddress.line1 = temp.Address1;
payaddress.line2 = temp.Address2;
payaddress.phone = temp.TelPhone;
payaddress.postal_code = temp.PostalCode;
payaddress.country_code = temp.Country;
payaddress.recipient_name = temp.FirstName + " " + temp.LastName; itemList.shipping_address = payaddress;

Paypal Rest Api自定义物流地址(跳过填写物流地址)的更多相关文章
- 配置IPv6地址跳变——网络测试仪实操
第一部分:什么是IPv6地址跳变? IPv6地址跳变是指IPv6地址进行一系列有规则的变化,Renix支持对IPv6地址进行递增.递减.列表和随机变化. 如当用户想要仿真大量的源IPv6地址变化的数据 ...
- Android 用 camera2 API 自定义相机
前言 笔者因为项目需要自定义相机,所以了解了一下 Android 关于 camera 这块的 API.Android SDK 21(LOLLIPOP) 开始已经弃用了之前的 Camera 类,提供了 ...
- 如何在网中使用百度地图API自定义个性化地图
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- 《ASP.NET Core跨平台开发从入门到实战》Web API自定义格式化protobuf
<ASP.NET Core跨平台开发从入门到实战>样章节 Web API自定义格式化protobuf. 样章 Protocol Buffers 是一种轻便高效的结构化数据存储格式,可以用于 ...
- Java 使用正则表达式取出图片地址以及跳转的链接地址,来判断死链(一)
任务:通过driver的getPageSource()获取网页的源码内容,在把网页中图片链接地址和跳转的url地址进行过滤,在get每个请求,来判断是否是死链 如图: 获取网页源码中所有的href,以 ...
- 百度地图API自定义地图
http://api.map.baidu.com/lbsapi/creatmap/index.html http://developer.baidu.com/map/index.php?title=w ...
- 网页嵌入百度地图和使用百度地图api自定义地图的详细步骤
在网页中插入百度地图 如果想在自己的网页上面加入百度地图的话,可以用百度地图的api.具体使用方法如下: 第一步:进入百度创建地图的网站http://api.map.baidu.com/lbsapi/ ...
- API之IP地址查询---权威的IP地址查询接口集合
原文地址:http://yushine.iteye.com/blog/1717586 推荐实用IP138 http://www.baidu.com/s?wd=IP&rsv_spt=1& ...
- 程序启动的目录不一样.ajax请求的地址跳转会出现的问题
程序启动的目录不一样.ajax请求的地址跳转会出现的问题启动 frontend/web/启动 frontend/ $.ajax({ url:"<?php echo Yii::$app- ...
随机推荐
- xss总结--2018自我整理
0x00前言 因为ctf中xss的题目偏少(因为需要机器人在后台点选手的连接2333),所有写的比较少 这里推荐个环境http://test.xss.tv/ 0x01xss作用 常见的输出函数:pri ...
- Maltego更新到4.1.6
Maltego更新到4.1.6 Maltego最近更新到4.1.6.由于Kali Linux软件源并没有提供此次更新包,用户需要进入Maltego进行手动更新.在起始页面中,双击状态栏右下角的黄色 ...
- linux manjaro 配置 pytorch gpu 环境
manjaro目前中国资料偏少,踩了很多坑. 安装gpu版本就这么几个步骤 1 安装英伟达的驱动cuda 2 安装 cudnn 3 安装支持gpu的pytorch 或者其他的运算框架 manja ...
- dns 监控系统 设计 dns安全威胁的可视化。
基于DNS大数据分析实现宽带共享监控系统.实现对宽带用户进行有效管理. 本系统基于DNS大数据分析实现宽带共享监控系统,包括以下方面. 1)数据采集:数据采集过程是通过探针采集的方式,从各地市的DNS ...
- PLSQL Developer的使用之对象浏览器
PLSQL Developer的使用之对象浏览器 (转自https://www.cnblogs.com/mq0036/p/6437834.html#point11) 能够显示与 PL/SQL 开发相关 ...
- Python3练习题系列(05)——设计和调试规则
If 语句的常见规则 1. 每一个“if 语句”必须包含一个else: 2. 如果这个else 永远都不应该被执行到,因为它本身没有任何意义,那你必须在else 语句后面使用一个叫做die 的函数,让 ...
- 公开课 之 tony 电子时钟 (课堂笔记)
# tony 之电子时钟from PyQt5.QtWidgets import QApplication, QWidget, QLCDNumber, QDesktopWidget, QVBoxLayo ...
- C++ 经典知识点面试题
1.指针的优点和缺点 优点:灵活高效 (1)提高程序的编译效率和执行速度(数组下标往下移时,需要使用乘法和加法,而指针直接使用++即可) (2)通过指针可使用主调函数和被调函数之间共享变量或数据结构, ...
- 关于Oracle游标out参数多层调用的BUG,ORA-06504
数据库版本 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit 测试代码 declare p_cur sys_refcu ...
- Docker machine(Docker 虚拟机)
安装docker [root@lianxi ~]# yum -y install docker 启动docker [root@lianxi ~]# systemctl start docker 下载D ...