- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我目前正在做一个项目,需要在一些非洲国家使用PayPal账户实现支付。由于在 https://developer.paypal.com/developer/ 中注册的测试帐户,我可以开发一个允许我与 API 交互的演示项目.在制作一些测试用例时,我尝试指定一个非常长的数量(单位为 U$S),以便了解如何处理抛出的错误。所以,看看这个异常,我看到了以下痕迹:
{"name":"VALIDATION_ERROR","details":[{"field":"transactions[0].amount.details.subtotal","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point"},{"field":"transactions[0].item_list.items[0].price","issue":"Value too long (max length 10)"},{"field":"transactions[0].amount.total","issue":"Value too long (max length 10)"},{"field":"transactions[0].amount.total","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point"},{"field":"transactions[0].item_list.items[0].price","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point"},{"field":"transactions[0].amount.details.subtotal","issue":"Value too long (max length 10)"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"12d1b9e203241"}
查看information_link 中提到的文档,我看到了这一段:
Value too long (max length 10)
Provide a value that is 10 characters or less.
重要的是要说明我正在使用美元作为货币(ISO 代码:USD),所以,此时我想知道:其他货币呢?正如我所说,我的应用程序将与非洲国家合作,例如尼日利亚(即),其货币为奈拉,每个货币估价为 0.005013 美元,这可能会使小数点后 10 位不够。有人有这个问题吗?无论使用哪种货币,我都应该始终限制在小数点后 10 位吗?
(无法实现货币转换!)
最佳答案
...so, at this point i'm wondering: what about other currencies?
可以在 here 中找到 REST API 支持的 PayPal 货币列表。
As I said, my application will be working with african countries like Nigeria (i.e.) whose currency is Naira valuated to 0.005013 U.S. dollars for each one, which could make that 10 decimal places are not enough. Someone has this issue?
遗憾的是,PayPal 目前不支持尼日利亚奈拉货币。如果您确实需要以 USD
进行操作,则您操作的金额不得超过 2 位小数。
Shall I am always limited to 10 decimal places no matter the currency?
如果您查看错误详细信息,它通过说“货币金额必须是非负数,可以选择包含正好由‘.’分隔的 2 个小数位,可选的千位分隔符来澄清这一点',', 限制在小数点前7位"。
所以总的来说,数量可以是 10 个字符,而不是小数位。例如,“1234567.90”是有效的,其中小数点包含在字符数中。此最大字符数与 here 概述的受支持货币的最大 PayPal 交易限制一致。
关于.net - PayPal:付款金额为 'Value too long (max length 10)',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29017631/
我正在尝试使用 flot 绘制 SQL 数据库中的数据图表,这是使用 php 收集的,然后使用 json 编码的。 目前看起来像: [{"month":"February","data":482},
我有一个来自 php 行的 json 结果,类似于 ["value"]["value"] 我尝试使用内爆函数,但得到的结果是“value”“value” |id_kategori|created_at
脚本 1 将记录 two 但浏览器仍会将 select 元素呈现为 One。该表单还将提交值 one。 脚本 2 将记录、呈现和提交 两个。我希望它们是同义词并做同样的事情。请解释它们为何不同,以及我
我的python字典结构是这样的: ips[host][ip] 每行 ips[host][ip] 看起来像这样: [host, ip, network, mask, broadcast, mac, g
在 C# 中 我正在关注的一本书对设置和获取属性提出了这样的建议: double pri_test; public double Test { get { return pri_test; }
您可能熟悉 enum 位掩码方案,例如: enum Flags { FLAG1 = 0x1, FLAG2 = 0x2, FLAG3 = 0x4, FLAG4 = 0x8
在一些地方我看到了(String)value。在一些地方value.toString() 这两者有什么区别,在什么情况下我需要使用哪一个。 new Long(value) 和 (Long)value
有没有什么时候 var result = !value ? null : value[0]; 不会等同于 var result = value ? value[0] : null; 最佳答案 在此处将
我正在使用扫描仪检测设备。目前,我的条形码的值为 2345345 A1。因此,当我扫描到记事本或文本编辑器时,输出将类似于 2345345 A1,这是正确的条形码值。 问题是: 当我第一次将条形码扫描
我正在读取 C# 中的资源文件并将其转换为 JSON 字符串格式。现在我想将该 JSON 字符串的值转换为键。 例子, [ { "key": "CreateAccount", "text":
我有以下问题: 我有一个数据框,最多可能有 600 万行左右。此数据框中的一列包含某些 ID。 ID NaN NaN D1 D1 D1 NaN D1 D1 NaN NaN NaN NaN D2 NaN
import java.util.*; import java.lang.*; class Main { public static void main (String[] args) thr
我目前正在开发我的应用程序,使其设计基于 Holo 主题。在全局范围内我想做的是工作,但我对文件夹 values、values-v11 和 values-v14. 所以我知道: values 的目标是
我遇到了一个非常奇怪的问题。 我的公司为我们的各种 Assets 使用集中式用户注册网络服务。我们一般通过HttpURLConnection使用请求方法GET向Web服务发送请求,通过qs设置参数。这
查询: UPDATE nominees SET votes = ( SELECT votes FROM nominees WHERE ID =1 ) +1 错误: You can't specify
如果我运行一段代码: obj = {}; obj['number'] = 1; obj['expressionS'] = 'Sin(0.5 * c1)'; obj['c
我正在为我的应用创建一个带有 Twitter 帐户的登录页面。当我构建我的项目时会发生上述错误。 values/strings.xml @dimen/abc_text_size_medium
我在搜索引擎中使用以下 View : CREATE VIEW msr_joined_view AS SELECT table1.id AS msr_id, table1.msr_number, tab
为什么验证会返回此错误。如何解决? ul#navigation li#navigation-3 a.current Value Error : background-position Too
我有一个数据名如下 import pandas as pd d = { 'Name' : ['James', 'John', 'Peter', 'Thomas', 'Jacob', 'Andr
我是一名优秀的程序员,十分优秀!