I am new to paypal and use sanbox.
I'm trying to implement the paypal payment platform on an online sales page and I get an error; When creating an app in developer paypal (generates my client id and its normal secret) and use it on the page I get the following error;
PayPalConnectionException in PayPalHttpConnection.php line 154:
Got Http response code 401 when accessing
https://api.sandbox.paypal.com/v1/oauth2/token.
But if I use a public credentials (taken from the internet) if it works and I redirect to paypal correctly ..
What am I doing wrong? I need something to check
Thanks in advance
Use a package like anouar/paypalpayment or omnipay/paypal and it will be much easier for you to implement it.
You need to create sandbox account, your regular account not work on sandbox, search on google for sandbox account for test, you can even create buyers with money on the account to simplify your tests.
yes friends, I understand that I had to create a Sandbox account and so I did and still does not work when creating my app.
I am creating an application in laravel and I need the cliend id and the secret of a sandbox api that is why I am trying to implement this method. I hope to see if anyone can come up with a way to solve this problem.
Why does not my account generate a valid client id? Why does any other internet work?
Related
To give you an overview of my platform, I am using Angular.js 1.5 and Laravel 5.1.
I am using the Paypal REST API SDK for PHP. I have followed the instuctions from this Medium article. On my front end Angular side, once I successfully call the first "postPayment" function, I receive the redirect url, which I redirect to. Once the user completes their payment successfully on the paypal side, the return url comes back to my confirmation page where I handle the "getPaymentStatus" function from the Medium article.
I am using a Sandbox account for testing purposes right now, but I am able to successfully complete the transaction when a user logs in on the Paypal side. However, when a user tries to go through as a guest "Debit/Credit card", enters their information, and completes the transaction, I receive this 400 error in the console:
POST sandbox.paypal.com/webapps/xoonboarding/api/onboard/guest 400 (Bad Request)
jquery.min.js:5
On my Paypal profile settings, I have activated the Account Optional in the My Selling Tools->Website Preferences. I have been looking for other instances of this, but I cannot find a solution. I have tried using the test credit cards with various phone numbers, but that does not resolve this issue.
Has anyone dealt with this issue before? I am in the dark and do not know how to handle this.
I would appreciate any help in this. Thanks in advance!
I am trying to setup my code to archive every transaction from the PayPal user's account. I have the PayPal SDK setup and the auth token is stored in my database.
I am using the paypal/PayPal-PHP-SDK and the PayPal\Api\Search but I don't know how to use it. Any suggestions?
Whats the best solution to pull all of the transactions from paypal, is it possible?
The example is here: PayPal-PHP-SDK/sample/sale/GetSale.php
You need to get all payments first - https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/ListPayments.php
I'm fairly new to the PayPal API and am a bit confused about using API signatures to attach to the REST API. I'm creating shopping cart software, and I'd like to allow merchants using the software to attach the system to their PayPal account using their API using PayPal username, password, and signature. They'd enter this information into the account settings when setting up their cart.
On the merchant's side, it seems like this is easily possible, and says to do this to grant API access specifically to shopping carts:
htttps://paypal.com/us/cgi-bin/webscr?cmd=_profile-api-access (once logged in as a merchant).
I personally am using PHP to call CURL, though that probably is not important. What I don't understand is that in the REST API documentation, including the "make your first call" doc, it notes I should send my "clientid" and "secret," but not the merchant's "username","password," and "signature".
https://developer.paypal.com/docs/integration/direct/make-your-first-call/
Now, when I originally logged in as a developer, I was able to obtain my "clientid" and "secret," but that was for my application. I've successfully made test calls with them, using PayPal's test pages. But these of course seem to be for me, not for a particular client.
Now the "Classic API" documentation does have information on connecting to the SandBox using the merchant's info.
https://developer.paypal.com/docs/classic/permissions-service/ht_permissions-invoice/
So I think I'm just mentally missing something, or misunderstanding something fundamental. Assuming I have both my developer credentials, and the API credentials of a merchant, what are the general steps in making a payment to the merchant (not me). What's the logical step I'm missing?
Thanks much to anyone who can help.
Unless corrected by Paypal folk, this seems to be the flow (just went through it):
Ask the merchant to add you as a User, I suppose with API access privileges (only)
They will set your user id and pwd, which they should then provide to you.
You'll then login with that User Id (not an email address) into Paypal (at this point, you're a "user" of that merchant/account) with whatever privileges your merchant provided you.
create the App in the developer site for your merchant - you'll notice that when you get there, it's the Merchant's name displayed (it's not "your" developer account)
At this point you should be set (sandbox and live REST credentials of the merchant from the app you created). One thing I noticed (good) is that it somewhat already helps you see what "live privileges" the account has..so it helps guide you as to what to integrate (scope) and/or advise your merchant to do - e.g. may or may not be eligible for direct credit card payments (only Paypal account payments).
Hth..
#EdSF and anyone else looking into this, I just received a response from PayPal merchant help. Turns out you were spot on Ed. They don't have this ready for REST. Seems pretty odd given that they're 1.) pushing REST on their developer site but 2.) showing that the signature set is how to connect to a shopping cart on their merchant side.
So answer is to use the old API for now, or have them go through the extra hoops of the steps you/they mention, instead of following the directions on the PayPayl site :-P Oh well. Their response in full below.
Hi ...
I am writing this email regarding your questions on PayPal Permission Service. Unfortunately the Permission Service is not available in REST API; however I will file feature request to our development team for their further consideration.
It is not possible to use API username, password, and signature in REST API because they are actually not the correct credentials. REST API uses Client ID and Secret for integration. If you develop your application for other merchants, you can ask them to obtain Client ID and Secret by creating apps in PayPal Developer Portal (https://developer.paypal.com). Here's the steps:
1) Go to http://developer.paypal.com and log into the website with PayPal account's login
2) Click 'Dashboard'
3) In the My REST apps page, click "Create App"
4) Enter the App name, and click 'Create app'
5) You should be able to see 'Client ID' and 'Secret' for 'sandbox credentials'. If you want to integrate with your live account, click 'Show' at the Live Credentials section.
Hope the above information helps. Thanks.
Sincerely,
...
Merchant Technical Support
PayPal, an eBay Company
up the pay-pal advance in magento . I have fill all the credentials in magento admin . BUt when i go to frontend and click pay-pal button it gives
PayPal gateway has rejected request. Security header is not valid
(#10002: Security error
i have googled a lot and found some suggestions like
Remove API Username, API Password and API Signature from
Admin->configuration->Paypal->API/Integration Settings. clear cache
and test again
i have tried all these but it still gives the same error.
Please suggest me what can be the issue
The Security header is not valid error is only caused for two reasons:
Wrong credentials
Make sure that you've put your API Username, API Password and API Signature correctly. Sometimes it happens that during copy and paste there is accidently a space added, this would trigger this error.
Doublecheck this settings in the SDK or in the admin panel of your third party shopping cart.
Wrong Endpoint
This error would come up if you send the data to the wrong endpoint. Make sure that you sending the live credentials and data to our live endpoint. When you want to test your store make sure that you use our test endpoint and the credentials from your sandbox test account.
If you are using a third party shopping cart, make sure that your store is running in test or live mode, regarding which credentials you are using.
You can check for your credentials here too:
FOR LIVE
https://api-3t.paypal.com/nvp?&user=xxxxxxxxxx&pwd=xxxxxxxxxx&signature=xxxxxxxxxx&version=70.0&METHOD=SetExpressCheckout&RETURNURL=http://www.paypal.com/test.php&CANCELURL=http://www.paypal.com/test.php&PAYMENTACTION=Sale&AMT=50&CURRENCYCODE=USD
FOR SANDBOX
https://api-3t.sandbox.paypal.com/nvp?&user=xxxxxxxxxx&pwd=xxxxxxxxxx&signature=xxxxxxxxxx&version=70.0&METHOD=SetExpressCheckout&RETURNURL=http://www.paypal.com/test.php&CANCELURL=http://www.paypal.com/test.php&PAYMENTACTION=Sale&AMT=50&CURRENCYCODE=USD
Just Substitute the user, pwd and signature and enter in your browser.
You should get ACK = SUCCESS if you have input your credentials correctly.
You can also get your credentials here : https://www.paypal.com/cgi-bin/webscr?cmd=_get-api-signature&generic-flow=true
This error simply means your credentials are wrong.
Please check with the credentials. If you are using sandbox then you are supposed to provide facilitator related credentials.
Dont let the others fool you, they just type in stuff here they googled on the internet.
Look for the number you get here: https://developer.paypal.com/docs/classic/api/errors/
Because the information provided by these code is a delicate matter, they display this error message instead of you account is locked, account restricted, limit exceeded and so on.
Thats what they told me, at least.
We also get this code from time to time, after hundreds of paypal transactions, so wrong paypal credentials from the side of the shop owner is quite unlikely, isnt it? ;)
If you are using PayPal Payments Advanced with Magento, you should be using your PayPal Manager credentials, and not your API Credentials.
This could be the reason you are getting Security Banner Header not valid 10002.
Here is the integration steps from Magento:
PayPal Advanced Integration with Magento
You need to setup Layout C in PayPal Manager PayPal Manager Login.
Make certain that you include your error URL, cancel URL, and Return URL. Magento is very good about telling you what URL you should be using.
After you have setup Layout C in PayPal Manager you need to use your Manager Credentials in Magento.
Just in case you need it, here is the information on setting up your Hosted Checkout Pages in PayPal Manager:
PayPal Hosted Checkout Pages
Here is the information on where to find your PayPal Manager credentials:
Partner: Your PayPal Partner ID. Most direct Merchants have PayPal as the Partner
Vendor: Your PayPal user login name. Also known as Merchant Login
User: The ID of an additional user set up on your PayPal account. Same as Merchant login if you have not setup a separate user id in PayPal Manager.
Use your API Signature Credentials from your PayPal account for the Express Checkout setup.
In my case everything seemed fine at Magento level. I asked client questions about PayPal, at which point they tried to login to the paypal.com site and were unable to (authentication failed). Account had been locked. Client was able to resolve with PayPal tech support directly, no Magento issue after all.
I got the same problem and found the problem is
I type the API signature character by charter, the character "I" is similar to "l"
As there are multiple "I" in the signature, I have to tested one by one via the link mentioned by Vimalnath.
Then damn it, it works.
Therefore, copy is a better way while being careful about the spaces at the front or end.
I try sample files inside latest php API for adaptive payment (1.96) and creating a primary pay. then did pay with my sandbox account and every things working fine. I use the same process and integrate API with my php application.I'm able to create primary payment and get payKey. I use payKey and do payment. I login with my sandbox personal account and click pay then see this problem:Your payment can't be completed. Please return to the participating website and try again.
Note: I did not change any config.ini information.I create multiple pre-confiq accounts in my developer and put them as sender or receiver through sample and application test.both API sample and application environment are virtual hosted on my local machine.this is paymentDetail object info
I found problem.
I was resetting test account and creating new test emails that noted on one suggested solution and forgot to replace new email in my integrated application.
by the way replacing new email solved my problem.