Topic: Paypal Integration
Hi
I have this script
require "rubygems"
require "active_merchant"
ActiveMerchant::Billing::Base.mode = :test
gateway = ActiveMerchant::Billing::PaypalGateway.new(
:login => API_LOGIN,
:password => API_PASSWORD,
:signature => API_SIGNATURE
credit_card = ActiveMerchant::Billing::CreditCard.new(
:type => "visa",
:number => "4192329149836077",
:verification_value => "123",
:month => 4,
:year => 2015,
:first_name => "Test",
:last_name => "User"
)
if credit_card.valid?
# or gateway.purchase to do both authorize and capture
response = gateway.purchase(1000, credit_card, :ip => "127.0.0.1")
if response.success?
puts response.inspect
puts "Purchase complete!"
else
puts "Error: #{response.message}"
end
else
puts "Error: credit card is not valid. #{credit_card.errors.full_messages.join('. ')}"
endafter purchase sandbox return response true but noney are not transfer. Help me understand what the problem.
Thanks!