- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我一直在尝试使用 Paypal Adaptive Payments API 实现拆分付款。我有一个简单的并行付款可以工作,但是这显示了对买家的分摊付款。
基本上我是在销售成员(member)资格。我们地方协会应该得到 75% 的资金,25% 交给管理机构。成员(member)应该只将总金额视为 2015 年成员(member)资格,因此我开始研究链式支付。从表面上看,这看起来像是一个非常简单的代码更改,但却给我带来了与单边付款相关的问题。
我正在用 php 实现它。
所以这里是paypal发送方法
function PaypalSend($payment_details, $api_function){
// initial endpoint that starts the transaction
$paypalInitialEndpoint = 'https://svcs.sandbox.paypal.com/AdaptivePayments/';
// set http headers
$headers = array(
'Connection: Close',
'X-PAYPAL-SECURITY-USERID: testseller_api1.nipf.com',
'X-PAYPAL-SECURITY-PASSWORD: 1381912839',
'X-PAYPAL-SECURITY-SIGNATURE: AzykGe5AzfK.mJFMRzBwIcTap-LcAsmsP4AhYzk1Y-07mh-xPLc-goK3',
'X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T',
'X-PAYPAL-REQUEST-DATA-FORMAT: JSON',
'X-PAYPAL-RESPONSE-DATA-FORMAT: JSON'
);
// setup curl request and http headers
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $paypalInitialEndpoint . $api_function);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payment_details));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if(!($res = curl_exec($ch)) )
{
error_log(curl_error($ch));
curl_close($ch);
exit;
}
curl_close($ch);
return json_decode($res, TRUE);
}
这是我的链接支付方式。此代码需要进行大量重构,但仅需对当前代码进行少量更改即可完全支持并行支付。
function sendChainedPayment(){
$purchase_details_array = array(
"actionType" => "PAY",
"currencyCode" => "GBP",
"feesPayer" => "PRIMARYRECEIVER",
"memo" => "blah blah blah",
"receiverList" => array(
"receiver" => array(
array(
"amount" => "30.00",
"email" => "testseller@nipf.com",
"primary" => "true"
),
array(
"amount" => "10.00",
"email" => "testseller@gbpf.com",
"primary" => "false"
)
)
),
"returnUrl" => "http://localhost/membershipSuccess.php",
"cancelUrl" => "http://localhost/membershipCancel.php",
"requestEnvelope" => array(
"errorLanguage" => "en_UK",
"detailLevel" => "ReturnAll"
)
);
$response = PaypalSend($purchase_details_array, "Pay");
//echo json_encode($response) . "<br /><br />";
$payKey = $response['payKey'];
$payment_details = array(
"requestEnvelope" => array(
"errorLanguage" => "en_UK",
"detailLevel" => "ReturnAll"
),
"payKey" => $payKey,
"receiverOptions" => array(
array(
"receiver" => array("email" => "testseller@nipf.com"),
"invoiceData" => array(
"item" => array(
array(
"name" => "Membership 2015",
"price" => "30.00",
"identifier" => "Membership 2015: joe bloggs"
)
)
)
),
array(
"receiver" => array("email" => "testseller@gbpf.com"),
"invoiceData" => array(
"item" => array(
array(
"name" => "Membership 2015 (Fee)",
"price" => "10.00",
"identifier" => "Membership 2015 (Fee): joe bloggs"
)
)
)
)
)
);
$response = PaypalSend($payment_details, "SetPaymentOptions");
//echo json_encode($response) . "<br /><br />";
$paypalCustomerUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=' . $payKey;
echo $paypalCustomerUrl;
//header('Location: ' . $paypalCustomerUrl);
}
我在第一个标注中收到以下响应 JSON。我认为这与帐户只是沙盒帐户而不是真实帐户有关,但如果帐户都必须是真实帐户,我将如何在沙盒中测试它?在这种情况下,用作 API 帐户的帐户是主要接收者。
{"responseEnvelope":{"timestamp":"2015-02-04T14:37:26.598-08:00","ack":"Failure","correlationId":"749bd1d709e76","build":"15089777"},"error":[{"errorId":"520009","domain":"PLATFORM","subdomain":"Application","severity":"Error","category":"Application","message":"Account Account not found. Unilateral receiver not allowed in chained payment is restricted","parameter":["Account not found. Unilateral receiver not allowed in chained payment"]}]}
最佳答案
我收到了同样的错误消息,我通过确保我在 API 调用中向其发送付款的 2 个电子邮件地址都是沙盒帐户来修复它。它们不以真实电子邮件地址的形式存在,但它们确实需要以 Paypal 账户的形式存在。 (之前我将它们发送到沙箱中不存在的 2 个真实的真实 Paypal 账户)。
从错误信息来看,“Account not found. Unilateral receiver not allowed in chained payment”,就是找不到你的账户,可能是因为他们不是沙盒账户。
关于php - Paypal Adaptive Payments (Chained) - 链式支付中不允许单边接收方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28333435/
我正在制作一个 android 应用程序,它允许用户在 editText 中输入关键字,当他们点击提交时,下面的 recyclerview 将显示来自 API 请求的结果。 我的 recyclerVi
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我想在我的 Svelte Kit 应用程序中使用 @sveltejs/adapter-static(想把它变成一个 SPA)。 我使用 npm i @sveltejs/adapter-static 安
我有一个简单的表单,在提交重定向到 AuthController 内的 processAction 之后,在这个 action 中我想要创建一个简单的 table bar。 已编辑: 引用Zend f
当我使用 ListView 时,我扩展了 ArrayAdapter 并将数据(一个列表)存储在 ArrayAdapter 中,因此当数据更改时,我调用: adapter.add(item).; 还有另
我有一个使用 Webpack 捆绑的 commonjs 浏览器应用程序( typescript )。它使用 webrtc,所以我想使用 webrtc-adapter package from npm
在 “DesignPatterns: Elements of Reusable Object-Oriented Software” 一书中谈到 C++ 实现 Adapter 模式时,它是这样的这个:
只需要帮助理解 ZF2 中的一些简单数据库查询。在 ZF1 中,我有这样简单的方法: public function recordset() { // listing of all records $
当使用Spring的Java配置时,你一定会看到像WebMvcConfigurerAdapter这样的类& HandlerInterceptorAdapter它们实现单个接口(interface),并
我将 doctrine2 与 ZF2 一起使用,我的一些库与 Zend\Db\Adapter\Adapter 一起使用,其他的与 doctrine2 一起使用。现在,他们两次连接到数据库。是否可以在原
过去几天我一直在工作灯上工作,现在正在尝试制作连接到数据库的应用程序。以下是截图: 1) Worklight\server\conf\worklight.properties 2) mySQLAdap
几年前,我在 this tutorial 之后开始学习 Zend 框架。 .在那里,它显示映射器是使用 Zend\Db\Adapter\Adapter 创建的。类来获取数据库连接,这就是我使用数据库的
我正在学习 RecyclerView 并在 developer 中的站点 Adapter 类扩展 RecyclerView.Adapter 。实现显示: public class MyAdapter
查看文档:http://docs.spring.io/spring-integration/reference/html/ip.html#tcp-adapters我知道适配器仅用于单向通信。但是,这里
当我移动到另一个 fragment 时,我如何恢复分页适配器项状态?我试过下面的文章,但没有用。 https://medium.com/@florina.muntenescu private fun
我正在使用 capistrano 并收到此错误消息: Please install the pg adapter: `gem install activerecord-pg-adapter` (can
我正在尝试在本地主机上安装 Magento 2,当我想连接数据库时出现错误。 错误是: “Magento\Framework\DB\Adapter\Pdo\MysqlFactory”生成的源类“\Ma
我的 Rails 服务器通过正常的开发脚本运行良好,我计划使用 Netbeans for Rails。当我使用 Netbeans 启动我现有的项目并重新启动我的 Webrick 服务器时,它显示错误
运行 Ruby on Rails (RoR) 应用程序或使用 ActiveRecord 框架的 Ruby 代码,您会收到错误消息: Please install the postgresql adap
我在运行 Redmine2.3-stable 时遇到这个错误,随后无法成功安装 mysql2 适配器。 这是错误: Please install the mysql2 adapter: `ge
我是一名优秀的程序员,十分优秀!