- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试从 PayPal 的 SOAP API 获取交易详细信息,但我遇到了来自 PayPal 的错误。它返回错误:
The transaction id is not valid
我知道这是一个有效的交易 ID,因为我能够使用 PayPal NVP API 获取交易详细信息,但可能我的 SOAP 请求格式不正确。我按照可以在网上找到的 PayPal SOAP API 示例构建 SOAP XML,但它们很薄。我正在使用 mac 的 PAW 程序向 PayPal 的 API 发送 SOAP 请求,但使用 HTTP 客户端应该可以重现此问题。
我尝试使用 PayPal 的 REST API 但是 there's no method to get transaction details (例如姓名、电子邮件、支付金额、自定义字段)。我还尝试使用 NVP (Name-Value-Pair) API我确实取回了交易详细信息,但它没有为我提供交易的所有存储自定义字段。当我登录 PayPal 并查看单个交易时,我可以看到该交易的所有自定义字段,因此我知道它们已被存储。
SOAP API 是我最后的希望。
这是我正在使用的 SOAP 信封请求:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes">
<soapenv:Header>
<ns:RequesterCredentials>
<ebl:Credentials>
<ebl:Username>soap_api_username_here</ebl:Username>
<ebl:Password>soap_api_password_here</ebl:Password>
<ebl:Signature>soap_api_signature_here</ebl:Signature>
</ebl:Credentials>
</ns:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
<ns:GetTransactionDetailsReq>
<ns:GetTransactionDetailsRequest>
<ebl:Version>93.0</ebl:Version>
<ebl:TransactionID>8FX18476NR449891W</ebl:TransactionID>
</ns:GetTransactionDetailsRequest>
</ns:GetTransactionDetailsReq>
</soapenv:Body>
</soapenv:Envelope>
这是我从 PayPal SOAP API 收到的响应:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
<Username xsi:type="xs:string"/>
<Password xsi:type="xs:string"/>
<Signature xsi:type="xs:string"/>
<Subject xsi:type="xs:string"/>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<GetTransactionDetailsResponse xmlns="urn:ebay:api:PayPalAPI">
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2016-08-02T16:43:02Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">a464c181339f4</CorrelationID>
<Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">
<ShortMessage xsi:type="xs:string">Transaction refused because of an invalid argument. See additional error messages for details.</ShortMessage>
<LongMessage xsi:type="xs:string">The transaction id is not valid</LongMessage>
<ErrorCode xsi:type="xs:token">10004</ErrorCode>
<SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode>
</Errors>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">93.0</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">000000</Build>
<PaymentTransactionDetails xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:PaymentTransactionType">
<ReceiverInfo xsi:type="ebl:ReceiverInfoType"/>
<PayerInfo xsi:type="ebl:PayerInfoType">
<PayerStatus xsi:type="ebl:PayPalUserStatusCodeType">verified</PayerStatus>
<PayerName xsi:type="ebl:PersonNameType"/>
<Address xsi:type="ebl:AddressType">
<AddressOwner xsi:type="ebl:AddressOwnerCodeType">PayPal</AddressOwner>
<AddressStatus xsi:type="ebl:AddressStatusCodeType">None</AddressStatus>
</Address>
</PayerInfo>
<PaymentInfo xsi:type="ebl:PaymentInfoType">
<TransactionType xsi:type="ebl:PaymentTransactionCodeType">none</TransactionType>
<PaymentType xsi:type="ebl:PaymentCodeType">none</PaymentType>
<PaymentStatus xsi:type="ebl:PaymentStatusCodeType">None</PaymentStatus>
<PendingReason xsi:type="ebl:PendingStatusCodeType">none</PendingReason>
<ReasonCode xsi:type="ebl:ReversalReasonCodeType">none</ReasonCode>
</PaymentInfo>
<PaymentItemInfo xsi:type="ebl:PaymentItemInfoType">
<Subscription xsi:type="ebl:SubscriptionInfoType"/>
<Auction xsi:type="ebl:AuctionInfoType"/>
</PaymentItemInfo>
</PaymentTransactionDetails>
</GetTransactionDetailsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我不确定我做错了什么,但也许有更多经验的人比我更容易发现错误。我回答了另一位用户关于 PayPal REST API 的问题并从中获取交易详细信息,但据我所知,没有办法做到这一点 Get customer details after transaction .如果您找到了使用 REST API 实现此目的的方法,请告诉我,因为我宁愿使用 REST 而不是 SOAP。
谢谢。
最佳答案
错误消息是转移注意力的信息。 PayPal 找不到任何 TransactionId,将空的 TransactionId 报告为无效。
TransactionId 元素属于 urn:ebay:api:PayPalAPI
命名空间。您的 XML 将其附加到 urn:ebay:apis:eBLBaseComponents
命名空间。您需要做的就是将 ebl:TransactionId
更改为 ns:TransactionId
。
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes">
<soapenv:Header>
<ns:RequesterCredentials>
<ebl:Credentials>
<ebl:Username>soap_api_username_here</ebl:Username>
<ebl:Password>soap_api_password_here</ebl:Password>
<ebl:Signature>soap_api_signature_here</ebl:Signature>
</ebl:Credentials>
</ns:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
<ns:GetTransactionDetailsReq>
<ns:GetTransactionDetailsRequest>
<ebl:Version>204.0</ebl:Version>
<ns:TransactionID>8FX18476NR449891W</ns:TransactionID>
</ns:GetTransactionDetailsRequest>
</ns:GetTransactionDetailsReq>
</soapenv:Body>
检查这个example at the PayPal KB .
关于paypal - 从 PayPal SOAP API 获取交易详细信息(希望还有自定义字段),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38726857/
目录 进程 其他相关概念 创建线程的两种方式 为什么使用start()方法而不直接使用run()方法 start()方法底层
CURL状态码列表 状态码 状态原因 解释 0 正常访问
ODBC连接类函数 odbc_connect函数:打开一个ODBC连接 odbc_close函数:关闭一个已经打开的ODBC连接 odbc_close_all函数:关闭所有已经打开的ODBC连
作为标题,如何计算从纪元1900到现在使用boost的持续时间? 编辑:很抱歉以前的问题太短。我将再次描述我的问题。 我有关于将生日另存为整数的问题。我创建了四个函数,用法如下: ptime转换为整数
前言 在Java中,有一个常被忽略 但 非常重要的关键字Synchronized今天,我将详细讲解 Java关键字Synchronized的所有知识,希望你们会喜欢 目录 1. 定义 J
详细 JVM 垃圾收集日志的时间戳是收集的开始还是结束? 2016-08-09T21:04:19.756-0400: 224890.317: [GC Desired survivor size 167
我在“Master-Detail”概念上苦苦挣扎,除了一点点(但很重要)的细微差别外,几乎所有东西都按预期工作。我应该在 Storyboard上更改什么以在详细信息 View (屏幕截图底部的右上角)
我希望能够显示表格的详细 View ,但不推送新屏幕,而只显示表格所在的详细 View 。 设置它的最佳方式是什么......如果真的可行的话? ---------------------------
我在我的博客中为我的帖子使用了详细 View ,每篇帖子都有评论,所以我想对它们进行分页,但我不知道该怎么做,因为我请求了帖子模型。我知道如何在功能 View 中执行此操作,但不知道如何在详细 Vie
在下面的代码中,与 pm 对齐,该行是否会 move 整个内存并将其分配给 pm,或者它只会 move p 指向的内存而不是整个数组? int main() { int*
1·下载 https://dev.mysql.com/downloads/mysql/ 2·安装服务 1)管理员运行cmd 2)D: 3)cd D:\mysql
今天以前一直用的SQL Server 2005做开发,偶尔也用MySQL,现入手公司项目,用到SQL Server 2008,于是乎必须安装它,免得出现其他很纠结的小问题,现将自己安装图解分享如下:
1. crontab命令选项 复制代码 代码如下: #crontab -u <-l, -r, -e> -u指定一个用
我们有一个 WPF 应用程序,它有一个主窗口/详细信息窗口,两者都是 WPF 数据网格。当您在上部数据网格中选择一行时,详细信息将显示在下部数据网格中。我想知道从 UI 的角度来看是否有任何关于如何处
在可视化 Perforce 客户端 (p4v) 中有一个选项: 显示文件操作的 p4 命令输出 启用后,在日志 Pane 中,我可以看到这样的详细日志记录: p4 sync /Users/az/ftp
在其他服务器上设置测试环境后,在几个API调用中出现错误。 99%肯定这是MySQL的事情,但是返回的错误根本没有帮助: global name 'sys' is not defined" 我已经导入
我正在维护一个通用的 iOS 应用程序,其开发已开始于 iOS 6。我正在为 iOS 7 更新 UI。现在我遇到了应用程序的 iPad 部分的奇怪问题。这部分遵循使用 UISplitViewContr
我希望我能正确描述这种情况。当它发生时很容易在屏幕上看到,但很难用语言解释,但我会尽力而为。 我有一个带有固定主视图 (UITableView) 和两个详细 View 之一的 UISplitViewC
我尝试在 eclipse 和 intelliJ 参数中使用垃圾收集记录器来配置简单的测试程序。尝试了不同类型的配置,但尚未创建日志文件。 -XX:+PrintGCDetails -XX:+PrintG
正如您所知,.cap 文件中的 java 小程序的输出文件格式必须通过智能卡读卡器/写卡器(如 ACR122 或任何其他读卡器)部署到 java 卡,而且我相信 java 卡与 java 卡之间的部署
我是一名优秀的程序员,十分优秀!