Accepting paypal payments via WordPress plugin - php

I am currently developing a WordPress plugin that allows users to accept paid guest posts. The scenario goes like this: someone visits the website of the plugin user, creates a guest post which is saved as pending and finally makes a one-time payment via paypal. Once the payment has cleared the post is published on the website.
Basically I need a solution where the website owner can specify just his or her email or merchant ID in the plugin options panel to start accepting payments.
The problem is I'm a little lost as to which paypal api to use and how to get started. There is a lot of information on the paypal website and I'm feeling a bit overwhelmed. Could someone please point me in the right direction?
Thanks

I would recommend using the Express Checkout API for something like that. Specifically, you'll be using SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment as explained in that first link.
My PHP class library for PayPal will make those API calls very simple for you, and you could even take a look at my PayPal for WooCommerce plugin to get an idea of how to use the library within a plugin if you need to.

Related

Paypal Third Party Shopping Cart Retrieve Information

Hi I'm creating a third party shopping cart using paypal for my client and i need retrieve some information after the payment is confirmed. I need to send an email to the seller with the product information like color, font-family, font-size, size of the product. But i have no idea of how can i retrieve the payment confirm information from paypal and then send to the seller this email.
Does someone knows how or just could give me a hint?
Thanks.
If you're not on wordpress, you can still use IPN data: have a read here: https://developer.paypal.com/webapps/developer/docs/classic/products/instant-payment-notification/
Note that Paypal's example code is not very good, and also that their IPN simulator is not currently working properly: Paypal IPN continually returns invalid from Sandbox
The PayPal IPN for WordPress plugin will make that very simple for you.
Just install the plugin and create a basic hook in your theme's functions.php file (or create a simple custom plugin file). The plugin has hooks so you can trigger based on any IPN, or based on the IPN transaction type or payment status.
Here is a link to the general dev guide and another link specific to the hooks available.
You could have the IPN solution working and sending an email within minutes, so then it's just a matter of building your email body the way you want.

how do i link paypal account with online store using php

I am not sure what this is called but here is what i am looking to do.
I am trying to make a php script that will create a link between our store account and paypal buyer, so that when they click our buy button it will process the payment without any future confirmations or user actions.
I have tried the paypal sdks and integration wizard no luck, Does anyone know of a working example of what i am trying to do?
Billing agreement(also called Reference Transactions) allows customer to agree the payment once on your website or app, then you call an API with the billing agreement ID to tell PayPal to charge the customer. Please see document here . You will need to contact PayPal to enable you to use Billing agreement, it's not easy to get approval:(
Integrating Paypal buttons are pretty straightforward.
Go to your merchant account.
Go to your Create Paypal Button page.
Choose whatever the button types you want. Configure it with Price etc.
Now just copy and paste the code generated.
It just works.
P.S
There is an option in your merchant account page to set the returning address from Paypal. You can set a returning page and catch all the transaction details via HTTP Post method when it is called by Paypal.
There is this Sandbox account type in Paypal which you can do a lot of playing with.

Using paypal on custom website and accept credit / debit Card

I have an issue right now that is killing me, I have implemented several payment options but never used paypal, I don't know why is it so complicated.
The website already exists and wasn't developed by myself.
I don't know the ammount of the order it is dynamic, so the "create payment buttons" on the paypal website doesn't work for me, at this point i developed a solution using
PayPal developers
But it turns out that i only have the option to pay with a PayPal account or register a PayPal account, I do not want to force customers to do this, it has no sense. is there any relatively easy solution out there using the same PayPal API?
EDIT
The whole site code is in PHP so i need the solution in this language
As you have mentioned that you are aware of one payment method i.e. Express Checkout ( in which user needs to have a valid Paypal account) so the other method which I think you need is the Direct Payment (i.e. a user can pay with credit cards directly without any Paypal account) API.
For this direct payment api you need to enable Website Payment Pro WPP , here you can get info about WPP.

Pay online service

I have a database where you can select articles etc, users have an account, it's all in mysql and php (i guess you don't need that code).
What i was wondering was how to write a script that allows users to pay online for the articles they selected?
It doesn't need to be any code, just ideas / hints / tips / ... (that are doable in PHP or something similar)
Thanks in advance!!
-Samuel
You have to do that through a service that collects money, such as paypal or a bank.
You make an account there, and they will provide the necessary files and documentation to do that.
Usually it will mean
when the user wants to pay, you redirect them to a specific page in the payment site
you host an IPN (Instant Payment Notification) file where that site will contact you when he receives a payment
I've done some paypal coding before and it is easy to set up, suggest that you should search for payment gateway that, i've work with ipay88.com before its one of payment gateway at my place.
Usually if you setup the paypal for the business transaction you will need to register as merchant account and they will charge you per transaction, same goes with payment gateway.
It is a very broad question. But basically you need to integrate some payment module, such as paypal. Look at their website, where there are tutorials on how to get it working with php.

magento payment process.. how it works in general

got a question and I hope this is right place to ask :).. don’t quite understand how payment works in magento.
client goes to checkout and lets say wants to pay as a guest, so provides address etc. and finally gets to payment methods. Then I want clients to pay thru credit card. Already have module installed for gateway (bank?) of my choice. At that point I would expect users to be redirected to 3rd party page (bank hosted) where they giving all the details, only after being returned to my magento site with appropriate message.
In magento however it seems like they need to provide cc numbers and details on magento checkout page. I don’t understand if I (or the payment module I installed) need to transfer then all the credit card details to bank? I would have to have checkout page on ssl connection and static ip right?
The thing is I want to avoid touching CC numbers at any point and would love to have it done by a bank page. I like the idea of magento interface all the way without redirecting to another page though, the only problem is not sure if would be able to set it all up properly.
If anyone could explain to me possible options, what is the common way to do it and how the whole process works that would be very much appreciated.
I did my research and looked all over google and various forums still need someones help though. Please let me know if some parts of my question are not quite clear, will try to better explain if necessary.
Had to develop a payment module for DPS in NZ some time back. How this works is, you go to pay on the site and the payment module php code runs that sends off the details to an acquiring institutions payment website who process the transaction for you with the bank. In my case as I recall it was DPS NZ via some soap calls. The Soap calls contained details such as the total cost, the currency, the merchant number to identify who you are paying. The acquiring institution (DPS in this case) then takes your credit card number and expiry date and do the processing. Then, again via some soap calls back to your own magento website you get redirected back with the error code - success, etc.
DPS use soap I think, but other payment websites may use other protocols to work. The other possibility is that your credit card acquiring page could be hosted on your website and you accept the credit card numbers and do all the processing within magento to the acquirer.
In short, the process is controlled by the payment module itself. If you want to see more detail, have a look at the payment module tutorials that are available and also the comments in the magento forums. You can also look at the paypal module code.
The default architecture that Magento payment modules use involves the customer interfacing with the module and the module talking to your payment gateway behind the scenes.
Basically the customer inputs all his data (CC and all) and hits the payment button at which point certain functions are run in the chosen payment module. What these functions do is entirely up to how the payment gateway works. if the gateway talks via XML they send/receive XML, if it needs SOAP then they use SOAP and so on and so forth. This in fact is the gist of building a new payment module. Open an existing one, check out which functions are called, get rid of the code in there and substitute with your own that will talk to your particular bank/gateway.
Of course some gateways have an alternate way of operating where you send the customer to their pages, he gives them his CC data and he is promptly returned to your site. This way you don't need to worry about handling credit card data, but unfortunately the process of implementing this in Magento is somewhat more involved.
If you need to use a certain gateway then you should first check whether a payment module for it already exists. if not you can download a similar payment module, dissect it and modify it to run your code where appropriate.

Categories