- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正尝试在 PayPal Adaptive Payments API 中使用负数。首先,这似乎可行:
'item' => [
{
'itemPrice' => '25.00',
'name' => 'Cryptex - 16Gb USB Drive',
'price' => '25',
'itemCount' => 1
},
{
'quantity' => 1,
'name' => 'Special Discount',
'price' => '-2.50'
},
{
'itemPrice' => '5.00',
'name' => 'Shipping',
'price' => '5.00',
'itemCount' => 1
}
]
这是我在将其作为 JSON 提交并更新项目后看到的示例:
如您所见,价格是是正确的……但没有折扣金额的迹象?显然考虑到了这一点 - 否则价格将是 30 英镑,而不是 27.50 英镑(在 2.50 英镑折扣之后)
什么给了?这是 PayPal 系统中的错误吗?
FWIW,电子邮件也已损坏 - 它们根本不显示折扣金额。
更新:我已经向 PayPal 技术支持开具了一张罚单,因为我很确定这是他们系统的一个错误,而且目前无法修复 :( 真烦人!
更新 2: 来自 PayPal 的回复:
PayPal Adaptive Payments do not support negative item values. Since you did not pass the <itemPrice> in your API Call, the system did not throw the following error message:
[errorId] => 580022
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => Invalid request parameter: itemPrice cannot be negativeI can see that the following was submitted to PayPal:
<item>
<name>Special Discount</name>
<identifier></identifier>
<price>-2.50</price>
<itemPrice></itemPrice>
<itemCount></itemCount>
<any>[quantity: null]</any>
</item>This object is basically incomplete and in order to apply discounts, you should apply them > onto the price for the main item and then submit it to PayPal.
我真的不确定他们建议我做什么?一个示例购物车是:
Item 1 - £10
Item 2 - £20
Item 3 - £50
Item 4 - £10
Delivery - £5
Total - £95
作为鼓励,我们有时会提供优惠券……所以它可能是“超过 50 英镑的订单可减 10 英镑”。所以在上面的例子中,它会将整体价格降至 85 英镑。
我真的不确定他们建议的替代方案是什么?
最佳答案
很有趣。正常付款没有该限制(我经常传递一个负数项目,就像您经常描述的那样)。
他们要您做的是取消另一件商品的折扣。因此,具有该折扣的示例购物车将是
Item 1 - £10
Item 2 - £20
Item 3 - £40 <-- Removed £10 discount
Item 4 - £10
Delivery - £5
Total - £85 <-- total reflects this
关于paypal - PayPal API 中的负数错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26906506/
赏金:对于提供代码以使此子程序与负数一起工作的任何人,+50 信誉点。 我编写了一个 MIPS 程序来将华氏温度转换为摄氏温度。它打开自己的输出窗口(即 UART)并正确显示摄氏值。它在从 C 调用到
我得到了以下代码 # On va convertir en somme monétaire # We convert our integer into a way to read money
我得到了以下代码 # On va convertir en somme monétaire # We convert our integer into a way to read money
我使用以下 RegEx 基本上过滤掉任何文本,并接受数字 + 运算符。 ([-+]?[0-9]*\.?[0-9]+[\/\+\-\*])+([-+]?[0-9]*\.?[0-9]+) 所以它抓取 1+
我有一个查询,它计算我在查询中使用 union all 的平均值,以便获取我最终使用 max 函数的数据。 当联合返回结果时,如下所示:- col 1 col2 1 0
我有这样一个类: public class SpiralGenerator implements Iterator> { private void generate(int pos, E...
A = numpy.matrix([[36, 34, 26], [18, 44, 1], [11, 31, 41]]) X1 = numpy.matrix([[462
我有一个应用程序,其中有一个显示硬币 00 的 TextView ,一个按钮显示奖励视频广告,为用户提供 10 个硬币,还有一个购买按钮,将硬币减少 30 个。现在,当用户有 30 个硬币时,单击购买
话不多少,直接附上代码实例,仅供参考 ? 1
我有一系列正数和负数,我想将每个数字的绝对值增加一个,同时仍保持正数/负数。0.2 -> 1.2-0.3 -> -1.3我怎样才能做到这一点? 最佳答案 让我们尝试使用numpysign s=pd.S
我有这段代码,只允许在 keypress() 的输入字段中输入数字 if (e.which != 8 && e.which != 0 && (e.which 57)) { return fa
我试图用“-1”作为所有值填充二维数组。我正在使用的代码是: int c [] []=new int[4][4]; Arrays.fill(c,-1) 这会引发以下错误: Exception in t
在学校作业中,我们应该编写一个程序,该程序接受一个数字并将其分为三个部分:1. 检查数字是正数还是负数2. 整数(大小)3.小数部分 要求是应该有一个自己的函数,名为separate,具有输入和输出参
有没有什么方法可以在 C# 中执行整数除法(没有 float 或小数,我需要保持这个非常快)来向下舍入数字? 默认除法只是丢弃分数参数。考虑: 1 / 2 = 0 // That is correc
我正在使用 matplotlib 为报告生成图表,并指定我自己的样式表来指定文本格式以符合报告的指定文档样式。在我的 .mplstyle 样式表中,我按如下方式指定字体系列: font.family
在 C++11 中,如果我们尝试使用全局运算符 new 分配负大小的数组,它会抛出 std::bad_array_new_length,但是 C++98/C++03 呢?是 UB 还是会抛出 std:
我试过 scanf("%u",&number) 并且我输入了负数问题是当我 printf("%d",number) 我得到负数。我认为这会阻止我读取负数。scanf("%d",&number) 和 s
我的任务是解释一些看似奇怪的C代码行为(在x86上运行)。我可以轻松完成所有其他工作,但是这确实让我感到困惑。 代码段1输出-2147483648 int a = 0x80000000; int
js有问题吗? if("hello".indexOf("world")) { // I forgot to add > -1 here console.log("hello world");
我正在尝试使用 Antlr 4 设置一个简单的计算器。 语法: grammar calcGrammar; input : expression EOF; expression : MINUS
我是一名优秀的程序员,十分优秀!