我正在通过 PHP 和 MySQLi 建立自己的电子商务商店。当前测试站点是:http://taxreturnsolutions.uk/ecommerce/
我已遵循本指南:https://www.codexworld.com/paypal-standard-payment-gateway-integration-php/
我拥有一切设置和工作都非常好,因为我可以点击立即购买按钮,它会带我到沙盒网站,我可以购买。我的 SQLi 数据库将使用相关数据等进行更新。但是现在我不断从 PayPal Sandbox 收到以下消息,如下所示:
*注意 URL:/webapps/shoppingcart/error?flowlogging_id=7be60528d708&code=EWP_SETTINGS
我每次按下“立即购买”按钮时都会收到此消息,但在此之前,这是间歇性问题,例如我使用“立即购买”按钮 3/10 次时会出现此错误,7/10 次处理正确。
我的按钮代码如下:
$paypalURL = "https://www.sandbox.paypal.com/cgi-bin/webscr"; //Test PayPal API URL
$paypalID = 'ukpwneduk-facilitator@hotmail.com'; //Business Email
<!-- Button -->
<?php
if(isset ($_SESSION['login_user'])){
echo "
<form action=' $paypalURL ' method='post' style='text-align: center;'>
<!-- Identify your business so that you can collect the payments. -->
<input type='hidden' name='business' value='$paypalID'>
<!-- Specify a Buy Now button. -->
<input type='hidden' name='cmd' value='_xclick'>
<!-- Specify details about the item that buyers will purchase. -->
<input type='hidden' name='product_name' value='$product_array[$key]['product_name']'>
<input type='hidden' name='product_id' value='$product_array[$key]['product_id']'>
<input type='hidden' name='product_price' value='$product_array[$key]['product_price']'>
<input type='hidden' name='currency_code' value='GBP'>
<input type='hidden' name='notify_url' value='http://taxreturnsolutions.uk/ecommerce/payments/ipn.php'>
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://taxreturnsolutions.uk/ecommerce/payments/cancel.php'>
<input type='hidden' name='return' value='http://taxreturnsolutions.uk/ecommerce/payments/success.php'>
<!-- Display the payment button. -->
<input type='image' name='submit' border='0'
src='https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif' alt='PayPal - The safer, easier way to pay online'>
<img alt='' border='0' width='1' height='1' src='https://www.paypalobjects.com/en_US/i/scr/pixel.gif' >
</form> ";
} else
{
echo "<p style='text-align: center;'><b> Log in</b> to Buy Now </p>";
}
?>
最佳答案
我认为问题出在 PayPal 配置中。 您需要允许未加密的网站向 Paypal 付款。 为此,请登录您的 PayPal 帐户:
个人资料和设置 --> 我的销售工具 --> 网站偏好
转到“加密网站支付”部分 并选择“关闭”到“阻止非加密网站付款:”
这应该可以正常工作! 祝你好运
关于php - PayPal 集成过程中的 EWP 设置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43977553/
我有一个Ruby程序,它使用rubyzip压缩XML文件的目录树。gem。我的问题是文件开始变得很重,我想提高压缩级别,因为压缩时间不是问题。我在rubyzipdocumentation中找不到一种为创建的ZIP文件指定压缩级别的方法。有人知道如何更改此设置吗?是否有另一个允许指定压缩级别的Ruby库? 最佳答案 这是我通过查看rubyzip内部创建的代码。level=Zlib::BEST_COMPRESSIONZip::ZipOutputStream.open(zip_file)do|zip|Dir.glob("**/*")d
我在使用omniauth/openid时遇到了一些麻烦。在尝试进行身份验证时,我在日志中发现了这一点:OpenID::FetchingError:Errorfetchinghttps://www.google.com/accounts/o8/.well-known/host-meta?hd=profiles.google.com%2Fmy_username:undefinedmethod`io'fornil:NilClass重要的是undefinedmethodio'fornil:NilClass来自openid/fetchers.rb,在下面的代码片段中:moduleNetclass
大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje
我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击
我想设置一个默认日期,例如实际日期,我该如何设置?还有如何在组合框中设置默认值顺便问一下,date_field_tag和date_field之间有什么区别? 最佳答案 试试这个:将默认日期作为第二个参数传递。youcorrectlysetthedefaultvalueofcomboboxasshowninyourquestion. 关于ruby-on-rails-date_field_tag,如何设置默认日期?[rails上的ruby],我们在StackOverflow上找到一个类似的问
我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test
我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c
我在app/helpers/sessions_helper.rb中有一个帮助程序文件,其中包含一个方法my_preference,它返回当前登录用户的首选项。我想在集成测试中访问该方法。例如,这样我就可以在测试中使用getuser_path(my_preference)。在其他帖子中,我读到这可以通过在测试文件中包含requiresessions_helper来实现,但我仍然收到错误NameError:undefinedlocalvariableormethod'my_preference'.我做错了什么?require'test_helper'require'sessions_hel
我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file
我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe