根据用户的送货地址设置运费 Paypal REST API [英] Set shipping fee based on user's shipping address Paypal REST API

查看:18
本文介绍了根据用户的送货地址设置运费 Paypal REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我不能 100% 确定这是这个问题的正确位置.因此,如果不让我知道,我将在此处删除此问题.

First, i don't 100% sure that this is the right place for this question. So if it is not let me know i will remove this question for here.

我使用 PAYPAL REST API 来允许用户选择产品并付款.

I am using PAYPAL REST API to allow user select a product and pay for it.

我正在寻找按用户所在国家/地区(送货地址)设置运费的选项.例如,如果运送到以色列的费用是 3 美元如果在以色列境外运送费用为 5 美元

I am looking for an option to set a shipping fee by user's country (shipping address). For example if shipping to Israel fee is 3$ If shipping outside Israel fee is 5$

但我不想让他在我的网站上输入他的送货地址.

But i don't want him to input his shipping address in my website.

在 Paypal 中,用户可以保存多个送货地址.我想根据他选择的预定义送货地址更改运费.

In Paypal, user can have several saved shipping address. I would like to change the shipping fee based on his selected pre-defined shipping address.

这能做到吗?

我查看了 Paypal API,我看到了将送货地址和费用发送到 Paypal REST API 的选项,但我再次不希望他在我的网站中输入送货地址.

I have looked in the Paypal API and I saw the option of sending shipping address and fee to Paypal REST API, but again i don't want him to input the shipping address in my website.

推荐答案

由于您不确定客户要将商品运送到哪里,因此您在客户授权付款后从 PayPal 获取送货地址.REST API 将向您返回付款详细信息,包括送货地址.

As you do not know for sure where the customer is going to ship the item, you obtain the shipping address from PayPal after the customer has authorized the payment. The REST API will return the payment details to you, including the shipping address.

获取该送货地址并让您的系统确定送货金额.在您网站上的确认页面上向客户显示此信息,当客户同意金额时,运行/execute 命令,并在运输金额中包含一个新的金额对象.然后,您将使用正确的国家/地区运费使用新的总金额完成付款.

Take that shipping address and have your system determine the shipping amount. Display this to the customer on a confirmation page on your site and when the customer agrees to the amount, run the /execute command, and include a new amount object with the shipping amount. You will then complete the payment with the new total with the correct country shipping.

这篇关于根据用户的送货地址设置运费 Paypal REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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