I'm using Paypal access to login. But after login I need the paypal transactions.
I used sample code from https://github.com/paypal/paypal-access
Everything worked fine. But I don't understand how to get the transactions. Is that possible using Paypal Access? if not then how to do it? You may take a look at http://www.storenvy.com/ . They pulled paypal transactions.
Any idea?
You can use the TransactionSearch API combined with GetTransactionDetails to obtain everything you need.
Related
i'm using CreateInvoice.php this code for creating paypal invoices. But problem is just like express checkout and formal paypal checkout i can't figure out how to add notify_url , cancel_url, return_url while creating invoices.
And in samples i can't find how to accomplish this job.
The parameters you are asking about are not relevant to the invoicing API.
notify_url is to specify an IPN URL. The REST API does not use IPN, though. Instead, it uses Webhooks. You can register those manually within your REST App in your PayPal developer account, or you can set them up with the API.
cancel_url and return_url are used with things like the checkout APIs so that PayPal knows where to send the user when they make those actions. The CreateInvoice invoice API would not need this, though, because there is no redirect to PayPal / login happening with the user.
Instead, it's simply using your API credentials to create the invoice and give you a success or fail result. Based on that result you can redirect wherever you want. Again, you're never leaving your app in this case, so you don't need to specify where to be sent back.
Hope that helps.
My requirement is that i need to use a Hosted (uk) solution to generate a reference transaction token that can then be called periodically without the user having to initiate the transaction again.
Currently, using the classic API I have something akin to a reference transaction working, however this requires the user to have a PayPal account - I also need to be able to accept card details (no PayPal account).
The only way to accept card details seems to be with the hosted (uk) solution however I have no idea how to set this up. So, I guess the questions are this:
1) Am I able to allow card AND PayPal account for the reference transactions?
or
2) How do I setup / configure a hosted solution? or is this simply a case of using the docs and an iframe with no config in the PayPal account?
For your second question - Yes it is straightforward. See the Hosted Docs and integrate.
As #DiceyRamp has stated the hosted solution is just a case of using the docs, no account specific setup is required.
To answer the first question :- it is NOT possible to use the PayPal Hosted API for Reference Transactions. You instead must use the Button API to create a reference token. In order to generate a token without a purchase you must go one further, generate an order and then immediately void it.
Credit where credit is due, this was answered for me over email by another developer. Im including his explanation here in the hope that it helps others.
Paypal button API Examples
The specific process is this:
We create an iframe url using the PayPal BMCreateButton method, with the BUTTONTYPE set to “PAYMENT” and the BUTTONCODE as “TOKEN”. We then set all the usual order parameters up (name, address, notify_url etc) and then url encode them. We then execute the BMCreateButton with the above arguments set, this gives us an iframe url which we render on the page.
To generate a token we use a dummy £1 order.
The code that executes on the “notify_url” basically takes the IPN message, and if the result is ‘VERIFIED’ then it stores the ‘txn_id’ as the token.
This can then be used later on a Paypal DoReferenceTransaction API call, using the txn_id as the “REFERENCEID” parameter. The notify_url code will NOT store the txn_id if the IPN states the order was a VOID, you can’t do a repeat against a void, so we never store the void txn_id as a token.
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 looking for a way to build a web application using paypal payments standard. I'd like the user to get redirected to paypal, then fill out their information, and upon completion, add a value in our database saying that they successfully paid. I haven't found a solution or answer to this.
I found this thread for RoR, but didn't find anything for PHP
Paypal Website Payments Standard with a Ruby/Rails application
You can see instructions for a Payment Data Transfer at PayPal's site. Basically, you post the transaction amount and an ID token to their site, the customer pays on paypal.com, and then they're sent back to a pre-defined URL on your site with the transaction details.
I used the NVP API to do that.
I'm trying to link my 3rd party shopping cart to PayPal, and in the process I'm finding that my variables are extremely exposed, such that, if someone uses, say, Firebug, to manipulate the values of my variables, they can change the cost of the items in the transaction.
I'm very new to online carts and shopping, so my question is how do I keep this layer of exposure away from users and secure for the website?
The answer is in the Instant Payment Notification service.
Upon completing the transaction, PayPal notifies you, in a separate process, of the payment details for the last transaction.
You can check these details against the data you stored locally. If they match, all is fine. If they do not match, you will need to investigate the issue.
Never understood why PayPal does not allow the data to be signed with some sort of hash + shared secret... but that does not help you any further.
If you POST the variables to PayPal, you can encrypt the data. Unfortunately, this is not possible for a GET request, triggered from a redirect.
There is a way of getting PayPal to host the button variables on their side. Look out for PayPal Hosted Buttons in their documentation:
https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ButtonMgrAPIIntro#id093VD0JE0Y4
Otherwise verify with IPN as mentioned bu Jacco.
Use the PayPal NVP or SOAP API to create an encrypted button. Basically you set all the information using PHP and then the API gives you the HTML.
Alternatively if you only have a couple of products you can make custom buttons.
The API's are well documented and easy to use. Personally I used the NVP as it was recommended for less experienced programmers. You can also use both in with the IPN (Instant Payment Notification) system so that for example digital products can be automatically emailed.