- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
这就是我正在设计的网站,多个商店可以在该网站上销售他们的产品。每个卖家都会在我的网站上有一个虚拟商店。我正在使用 Paypal 进行购买操作。我考虑过允许客户在没有 paypal 帐户的情况下使用信用卡,并且我正在尝试使用自适应支付流程来允许“以访客身份购买”流程。我正在尝试使用 paypal 默认流程(而不是其他 api),因为我不想担心处理信用卡数据和必须将我的网站设计为 PCI 兼容。
所以在这个场景中,我使用的是:
Setting Up Web Pages to Invoke the Embedded Payment Flow Using a Lightbox
https://github.com/paypal/rest-api-sdk-dotnet/tree/master/Samples/RestApiSample
-因此,在我的 MVC 上,我有一个生成订单的页面,它调用一个帮助程序方法来获取 paykey。这是最相关的一个:
public static string GetPayKey(DummyPurchase purchase)
{
ReceiverList receiverList = new ReceiverList();
receiverList.receiver = new List<Receiver>();
//(Required) Amount to be paid to the receiver
string[] amt = new string[1] { purchase.TotalPrice.ToString() };
// Receiver's email address. This address can be unregistered with paypal.com.
// If so, a receiver cannot claim the payment until a PayPal account is linked
// to the email address. The PayRequest must pass either an email address or a phone number.
// Maximum length: 127 characters
string[] receiverEmail = new string[1] { purchase.StoreId.ToString() };
string cancelUrl = ConfigurationHelper<string>.GetKeyValue(Constants.PAYPAL_CANCEL_URL);
string returnUrl = ConfigurationHelper<string>.GetKeyValue(Constants.PAYPAL_RETURN_URL);
string currency = ConfigurationHelper<string>.GetKeyValue(Constants.PAYPAL_CURRENCY_CODE);
//Generate Receivers list
for (int i = 0; i < amt.Length; i++)
{
Receiver rec = new Receiver(Convert.ToDecimal(amt[i]));
if (receiverEmail[i] != string.Empty)
{
rec.email = receiverEmail[i];
}
receiverList.receiver.Add(rec);
}
PayRequest request = new PayRequest(new RequestEnvelope("en_US"), "PAY",
cancelUrl, currency,
receiverList, returnUrl);
//call the service
AdaptivePaymentsService service = null;
PayResponse response = null;
try
{
// (https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters)
Dictionary<string, string> configurationMap = GetAcctAndConfig();
// Creating service wrapper object to make an API call and loading
// configuration map for your credentials and endpoint
service = new AdaptivePaymentsService(configurationMap);
response = service.Pay(request);
}
catch (Exception ex)
{
Elmah.ErrorLog.GetDefault(null).Log(new Elmah.Error(ex));
return "";
}
Dictionary<string, string> responseValues = new Dictionary<string, string>();
string redirectUrl = null;
if (!(response.responseEnvelope.ack == AckCode.FAILURE) &&
!(response.responseEnvelope.ack == AckCode.FAILUREWITHWARNING))
{
return response.payKey;
}
return "";
}
-获得此 key 后,我从另一个 View 获取 html,该 View 具有 API 指南指定的形式,并将 paykey 字符串作为此 View 的模型。
@model string
<h2>ConfirmCheckout</h2>
<script src="https://www.paypalobjects.com/js/external/dg.js">
</script>
<form action="https://www.paypal.com/webapps/adaptivepayment/flow/pay"
target="PPDGFrame">
<input id="type" type="hidden" name="expType" value="light">
<input id="paykey" type="hidden" name="paykey" value="@Model">
<input type="submit" id="submitBtn" value="Pay with PayPal">
</form>
-呈现 View 后,我调用 javascript 代码启动流程:
var dgFlow = new PAYPAL.apps.DGFlow({ trigger: 'submitBtn' });
-流程完美运行,我得到了一个有效的支付 key ,呈现在这个表单上。但是,当我单击此按钮(带有 paykey 的表单上的提交按钮)时,我收到 2 个不同的错误。这是最常见的一种:
This transaction has already been approved. Please visit your PayPal Account Overview to see the details.
-但有时我会收到“您的付款 session 已过期”错误。
我有两个问题:
非常感谢
最佳答案
嗯,这真的很尴尬……但真正的问题是表单的 post 操作上的 url。我有
<form action="https://www.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame">
这是生产环节。而且我还没有上线,我正在为 sanbox 帐户使用 paypal api 凭据,所以真正的表单操作应该是:
<form action="https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame">
呃!希望这可以帮助其他人犯同样的错误。
非常感谢@Andrew Angell
关于asp.net-mvc - MVC Paypal 自适应支付,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19689622/
在哪里可以找到有关退款状态的信息? 对于“取消”和“失败”,没关系。但是“已捕获”、“已授权”、“暂停”和“待处理”之间有什么区别。支付宝是什么意思? 谢谢 最佳答案 以下是 Paypal 付款状态列
我想问问是否有人知道无需用户交互即可进行 PayPal 付款的可能性。我目前正在开展一个项目,我们希望在用户无需登录 PayPal 的情况下按需进行 PayPal 付款。 我发现的是: 做引用交易 定
我无法找到 PayPal 提供的关于它如何处理 webhook 以进行支付的文档。付款是否与付款一样对待,以便完成的付款将启动付款完成的 webhook?一般来说,付款和支出是否通过网络 Hook 相
我有一个表单,人们可以在其中以固定金额订购一件商品。以下是步骤: 客户填写表格 客户点击提交并进入评论页面,他可以在其中检查他的输入 在评论表单中应该有一个使用 paypal 支付的按钮(带有自己的设
用了微信sdk各种痛苦,感觉比qq sdk调用麻烦多了,回调过于麻烦,还必须要在指定包名下的actvity进行回调,所以我在这里写一篇博客,有这个需求的朋友可以借鉴一下,以后自己别的项目有用到也有个
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: How to set Azure Max Spending Limit or Cost CAP $ amount?
我正在尝试将 Stripe 集成到 Symfony2 项目上,我在他们的文档中看到的唯一付款方式是“用卡付款”按钮 https://stripe.com/docs/checkout它在我的项目上创建了
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: How to set Azure Max Spending Limit or Cost CAP $ amount?
我想使用 firebase 作为服务器并向 stripe 发送付款请求。我在服务器端的经验为零,所以我正在寻找一种简单的方法来实现这一目标。此帖Is it possible to integrate
我在这里使用自适应 Paypal 支付控制台:https://apigee.com/console/paypal向人们付款。我无法找到一种方法在不授予他们许可的情况下向个人汇款(来 self )。我希
我一直坚持使用 OpenCart 的 PayPal 标准付款,但尚未找到解决方案。 我做了什么: 在 sandbox.paypal.com 上创建了企业帐户 设置以下网络首选项: 自动返回(指定 UR
我想在我的 WPF 应用程序中通过 PayPal 进行购物付款。我想为用户生成一个链接,但不知道如何通知应用程序已接受付款。是否唯一的解决方案将是服务器,它会检查付款是否已被接受并且应用程序会不时轮询
PayPal PayOut REST API 没有记录它的局限性。什么是: 每次付款的最大收款人数? 每次付款的最高金额? 每个收件人的最大金额? 注意: 我查看了在线文档和 paypal 论坛 (
我是 web 开发的新手,我需要做的是创建一个表单,用户可以在其中输入一些东西到一个字段中,让我们暂时称之为名称......然后当他们去 paypal 时,他们会捐赠 1 美元(预定)然后从支付给 P
我正在尝试将 PayPal 集成到我的应用程序中并了解 PayPal SDK 的工作原理我正在使用示例应用程序。我知道在用户按下“购买”按钮后,我需要将授权响应发送到我的服务器以验证付款。问题是我找不
在我的 oscar 应用程序中,django 需要自适应并行 oscar 支付程序。 谁能告诉我如何将 Adaptive Parallel Paypal 方法集成到 Normal Paypal 中。我
您好,我正在开发用于 NFC 支付的安卓应用程序。 Android 设置中有一个选项可以使用打开的应用程序而不是默认应用程序。例如,当我将默认应用程序设置为 Android Pay 并在付款前打开我的
我构建了一个使用命名空间和 PSR-0 自动加载的 PHP 应用程序。在尝试实现 Stripe库,我发现它似乎无法加载类,因为它们没有命名空间。如果我手动包含文件,有没有办法不自动加载? // Get
有人成功地将 Adyen 支付插件集成到 iOS 应用程序中吗? 我到了它向用户显示付款选项的地步,但选择其中一个选项没有任何作用。我希望它会转到表单以捕获卡的详细信息,但事实并非如此。 如有任何帮助
我正在与 Stripe Payment Gateway 集成——API 的最新版本。 除了“client_reference_id”没有传递给 webhook 或事务(没有出现在日志中)之外,这一切都
我是一名优秀的程序员,十分优秀!