- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
更新 2:
我目前的代码如下:
paypalplatform.php:
https://www.paypal-labs.com/integrationwizard/adaptive/code2.php
basic_payment.php: (the script in 4b in the link below)
https://www.paypal-labs.com/integrationwizard/adaptive/paymenttypes.php
ipn.php: (the IPN listener)
如果上面第二个链接中的框为空,只需单击“重新开始”,然后单击下一步,直到进入第 4 步,或单击此处:https://www.paypal-labs.com/integrationwizard/adaptive/main.php
更新 1:
我认为这是发起支付的代码,我需要在这里指定一个自定义值吗?如果是,怎么办?
<?php
//-------------------------------------------------
// When you integrate this code
// look for TODO as an indication
// that you may need to provide a value or take action
// before executing this code
//-------------------------------------------------
require_once ("paypalplatform.php");
// ==================================
// PayPal Platform Basic Payment Module
// ==================================
// Request specific required fields
$actionType = "PAY";
$cancelUrl = "some url here"; // TODO - If you are not executing the Pay call for a preapproval,
// then you must set a valid cancelUrl for the web approval flow
// that immediately follows this Pay call
$returnUrl = "some url here"; // TODO - If you are not executing the Pay call for a preapproval,
// then you must set a valid returnUrl for the web approval flow
// that immediately follows this Pay call
$currencyCode = "USD";
// A basic payment has 1 receiver
// TODO - specify the receiver email
$receiverEmailArray = array(
'receivers email here'
);
// TODO - specify the receiver amount as the amount of money, for example, '5' or '5.55'
$receiverAmountArray = array(
'receivers amount here'
);
// for basic payment, no primary indicators are needed, so set empty array
$receiverPrimaryArray = array();
// TODO - Set invoiceId to uniquely identify the transaction associated with the receiver
// You can set this to the same value as trackingId if you wish
$receiverInvoiceIdArray = array(
'1234abc'
);
// Request specific optional or conditionally required fields
// Provide a value for each field that you want to include in the request, if left as an empty string the field will not be passed in the request
$senderEmail = ""; // TODO - If you are executing the Pay call against a preapprovalKey, you should set senderEmail
// It is not required if the web approval flow immediately follows this Pay call
$feesPayer = "";
$ipnNotificationUrl = "some url here";
$memo = ""; // maxlength is 1000 characters
$pin = ""; // TODO - If you are executing the Pay call against an existing preapproval
// the requires a pin, then you must set this
$preapprovalKey = ""; // TODO - If you are executing the Pay call against an existing preapproval, set the preapprovalKey here
$reverseAllParallelPaymentsOnError = ""; // Do not specify for basic payment
$trackingId = generateTrackingID(); // generateTrackingID function is found in paypalplatform.php
//-------------------------------------------------
// Make the Pay API call
//
// The CallPay function is defined in the paypalplatform.php file,
// which is included at the top of this file.
//-------------------------------------------------
$resArray = CallPay ($actionType, $cancelUrl, $returnUrl, $currencyCode, $receiverEmailArray,
$receiverAmountArray, $receiverPrimaryArray, $receiverInvoiceIdArray,
$feesPayer, $ipnNotificationUrl, $memo, $pin, $preapprovalKey,
$reverseAllParallelPaymentsOnError, $senderEmail, $trackingId
);
$ack = strtoupper($resArray["responseEnvelope.ack"]);
if($ack=="SUCCESS")
{
if ("" == $preapprovalKey)
{
// redirect for web approval flow
$cmd = "cmd=_ap-payment&paykey=" . urldecode($resArray["payKey"]);
RedirectToPayPal ( $cmd );
}
else
{
// payKey is the key that you can use to identify the payment resulting from the Pay call
$payKey = urldecode($resArray["payKey"]);
// paymentExecStatus is the status of the payment
$paymentExecStatus = urldecode($resArray["paymentExecStatus"]);
}
}
else
{
//Display a user friendly Error on the page using any of the following error information returned by PayPal
//TODO - There can be more than 1 error, so check for "error(1).errorId", then "error(2).errorId", and so on until you find no more errors.
$ErrorCode = urldecode($resArray["error(0).errorId"]);
$ErrorMsg = urldecode($resArray["error(0).message"]);
$ErrorDomain = urldecode($resArray["error(0).domain"]);
$ErrorSeverity = urldecode($resArray["error(0).severity"]);
$ErrorCategory = urldecode($resArray["error(0).category"]);
echo "Preapproval API call failed. ";
echo "Detailed Error Message: " . $ErrorMsg;
echo "Error Code: " . $ErrorCode;
echo "Error Severity: " . $ErrorSeverity;
echo "Error Domain: " . $ErrorDomain;
echo "Error Category: " . $ErrorCategory;
}
?>
原始问题:
我有一些来自 paypal 的脚本,允许用户从我的网站付款。
在他们使用基本支付脚本发送支付的第一步中,我得到了这些值:
Array (
[responseEnvelope.timestamp] => 2011-04-08T01:34:03.578-07:00
[responseEnvelope.ack] => Success
[responseEnvelope.correlationId] => a2de97aaf57f0
[responseEnvelope.build] => 1822511
[payKey] => AP-8AW04791DK417062F
[paymentExecStatus] => CREATED )
当付款从 paypal 确认后,使用他们的 ipn 系统,我得到这些值:
test_ipn = 1
payment_type = instant
payment_date = 01:11:38 Apr 08, 2011 PDT
payment_status = Completed
address_status = confirmed
payer_status = verified
first_name = John
last_name = Smith
payer_email = buyer@paypalsandbox.com
payer_id = TESTBUYERID01
address_name = John Smith
address_country = United States
address_country_code = US
address_zip = 95131
address_state = CA
address_city = San Jose
address_street = 123, any street
business = seller@paypalsandbox.com
receiver_email = seller@paypalsandbox.com
receiver_id = TESTSELLERID1
residence_country = US
item_name = something
item_number = AK-1234
quantity = 1
shipping = 3.04
tax = 2.02
mc_currency = USD
mc_fee = 0.44
mc_gross = 12.34
mc_gross_1 = 9.34
txn_type = web_accept
txn_id = 3848811
notify_version = 2.1
custom = xyz123
charset = windows-1252
verify_sign = AWPjjtnKgiQkL5dH.EojlIO6uUy9AijwJCRexi2IglsAajCxoIkbVEq-
我看不到任何允许我建立连接的值,允许我更新正确的数据库记录以表明付款已成功完成。
最佳答案
txn_id = 3848811 是来自 paypal 的交易 ID。如果您希望 Paypal 发回对您系统中某个标识符(您的付款标识符)的引用,您可以使用您将在请求中发送的“自定义”字段。
如果你使用NVP,那就是PAYMENTREQUEST_n_CUSTOM,不知道SOAP接口(interface)。
关于php - paypal确认了哪些付款?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5592587/
TCP header 上的 32 位确认字段,比如 x告诉另一台主机“我收到了所有字节,直到并包括 x-1,现在期待来自 x 和 on 的字节”。在这种情况下,接收方可能已经收到了一些更多字节,比如
我正在使用 PyCharm 2020.2.3 不知不觉中我点击了下图中的复选框 现在,即使我的代码正在调试中,点击运行也会终止调试并开始运行代码。如何将其恢复为未选中状态?谢谢。 PS:我的“允许并行
我想知道何时使用 RabbitMQ 和 Spring Boot 接受 (ack) 或不接受 (nack) 消息。 我想将消息发送到队列(通过交换)并检查队列是否已接受该消息。实际上我想发送到两个不同的
我一直在寻找一种方法让用户确认 票在分配给他们之后。不知道有没有 这是一个内置功能,或者如果有一个插件 将为用户创建一个状态/按钮以接受票证 在它被放入队列之后。我希望 从附近的售票窗口看到类似的东西
我正在构建一个应用程序以通过 Xbee API 与 Xbee 模块通信。 目前我有一些工作,但它相当简单并且有很多限制。 Sub processPackets() ' this runs as its
我有一个复选框,更改后会自动发布。 自动发布对于两者(选中和未选中)都适用,但我想在每个事件发生之前弹出一个对话框进行确认。 到目前为止,当选中该复选框时,弹出框就会起作用。 但当取消选中该复选框时,
当我使用 UIGestureRecognizer ,例如,当用户向右滑动时,我想要一个 UIAlertView询问他是否真的要进行向右滑动的 Action 。 我曾尝试这样做,但没有成功。 最佳答案
我有一个 asp:CheckBoxList,我想显示一条警告消息仅在使用 jquery 取消选中复选框时。 $('.chklist').click( function () {
我想知道有什么可能的方法来确定我们的推送消息是否最终从 APNS 服务器传送。我已经想出了一些信息,如下所述 APNS 正在发送接受推送请求的响应代码,并可能给出错误代码(如果有)。例如:如果您的有效
我有此页面,我正在尝试确认输入文本字段中的日期与当前日期。如果输入字段中的日期晚于当前日期,则需要出现确认框以确认他们输入了正确的日期。因此,“确定”按钮需要完成数据提交,“取消”按钮需要将它们返回到
我有一个功能: function placeOrder(price, productList) { var bulletinBoardItem = Number(productList.box
我不明白为什么即使我点击“否”,这个confirm()调用也会被触发。你能告诉我我做错了什么吗? $('.deleteButton').livequery('click',function(){
我目前正在使用 dotmailer 生成一个新表单(简单的文本框和提交按钮),自动将电子邮件地址添加到 dotmailer 地址簿。 当有人提交电子邮件地址时 - 他们可以被带到网页。 我一直在尝试
这是不起作用的代码...它只是删除表单而不先提示。 $(".delete").click(function () { if(confirm('You honestly want to dele
我在我的程序中使用 aprgeparse 创建一个参数,允许用户从 amazon s3 存储桶中删除文件。我以这种方式创建它: parser.add_argument("-r", "--remove"
我正在努力学习 puppeteer 操作。我已经成功编写了登录页面和一些导航的脚本。然后我让它点击一个按钮。该页面抛出一个 window.confirm,我希望我的脚本接受它以继续下一步,但我不知
某网站实现了一个第三方插件,提示用户在删除前进行确认。 confirmDelete: function (event) { var go_ahead = confirm("Are you su
我想在 primefaces 的选择/取消选择复选框上显示确认对话框。我试过了 但它不起作用,因为 selectBooleanCheckBox 不可确认。是否有解决此问题的解决方法? 最
我们已经从 TFS 下载了一个项目,在恢复 Nuget 包后,我们收到以下错误: Error 5 The "ValidatePackageReferences" task could not
我有两个单独的 ul 列表:列表 A 和列表 B 由于 jQuery UI 插件,它们都可以排序。 我正在开发的项目的用户希望在项目从一个列表移动到另一个列表时确认操作,但在同一列表内移动时则不需要。
我是一名优秀的程序员,十分优秀!