This is the SDK for PayPal adaptive payments. I’ve just uploaded it to *hopefully* make it a little easier to find. Please note that it has not been updated recently and that there are a few changes to be made. The StackOverflow post below provides a few examples:
Internal Server Error
undefined method `debug_rjs=' for ActionView::Base:Class
Remove the following line from your development.rb config file:
PayPalPlatformRubySDK::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
#config.action_view.debug_rjs = true <---- Comment this line out (no longer supported)
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
end
IPN Notifications:
Just a warning for anyone else setting up payments with PayPal, the sandbox IPN is extremely flaky. It has gone down twice in the last six months for weeks at a time, with no warning or error messages. If you’re not receiving the IPN check out the forums to make sure it’s not down.
Just an error I ran into while running bundle install on a new ubuntu virtual:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
You can also close the modal popup manually by using the following JavaScript:
$('#test_modal').modal('hide')
Adjust Modal Width:
In order to adjust the modal width you have two options, Javascript or CSS. You can use the following JavaScript mentioned on GitHub:
$('#test_modal').modal({
backdrop: true,
keyboard: true,
show: false \remove this if you don't want it to show straight away
}).css({
width: 'auto',
'margin-left': function () {
return -($(this).width() / 2);
}
});
body .modal-admin {
//new custom width
width: 750px;
//must be half of the width, minus scrollbar on the left (30px)
margin: -345px 0 0 -375px;
}
Show modal when the user scrolls past certain div
I’ve received another request on how to show the modal when a user scrolls to a certain div. The following should work, but please let me know if you have any issues.
/* Wait for document to load */
$(document).ready(function(){
$(window).scroll(function(){
//Retrieve scroll distance from top
var top = $(window).scrollTop();
//Retrieve the divs distance from top of page
var div_distance = $('my_div').offset().top;
//Use this if you want a bit of a variable distance, for instance if they scroll 150 pixels past the div
var buffer_distance = 150;
//Check if scrolled past div
if(top >= div_distance && top <= (div_distance + buffer_distance)){
//Show modal - you may want to add checks etc to see if it's already show
$('#test_modal').modal('show');
} else {
//Hide the modal, have scrolled past - you may want to add some checks to see if it's already hidden etc
$('#test_modal').modal('hide');
}
});
});
I came across a requirement today where I needed to find out when a user had last logged into PeopleSoft. The record PSACCESSLOG came in handy here, it stores all of the following:
PSACCESSLOG
OPRID: The users operator ID
LOGIPADDRESS: The users IP address
LOGINDTTM: A timestamp showing when the user logged in
LOGOUTDTTM: A timestamp showing when the user logged out
PT_SIGNON_TYPE: The signon type
Find Last Login Date for User:
SELECT *
FROM PSACCESSLOG
WHERE oprid = ''
ORDER BY effdt DESC;
Find all logins since 1st March 2012:
SELECT *
FROM PSACCESSLOG
WHERE TO_DATE(CAST(logindttm AS DATE), 'dd/mm/yy') >= TO_DATE('01/03/2012', 'dd/mm/yy');