Paypal 通过RESTAPI销售数字商品
我在我的网站上使用贝宝的RESTAPI进行数字交易。我已经全部安装好并开始工作,并且能够成功地接受一些用户的付款,并将他们的数字产品提供给他们。然而,到目前为止,PayPal将交易视为实物交易。我在REST文档中没有找到任何关于将事务标记为数字的内容。我的一个付款请求的示例如下所示:Paypal 通过RESTAPI销售数字商品,paypal,paypal-rest-sdk,Paypal,Paypal Rest Sdk,我在我的网站上使用贝宝的RESTAPI进行数字交易。我已经全部安装好并开始工作,并且能够成功地接受一些用户的付款,并将他们的数字产品提供给他们。然而,到目前为止,PayPal将交易视为实物交易。我在REST文档中没有找到任何关于将事务标记为数字的内容。我的一个付款请求的示例如下所示: { "intent": "sale", "redirect_urls": { "return_url": "http:\/\/www.googulator.com\/goPro?finishPurc
{
"intent": "sale",
"redirect_urls": {
"return_url": "http:\/\/www.googulator.com\/goPro?finishPurchase=true&googleid=123456789",
"cancel_url": "http:\/\/www.googulator.com\/goPro"
},
"payer": {
"payment_method": "paypal"
},
"transactions": [
{
"amount": {
"total": "5.00",
"currency": "USD"
},
"description": "PWYW Lifetime Googulator Pro",
"item_list": {
"items": [
{
"quantity": "1",
"name": "Lifetime Googulator Pro",
"price": "5.00",
"currency": "USD"
}
]
}
}
]
}
因此,我的问题是,REST API是否正确支持数字事务,还是我必须使用PayPal的经典API?REST API不正确或完全支持数字事务。请继续使用贝宝的经典API。请继续收看 REST API不正确或不完全支持数字事务。请继续使用贝宝的经典API。请继续收看 您至少可以通过创建体验档案来禁用配送, 我使用了一个名为Postman的应用程序在上向PayPal发送一个POST请求 使用此JSON数据:
{
"name": "AppName",
"presentation": {
"brand_name": "AppName Paypal",
"locale_code": "US"
},
"input_fields": {
"no_shipping": 1,
"address_override": 1
},
"flow_config": {
"landing_page_type": "login"
}
}
请注意,我使用了no_shipping 1,它禁用了shipping。我还将授权承载令牌与此POST请求一起发送
如果请求成功,那么您将获得新创建的体验配置文件的id。
该id在创建快速结帐付款时使用
"experience_profile_id":"experience_profile_id",
您至少可以通过创建体验配置文件来禁用配送, 我使用了一个名为Postman的应用程序在上向PayPal发送一个POST请求 使用此JSON数据:
{
"name": "AppName",
"presentation": {
"brand_name": "AppName Paypal",
"locale_code": "US"
},
"input_fields": {
"no_shipping": 1,
"address_override": 1
},
"flow_config": {
"landing_page_type": "login"
}
}
请注意,我使用了no_shipping 1,它禁用了shipping。我还将授权承载令牌与此POST请求一起发送
如果请求成功,那么您将获得新创建的体验配置文件的id。
该id在创建快速结帐付款时使用
"experience_profile_id":"experience_profile_id",
我知道为时已晚,但我会回答,以防其他人发现这个问题 这就是如何使用C#SDK 创建配置文件:
string createProfile(APIContext apiContext) {
var profile = new WebProfile()
{
name = Guid.NewGuid().ToString(),
input_fields = new InputFields()
{
no_shipping = 1
},
temporary = true
};
return profile.Create(apiContext).id;
}
然后在付款中设置此函数返回的ID:
var profileCreated = createProfile(apiContext);
Payment paymentParms = new Payment {
intent = "sale",
payer = new Payer
{
payment_method = "paypal"
},
redirect_urls = new RedirectUrls
{
return_url = WebConfig.WebSite.BaseUrl + "Paypal/Success",
cancel_url = WebConfig.WebSite.BaseUrl + "Paypal/Cancel",
},
experience_profile_id = profileCreated
};
我知道为时已晚,但我会回答,以防其他人发现这个问题 这就是如何使用C#SDK 创建配置文件:
string createProfile(APIContext apiContext) {
var profile = new WebProfile()
{
name = Guid.NewGuid().ToString(),
input_fields = new InputFields()
{
no_shipping = 1
},
temporary = true
};
return profile.Create(apiContext).id;
}
然后在付款中设置此函数返回的ID:
var profileCreated = createProfile(apiContext);
Payment paymentParms = new Payment {
intent = "sale",
payer = new Payer
{
payment_method = "paypal"
},
redirect_urls = new RedirectUrls
{
return_url = WebConfig.WebSite.BaseUrl + "Paypal/Success",
cancel_url = WebConfig.WebSite.BaseUrl + "Paypal/Cancel",
},
experience_profile_id = profileCreated
};
不想重复,但有更新吗?现在是2020年。。。我们仍然被迫对数字产品使用NVP方法。贝宝。。。。。我不想重复,但是有更新吗?现在是2020年。。。我们仍然被迫对数字产品使用NVP方法。贝宝。。。。。我最想知道的是,在使用RESTAPI时(即使使用上述体验配置文件),是否实际应用了数字商品的较低交易费用。因为在商户账户上设置数字商品的主要原因之一是每笔支付的交易费用较低。我最想知道的是,在使用REST api时(即使使用上述体验模式),是否实际应用了数字商品的较低交易费用。因为在商户账户上设置数字商品的主要原因之一是每笔支付的交易费用较低。