Pull data from paypal email into PDF? - php

I have had a look online but couldnt find any information on this even though I feel it would be a regular question, I have a shop at the moment that has been built and runs via html code. The user purchases an item then I get an email from paypal with all the information (address, item etc).
I was wondering is there a way I can pull the information from the email and place it automatcially into a pdf delivery note? At the moment I copy and paste then send it to the warehouse however it would be great if I could get this process done automatically...

Instant Payment Notification (IPN) is what you want to use for that.
Any time a transaction hits your PayPal account their server will POST all of the data about that transaction to a listener script on your server. Your script receives that data and can process it accordingly, including updating your database, hitting 3rd party web services, or simply sending out email notifications with attachments.

Related

Processing Authorize.net relay response with PHP

I am kind of a newbie when it comes to online CC processing integration. I am in the Sandbox at Authorize.NET trying to configure my server to process SIM orders where the payment page form resides on the Authorize.net servers and processes the order. By default it looks like the confirmation is on their sites, and e-mails can be configured to be sent to the buyer and the seller. That is all working in the Sandbox. However, I am trying to capture some of the order and processing information on my server using the relay response. My processing page is accessible on my server, although I must say that I have .htaccess limited intermittently because it is still in development. I turn that off when I am testing.
The error that I am getting is:
An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.
I can't tell if they are POSTING data to my page or not, and I'm not really clear on what goes on the response page and how to parse the response. I am using the PHP SDK provided by Authorize.NET. The rest seems to be working. I am getting e-mails for the buyer and the seller and the order is proccessed but I'm not capturing the information on our server. What I would like to do is bypass their confirmation page, receive the relay response, create a custom confirmation and capture some of the data for our database. I'll keep digging because I made a fair amount of progress just reading the docs. This one is particularly useful.
Thanks.
I figured it out. There was an error on the page giving a "500" error. I have to say, it is a little strange the way they have it set up. They are POSTING to my page, where I am capturing the POST data, writing stuff to a database, and then creating a custom confirmation message, although it must be via a header redirect because it shows up on their server (their domain is in the address bar). It all works, but apparently, any SESSION variable values are not available to my script in that case?

PayPal "Thank you" page, with details

I'm working on setting up a page that will display some information to the end-user after they make a purchase through PayPal. This page will have quite a few different tasks that it will need to execute to ensure the user receives what they had paid for, this mostly includes displaying information for the user in-case something goes seriously wrong, for example: The email containing product information is never sent.
In this event I would like to instruct the user to fill out "X" form providing their custom transaction id, however I don't know how I'd pass that custom transaction id to the thank-you page from paypal.
I know how to use the IPN, and I'm rather familliar with it. I've always used it to send emails, etc; However here, considering I'm selling a virtual product, I need to make sure it's delivered automatically, and providing enough information so that any problems can be dealt with accordingly.
IPN itself is all you need. You can generate email notifications with a download link or an attachment of the digital item that you're selling and it will be delivered in real-time. It will also help you handle things like e-checks correctly so that the goods aren't delivered until the payment actually clears as opposed to when the first transaction (the pending e-check) comes through.
If you do want to display data on the thank you page (assuming you're working with Payments Standard) then you can use PDT, which is very similar to IPN except that it's intended to send data back to the thank you page. This is for display purposes only and is not recommended to be used for updating the database, sending emails, etc.
Yet another option would be to move to the Express Checkout API. That way the checkout flow will always finish on your site without setting up any auto-return or PDT features, and you can do whatever you need to do in the thank you page code very easily. Again, though, it's still recommended to use IPN for final post-payment processing so that you can handle things like pending payments.

eCommerce membership subscription after payment

I am creating a site in which a user must pay in order to access certain parts of the site. I understand how to make certain pages available to certain users, but I would like to know how I can automatically give them access once their payment has been processed.
ex.) A user sets up a account, during the process it will ask for credit card or other payment info(I would like it to be through Paypal). Once the payment has been processed it will add the user to my database and then they can access the site.
I am new to eCommerce and would like to know what tools I can use so that when a purchase on my site has been processed, I allow the user to access the website.
note: My site is being built with PHP.
I would recommend using Instant Payment Notification (IPN) for that.
It's basically a script that sits on your server listening for data. Any time your PayPal account has a transaction that takes place it will automatically push data to your listener script in real-time. Within that script you can update your database, send out email notifications, etc.
Here's a PHP template for IPN that I developed years ago. It's a little rudimentary, but still very useful and will get you up-and-running with IPN within minutes. Then all you would need to do is make some basic additions to update your users table accordingly, but the template comes with a nice database class that makes that very simple as well (assuming you install the IPN template solution to the same DB as your users table.)

Create Ticket in VTiger

Once I have a client contact information saved in Support Module, I could get the following things done..
Client sends e-mail to suport#company.com
Mail Scanner scans, creates a ticket.
A notification is sent that email is received by support team to client.
Admin assigns the ticket to someone, client recieves an email that the ticket is being assigned.
Client replies to the email, the ticket gets updated in the comment.
How ever if I dont have the client information saved, only the ticket is getting created.
How do I auto save the person contact information as soon as someone sends an email to support#company.com?
This sounds like you need to build a vTiger custom workflow.
https://wiki.vtiger.com/index.php/Workflows
https://www.youtube.com/watch?v=CN-zll3wAeI
All I can offer is the links above. You would then have to either code this yourself with custom code or see if you can set up a workflow and a CRON job in vTiger.
Good Luck

Flow for: fill form, make paypal payment, create account

I've implemented a paypal transaction before but this one has a twist that I'm not quite sure what's the best way to handle it.
The basic idea is I want to create an account for the user when he provides some details and makes a payment via PayPal. Until BOTH the user details are filled out correctly AND the payment is made correctly, I shouldn't create an account for the user.
The setup I've done before was simply a paypal button that the user clicks, makes a payment, and gets forwarded back to just a generic page "your order will be processed and shipped" so there was no pre-order form involved.
This one is different though because
before PayPal, I need to collect initial user data
after PayPal, I need to create the new user account and use in it the user data collected from the pre-paypal form
I'm sure there's a logical way to implement this, but I'm not quite sure what's the flow I should follow to do it.
I use the Zend framework by the way, which shouldn't matter but just in case Zend has an easier way to help me with what I'm trying to do.
I do the following (though I do this in ASP.NET):
User fills out form
Info is saved in Order table in db with a unique invoice number
Invoice number is passed to PayPal, along with the IPN Notify URL, when you do the redirect
User is sent to Paypal to pay and then comes back to a generic Success page
Behind the scenes, Paypal makes a call to the IPN Notify url once processing is complete. This page receives your invoice number which PP returns with its call, and then does the account creation processing for that order after retrieving the details from the db. [This is a page with no UI, since only PP is hitting it.]
An email is sent from that process which notifies the customer that their account has been created and gives them the details.
This is a simplified version of the process, but hits the highlights. You can check out PayPal's page about IPN, and do a search on google for IPN integration with PHP.

Categories