Comments (13)
I believe this should do it. Can you try now?
from active_paypal_adaptive_payment.
I uninstalled the gem and did another bundle install
and I'm still getting the same error. Or do you want me to download the latest version of the code from GitHub?
from active_paypal_adaptive_payment.
can you try with gem "active_paypal_adaptive_payment", "~> 0.3.9"
in your Gemfile
from active_paypal_adaptive_payment.
Great. Seems to start now.
Now when I try to make the payment, I get this from PayPal's website:
URL: https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=
Message: This transaction is invalid. Please return to the recipient's website and try again.
Code inside my controller:
gateway = ActiveMerchant::Billing::PaypalAdaptivePayment.new(
:login => "npo_1332820242_biz_api1.gmail.com",
:password => "XXXXXXX",
:signature => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
:appid => "APP-80W284485P519543T" )
recipients = [{:email => '[email protected]',
:amount => 5,
:primary => true},
{:email => '[email protected]',
:amount => 10,
:primary => false}
]
response = gateway.setup_purchase(
:return_url => url_for(:action => :complete, :only_path => false),
:cancel_url => url_for(:action => :cancel, :only_path => false),
:ipn_notification_url => url_for(:action => :success, :only_path => false),
:receiver_list => recipients
)
redirect_to (gateway.redirect_url_for(response["payKey"]))
Anything you spot right away?
from active_paypal_adaptive_payment.
did you set the test mode in your app?
#config/environments/{environment.rb}
App::Application.configure do
config.setting...
end
ActiveMerchant::Billing::Base.mode = :test
from active_paypal_adaptive_payment.
Yup, in both development.rb
and production.rb
I should also probably mention that I'm testing it through Heroku since I can't do it locally, and that's where I'm getting the issue from, but I'm not sure if that has to do with anything.
from active_paypal_adaptive_payment.
I never had any issues like that with heroku.
Are you using Spree? in that case, the config settings Payment Methods (in admin), the environment should reflect the PayPal environment. For example, in production the server should not be configure to test.
from active_paypal_adaptive_payment.
No, I'm not using Spree.
I created a simple application that tests out the functionality of the gem.
The repository is here (I took out the PayPal credentials to the latest commit): https://github.com/vinceh/testpaypal
And I've hosted on Heroku @ http://blazing-meadow-5453.herokuapp.com/
Do you want to take a look? The :test
is in the environments, and it's just copy and pasted code into the controller. Maybe you can spot something.
from active_paypal_adaptive_payment.
Have you ran the tests? do they run fine? you only have to update this file with your credentials
https://github.com/jpablobr/active_paypal_adaptive_payment/blob/master/test/fixtures.example.yml (remove the example part)
from active_paypal_adaptive_payment.
No I have not. I will try it tomorrow. But I noticed there is a pay_key attribute. What is that? I never specified anything like that in my application; is that the problem?
from active_paypal_adaptive_payment.
See issue #14
That might help you a bit. And yes, you need the pay_key
, that's Paypal's first response to your payment request.
from active_paypal_adaptive_payment.
I wrapped the redirect_to with
if response.success?
redirect_to (gateway.redirect_url_for(response[:pay_key]))
end
And it seems that my response is not successful. How do I debug this?
from active_paypal_adaptive_payment.
response.inspect should contain PayPal's response... see what you got there and search for that specific error on PayPals documentation.
from active_paypal_adaptive_payment.
Related Issues (20)
- What parameters does paypal send back when it redirects to my site? HOT 4
- Not receiving a response from the IPN when ipn_notification_url is called HOT 3
- :start_time and :end_time for preapproved payments do not include GMT offset HOT 2
- This transaction is invalid. Please return to the recipient's website and try again. HOT 5
- Inconsistent naming of IPN keys HOT 3
- its possible send ClientDetails Fields? HOT 3
- payment is completed without the sender logging in to paypal.com HOT 1
- No ipn field provided for preapprove_payment HOT 1
- Refund method NO_API_ACCESS_TO_RECEIVER HOT 4
- How to send a single payment to a single user? HOT 1
- How to send an implicit approval payment?
- Setting the item description for the Payee HOT 2
- payKey issue HOT 5
- Embedded payment not working?
- Chained payments not working?
- how i implement this in rails app
- item description, support for Embedded flow?
- Your tutorial video link does not work
- Set payments as "Family and friends"
- Adaptive Payment Refund functionality Issue The refund's Error receiver [email protected] wasn't part of the payment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active_paypal_adaptive_payment.