小编Cat*_*ish的帖子

Paypal IPN问题与并行付款

我正在使用这个http://www.binpress.com/app/paypal-adaptive-payments-pro-codeigniter-library/140库,我正在使用它作为我的ipn监听器来进行codeigniter项目 - http:// pastebin.com/pMb7Zhz3.

基本上我正在使用上面的paypal库进行并行交易,这样当用户进行支付/捐赠时,它会向2个不同的账户汇款.一旦交易完成,paypal会将数据发送到我的ipn监听器,它会解析1个客户的信息,如果我将其保留'IPNNotificationURL' => ''在我的代码中并进入paypal并设置ipn url.

我正在尝试获取两个帐户的IPN信息,而不必让两个帐户都在他们的paypal设置中设置ipn url.当我设置时'IPNNotificationURL' => 'http://example.com/paypal_ipn',我仍然获得1个帐户的ipn信息,但是我收到Array to string conversion on line 11了我的听众的警告.我如何解决这个问题,如果我这样做,我会从这两个帐户获取ipn信息吗?

这是上面图书馆的付费方式,我用于并行付款

function Pay()
    {
        // Prepare request arrays
        $PayRequestFields = array(
                                'ActionType' => 'PAY',                              // Required.  Whether the request pays the receiver or whether the request is set up to create a payment request, but not fulfill the payment until the ExecutePayment is called.  Values are:  PAY, CREATE, PAY_PRIMARY
                                'CancelURL' => '',      // …
Run Code Online (Sandbox Code Playgroud)

php codeigniter paypal paypal-ipn

6
推荐指数
1
解决办法
2654
查看次数

javascript函数返回undefined

我正在尝试实现谷歌地图,我遇到的问题是,当我调用函数getLatLng时,它返回一个未定义的值,我无法弄清楚为什么.

    initialize();

    var map;
    var geocoder;   

    function initialize() {

        geocoder = new google.maps.Geocoder();
        var address = "Rochester, MN";
        var myLatLng = getLatLng(address);
        console.log("myLatLng = "+myLatLng);

    }

    function getLatLng(address) {

        var codedAddress;

        geocoder.geocode({'address': address}, function(results, status) {

            if(status == google.maps.GeocoderStatus.OK) {
                codedAddress = results[0].geometry.location;
                console.log("codedAddress 1 = "+codedAddress);
            } else {
                alert("There was a problem with the map");
            }
            console.log("codedAddress 2 = "+codedAddress);
        });

        console.log("codedAddress 3 = "+codedAddress);
        return codedAddress;
    }
Run Code Online (Sandbox Code Playgroud)

在firebug控制台中,这是我按照这个确切顺序得到的输出:

codedAddress 3 = undefined
myLatLng = undefined
codedAddress 1 …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps

5
推荐指数
2
解决办法
5277
查看次数

">" 和 "<" 被转换为 "<" 的奇怪问题 和“>” 在我的 jsf 应用程序中的 javascript 中

我有一些 javascript,我正试图在 jsf 应用程序中使用它们。我已经缩小了范围,这样如果我去掉下面的行,一切正常,但是当我输入这些行时,我在 chrome 控制台中收到一个错误,上面写着“意外;” 并将第一行显示为if(maxdays > 1000) {

为什么将大于号转换为>

if(maxdays > 1000) {
    maxdays = 1000;
}
Run Code Online (Sandbox Code Playgroud)

编辑:这是整个 JSF 页面。

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">


<h:head>


    <title>Protocol Dashboard</title>
    <link type="text/css" rel="stylesheet" href="../css/styles.css" />
    <script type="text/javascript" src="../js/jquery-1.5.2.js"></script>
    <script type="text/javascript" src="../js/highcharts.src.js"></script>
    <script type="text/javascript">
        $(document).ready(
                function() {
                    //var chartData;
                    //var goodData;
                    var chart;
                    var studyType;
                    var categories;
                    var maxdays;
                    //var chart = new Highcharts.Chart({
                    var …
Run Code Online (Sandbox Code Playgroud)

javascript java jquery jsf facelets

5
推荐指数
1
解决办法
6855
查看次数

在日志文件中看到可疑错误消息后

我的日志文件的消息The session cookie data did not match what was expected. This could be a possible hacking attempt大约每秒5次,大约10分钟.显然是某种黑客企图.我应该担心这个问题吗?我可以仔细检查以确保我尽可能安全吗?

php security codeigniter

5
推荐指数
1
解决办法
1222
查看次数

你能从ap:ajax监听器更新一个h:outputLabel吗?

我正在尝试使用ap:ajax标签,然后在该监听器中,我设置了一个名为"periodRendered"的值.然后我试图通过p:ajax标签的更新来更新h:outputLabel标签.它没有更新ajaxily,我在想它是因为一个primefaces ajax标签无法更新标准的jsf outputLabel标签.

我的假设是否正确,是否有更合适的标签我应该使用而不是h:outputLabel?

<h:outputLabel for="addProgramTo" value="Add Program To" />
<p:selectOneMenu value="#{ppBacker.grantProgram.grant_project_id}" id="addProgramTo" size="1" styleClass="listBoxMedium">
    <p:ajax process=":addProgram:addProgramTo" update=":addProgram:periodGrid, :addProgram:periodLabel" event="change" listener="#{ppBacker.addProgramListener}" />
    <f:selectItems value="#{ppBacker.grantProjectDropDownList}" />
</p:selectOneMenu>            

<h:outputLabel for="period" value="Period" id="periodLabel" rendered="#{ppBacker.periodRendered}"> 
Run Code Online (Sandbox Code Playgroud)

ajax jsf primefaces jsf-2

5
推荐指数
1
解决办法
9720
查看次数

子文件夹中的Rails邮件程序和邮件程序视图不起作用

我有一个邮件发送器,可以在日志中看到它正在发送,但是邮件正文中没有包含邮件发送器视图中的任何内容。

这是由于我已将内容放入子文件夹,并且尝试:template_pathmail函数中使用,但无济于事。

app / mailers / marketing / marketing_mailer.rb

class Marketing::MarketingMailer < ActionMailer::Base

    require 'mail'
    address = Mail::Address.new "test@example.com" # ex: "john@example.com"
    address.display_name = "Text" # ex: "John Doe"
    # Set the From or Reply-To header to the following:
    address.format # returns "John Doe <john@example.com>"
    default from: address

    # Sends an email when someone fills out the contact form
    def contact(name, email, message)
        @name = name
        @email = email
        @message = message
        mail(:subject => "Test", :to …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails actionmailer ruby-on-rails-3

5
推荐指数
1
解决办法
736
查看次数

RSpec控制器规范不工作,除非明确添加:type =>:controller

我正在尝试运行该$ rspec命令但是我的所有控制器测试都失败了,除非我明确地添加:type => :controller到每个规范中.

这是我得到的错误:

1) AccountsController GET index assigns all accounts as @accounts
     Failure/Error: get :index, {}, valid_session
     NoMethodError:
       undefined method `get' for #<RSpec::ExampleGroups::AccountsController_2::GETIndex:0x007fd96c8a6a68>
     # ./spec/controllers/accounts_controller_spec.rb:36:in `block (3 levels) in <top (required)>'
Run Code Online (Sandbox Code Playgroud)

这是生成的规范:

require 'spec_helper'

# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# …
Run Code Online (Sandbox Code Playgroud)

rspec ruby-on-rails rspec-rails ruby-on-rails-4 rspec3

5
推荐指数
1
解决办法
1862
查看次数

在osx 10.9.3上使用RVM安装ruby-1.9.3-p547时出错

我该如何解决这个错误:

$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby.
Installing Ruby from source to: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547, this may take a while depending on your cpu(s)...
ruby-1.9.3-p547 …
Run Code Online (Sandbox Code Playgroud)

ruby macos ruby-on-rails rvm

5
推荐指数
1
解决办法
3751
查看次数

OSX警告用户/ local/mysql/data目录不归mysql或_mysql用户所有

我在OSX El-Capitan上有mysql版本5.7.11.我在重启后尝试启动mysql服务器时遇到此错误.

mysql

5
推荐指数
1
解决办法
3379
查看次数

Gmail Api服务帐户提供失败的前提条件响应

我正在尝试使用服务帐户在JUnit测试中从gmail发送电子邮件.

我有这个测试:

@Test
public void testGmailCredential() throws GeneralSecurityException, URISyntaxException {
    try {
        InputStream is = getClass().getClassLoader().getResourceAsStream("myProject.json");
        GoogleCredential credential = GoogleCredential.fromStream(is).createScoped(GmailScopes.all());

        System.out.println("Scopes are " + credential.getServiceAccountScopesAsString());

        Gmail gmailService = new Gmail.Builder(getHttpTransport(), JSON_FACTORY, credential)
                  .setApplicationName("WHAT SHOULD THIS VALUE BE?")
                  //.setHttpRequestInitializer(credential)
                  .build();

        InternetAddress to = new InternetAddress("myemail@myurl.com", "Tom Catfish");
        InternetAddress from = new InternetAddress("myServiceAccountId@xxxxxxxxxx.iam.gserviceaccount.com", "Some Name");

        Properties props = new Properties();
        Session session = Session.getDefaultInstance(props, null);

        MimeMessage email = new MimeMessage(session);

        email.setFrom(from);
        email.addRecipient(javax.mail.Message.RecipientType.TO, to);
        email.setSubject("Subject here");
        email.setText("body here");

        ByteArrayOutputStream buffer = new ByteArrayOutputStream(); …
Run Code Online (Sandbox Code Playgroud)

java gmail service-accounts

5
推荐指数
1
解决办法
1459
查看次数