我正在使用这个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) 我正在尝试实现谷歌地图,我遇到的问题是,当我调用函数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,我正试图在 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) 我的日志文件的消息The session cookie data did not match what was expected. This could be a possible hacking attempt大约每秒5次,大约10分钟.显然是某种黑客企图.我应该担心这个问题吗?我可以仔细检查以确保我尽可能安全吗?
我正在尝试使用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) 我有一个邮件发送器,可以在日志中看到它正在发送,但是邮件正文中没有包含邮件发送器视图中的任何内容。
这是由于我已将内容放入子文件夹,并且尝试:template_path在mail函数中使用,但无济于事。
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) 我正在尝试运行该$ 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) 我该如何解决这个错误:
$ 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) 我在OSX El-Capitan上有mysql版本5.7.11.我在重启后尝试启动mysql服务器时遇到此错误.
我正在尝试使用服务帐户在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) codeigniter ×2
java ×2
javascript ×2
jsf ×2
php ×2
actionmailer ×1
ajax ×1
facelets ×1
gmail ×1
google-maps ×1
jquery ×1
jsf-2 ×1
macos ×1
mysql ×1
paypal ×1
paypal-ipn ×1
primefaces ×1
rspec ×1
rspec-rails ×1
rspec3 ×1
ruby ×1
rvm ×1
security ×1