PayPal Adaptive Payments - Failing on PayPal Website - ruby-on-rails

I've spent the better part of the afternoon dealing with this issue so any help is appreciated.
I'm using ActiveMerchant with the active_paypal_adaptive_payment gateway and I'm running into some problems. Firstly, I don't have an app ID and I'm not sure where to get one. I'm wondering if this is my problem.
My goal is to send money from one user's PayPal account to another's using the Adaptive API. I've debugged to the point where I'm certain that the ActiveMerchant Gateway is producing the correct XML:
<?xml version="1.0" encoding="UTF-8"?>
<PayRequest>
<requestEnvelope>
<detailLevel>ReturnAll</detailLevel>
<errorLanguage>en_US</errorLanguage>
</requestEnvelope>
<actionType>PAY</actionType>
<cancelUrl>http://localhost:3000/.../</cancelUrl>
<returnUrl>http://localhost:3000/.../</returnUrl>
<ipnNotificationUrl>http://localhost:3000/.../</ipnNotificationUrl>
<currencyCode>USD</currencyCode>
<receiverList>
<receiver>
<email>sandbox_account#gmail.com</email>
<amount>100.0</amount>
</receiver>
</receiverList>
<reverseAllParallelPaymentsOnError>false</reverseAllParallelPaymentsOnError>
</PayRequest>
PayPal responds with:
response_rash: !ruby/hash:Hashie::Rash
response_envelope: !ruby/hash:Hashie::Rash
timestamp: '2012-05-28T15:02:43.381-07:00'
ack: Success
correlation_id: 881baf8e93444
build: '2945555'
pay_key: AP-879734246V2339109
payment_exec_status: CREATED
I then redirect the user to the correct PayPal page. The user logs in, reviews their information, and then hits "Pay," at which point they are hit with this error:
Your payment can't be completed. Please return to the participating website and try again.
I even uploaded to a staging environment to see if the IPN is triggered but it is not, I assume this is because the payment is never actually completed. I wish I could see what's happening on PayPal's end but I don't think they offer any tools to do that.
Has anyone seen a similar error? Any advice as to where to proceed next?

The problem was in fact the lack of an App ID. After some digging I found that the Sandbox Global APP ID is APP-80W284485P519543T. This has it working for now until I get a real App ID.

Related

Unable to be connected to Quickbooks through Intuit App Centre | Playground

Does this link work?
https://appcenter.intuit.com/Playground/OAuth/IA
I am trying to get my QB online token secret required for working with a ruby gem. I have a valid QB account and I have entered my app's consumer key & secret. All I am trying to do is follow the instructions required to get the example app working from
https://github.com/minimul/qbo_api
Every time I click on the Connect to Quickbooks button, I just get an error message.
Oops! An error has occurred.
Please close this window and try again.
Error Code: no_access_to_this_field
Message: Team Intuit IA Application not allowed to get access to QuickBooks
I have changed the urls in my app and I still cannot get past the error message. I am at a loss since this seems to be a very basic step to start working with the gem. Please tell me the newbie mistake I am making.
Is there any other SDK I need to install? I do not have a Desktop version...just the online version.
So if anyone here happens to not figure out this answer already, its because I set the "Access Token Duration:" option on the Intuit Playground to 120 seconds...the default option.
I changed it to 1200 seconds by mistake, and the login works just fine now! I don't understand why that works, so if someone could answer that I could understand it better!
Thanks #William Lorfing
This can happen if you are using the playground to generate Oauth tokens for either QuickBooks or Payments access and you are not setting the correct data source.
See the answer here: https://intuitdeveloper.lc.intuit.com/questions/1247785
regards
Jarred

Grails PayPal plugin response notification

I have been trying to integrate PayPal payment with a test application I am developing. If successful, I am thinking of leveraging this on my other projects.
So far, I have been able to add the plugin, configure it for Test environment and able to complete a transaction end to end. However, I have a small issue that I want some help or clarification about. Please follow the series of images below for more details:
Button on merchant application (grails application)
Payment page on PayPal test site
Here is the paypal confirmation page for transaction:
After making the payment above, I got a successful message on paypal test site. But when I check the logs and database, there is no notification sent to the grails application at this stage. The payment transaction is still in PENDING state:
Now, when I click on the "Return to merchant" link on the paypal confirmation page, then I redirected to my grails application with a SUCCESS message:
So, the PayPal "SUCCESS" response is sent to the grails/merchant application only after the user hits that link "Return to merchant site". In real life, the users might not want to return to the merchant site everytime. Seeing the confirmation message on PayPal site, they might assume that the transaction is done and may be PayPal does the payment too. But, how do we let the merchant site i.e the grails application know that the PayPal has already shown the user a confirmation message? So that, the user doesn't have to return to merchant site after seeing the Successful message?
UPDATE:
I have tried the IPN simulator upon your advice. I am not quite sure and able to understand how I can send an IPN message to my localhost application. When I tried giving my localhost or 127.0.0.1 on the IPN simulator configuration on my sandbox account, it throws error saying unable to reach the server. I am sure many developers must have tried this using local development machine, but unable to find any resource which gives the steps to use IPN simulator or IPN sandbox response for a localhost development instancE.
You cannot rely on PDT
you have to use IPN
where PayPal send a notification to a page on your website where you have to authenticate, verify several possible issues and save the transaction details
See here fore more info
IPN
Not sure if it written at that link, but you have also to enable such function from your Paypal account indicating the target page on your website.

Change paypal acount in ActiveMerchant

I need to migrate to another PayPal account and start receiving payments there. The previous setup is working great but I cant see to figure out how to migrate to the new account.
The existing PayPal configuration is as follows:
test:
paypal_email: email#fake.com
paypal_secret: xxxxxxxxxx
paypal_cert_id: ASLJKDLA334LJ
paypal_url: "https://www.sandbox.paypal.com/cgi-bin/webscr"
key_pass: 0000
In my PayPal account I go to "Business Setup" -> "Get your API Credentials" -> "View API Signature" and I see some different information that looks like this:
API Username: somename.butnotemail
API Password: ALKSDFLADSJLKAJSDASDALKSDJ
Signature: afalksdjfal.asdflkjalsdfjalksfjqwefasdfaksdf.aksdjfhaksdfha
First of all they do not seem to match and if I try to replace them the payment is leading to "Sorry — your last action could not be completed" page.
Can you please give me some insight on this? Am I looking at the wrong place? Where can I find the credentials I need?
Any help would be really appreciated
Thanks, in advance
From reading around, it sounds like the API key isn't what you're looking for in Ruby On Rails. I found this on Kestrel Blackmore's site -- it's to do with what happens when your credentials expire, but hopefully you can turn it to your ends as well.
http://www.kestrelblackmore.com/blog/rails-paypal-certificate-expiration
Perhaps the data in your configuration is referring to a PayPal REST API App? Check the following link (while logged in) in your old account, or create an app with your new account and use the generated credentials
https://developer.paypal.com/developer/applications

Paypal Rest Api Internal Server Error on Create Agreement

I am using Paypal REST api to create subscription plan and subscription agreement. I am able to create subscription plan and credit card but not able to create agreement. Whenever I request it gives internal server error.
I am using ruby gem paypal-sdk-rest
Credit card I am using is
4012888888881881
And mode is Sandbox
the Response I am getting is
Response code = 500. Response message = Internal Server Error.
Response debug ID = ea61a34e9fa73
Thanks in Advance
It happens because of frequently used test Credit Card like the one you are using, if you are use different one for this it will help you to solve this issue...
Or may be below one cause of the error
Sandbox Personal Account being used was invalid. The sandbox personal account is causing all this error 500.
HTTP 500 is caused by an internal error. One of the possible root causes is what JIGNESH mentioned.
Can you please open a Github issue with the information you provided here? It is a better place to discuss this kind of issue.
Also, would you explain how you are using subscription? Ruby REST SDK does not yet support the feature, although it is coming soon. Did you add it yourself?

PayPal Sandbox - CreateBillingAgreement call returns Internal Error (10001)

I'd appreciate any help with this, I've run around in circles trying all sorts of combinations with the PayPal Api - but I'm hitting a brick wall on this one.
I'm looking to call the CreateBillingAgreement method but each time I do it fails and reports a 10001 'internal error' from paypal in the response.
I have a valid token and I'm using version 84.0. I've successfully called SetupExpressCheckout and DoExpressCheckout, both of which succeed and the payment goes through. I'm setting up a future payment / pre-authorisation on the SetupExpressCheckout and the user agrees to that no problems.
​Do I need to change settings on the merchant in the sandbox? Am I calling things in the wrong order maybe? (SetExpress, GetExpress, DoExpress, CreateBilling)?
​I'm looking to use this billing agreement to allow a reference transaction in the future. I'm having a test account 'pay' using paypal and not forwarding any credit card details, the payment is for a digital service with no delivery (no shipping is set, no addresses or delivery costs are involved). The overall goal is to provide a one-click re-order button, whereby no details need to be entered by the customer.
I'm using the C# api in asp.net 4, or more specifically I've created Service References from the paypal sandbox wsdl and I'm using those in asp.net.
​Any and all help is appreciated - thanks.
​Russell.
You don't need to call CreateBillingAgreement if you're specifying billingtype MerchantInitiatedBilling in your SetExpressCheckout and DoExpressCheckoutPayment API call. CreateBillingAgreement is only necessary if you don't want to call DoExpressCheckoutPayment.
If MerchantInitiatedBilling is set, DoExpressCheckoutPayment will already return a billing agreement ID, which you can use in DoReferenceTransaction.
I don't have access to an example at hand, but will update this post as soon as I've found one for you.

Resources