我在使用ActiveMerchant和ActivePaypalAdaptivePayment处理paypal交易的Ruby on Rails应用程序(下面的Gemfile)的上下文中遇到了10002 paypal错误(此帐户禁用了API访问)。这是过去几天出现的一个新错误。我确信API凭据是正确的。
Paypal沙盒商业帐户本周早些时候正常运作。在调用paypal Express网关期间发生错误。
def paypal_experss_payment(total_amount)
amount = price_in_cents(total_amount)
PAYPAL_EXPRESS_GATEWAY.setup_purchase(amount,
:items => [{
:name => (t :'label_tag.audition_apply_paymant'),
:description => (t :'label_tag.one_time_audition'),
:amount => amount
}],
:ip => request.remote_ip,
:return_url => url_for(:action => 'apply_audition', :amount => total_amount, :params => params),
:cancel_return_url => request.referer
)
end
我已尝试为测试业务帐户创建新的API凭据,但这并未解决10002错误(此帐户已禁用API访问)。
我尝试使用新的API凭据创建新的测试业务帐户,但这并未解决错误。
此外,我尝试将测试业务帐户从业务验证升级到专业版(如与此类错误相关的其他StackOverflow问题中所述),但这也没有解决错误。
Gemfile
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.14'
# Bundle edge Rails insteadhttps://addons.heroku.com/https://addons.heroku.com/:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'rails-i18n'
gem 'i18n', '0.6.9'
gem 'i18n-active_record', :git => 'git://github.com/svenfuchs/i18n-active_record.git', :require => 'i18n/active_record'
#Postgres Hstore feature
gem 'activerecord-postgres-hstore', "~> 0.4.1"
gem "acts_as_tree", "~> 1.1.0"
gem "best_in_place", "~> 1.1.2"
gem 'quiet_assets', :group => :development
gem "paperclip", "~> 3.3.1"
gem "dropbox-sdk"
# Amazon-s3
gem 'aws-s3'
gem 'aws-sdk' , '1.9.5'
gem 'rake' ,'10.0.3'
#logging activity
gem 'paper_trail', '~> 2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.6'
gem 'compass-rails'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
# front-end framework and glyphicons
gem 'foundation-rails', '~> 5.3.3.0'
gem 'railties', '~> 3.2.14'
gem 'sass', '~> 3.3.13'
gem 'font-awesome-sass', '4.2.0'
gem 'backstretch-rails'
gem 'jquery-rails' , '= 2.1.4'
gem 'jquery_datepicker' , '0.4'
gem 'jquery-ui-rails' ,'3.0.1'
gem 'select2-rails'
gem 'remotipart', '~> 1.0'
#User Registration
gem "devise", "~> 2.2.4"
gem "nested_form", '~> 0.3.2'
gem "simple_form", "~> 2.0.4"
gem 'rails3-jquery-autocomplete'
gem "cancan", "~> 1.6.9"
gem "rolify", "~> 3.2.0"
gem "friendly_id", :require => "friendly_id"
# To use of Pagination
gem 'will_paginate', '~> 3.0'
#To integrate payment gateway
gem 'activemerchant'
gem "active_paypal_adaptive_payment"
gem 'goog_currency'
gem 'iso_country_codes'
gem 'delayed_job_active_record'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# For PDF downlads
gem 'prawn', '~> 0.12.0'
gem 'thin', :group => :production
gem 'newrelic_rpm'
#For pre-compile assets
#gem "libv8"
#gem "therubyracer", :require => 'v8'
gem 'pry', :group => :development
group :development, :test do
gem 'pry-debugger'
gem 'pry-stack_explorer'
# gem 'capybara'
gem 'factory_girl_rails'
# gem 'debugger', :require => 'debugger'
gem 'rspec-html-matchers'
gem 'rspec-rails'
gem "shoulda"
gem 'hirb'
end
#group :development do
#gem "better_errors"
#gem "binding_of_caller"
#end
gem 'exception_notification', '= 4.0.0'