Wordpress users to pay to publish post - php

There's this wordpress theme I'm working on. I have a user role titled "professionals". I want users assigned this role to be able to publish posts if only they have paid or subscribed. I will like to integrate PayPal or any good payment processor to handle payments. How can I achieve this?
I will appreciate if you can recommend link(s) or plugin(s) that could help achieve this.

Woocommerce is a very popular plugin for payment processing and has a subscription service style payment too. You could integrate this into your site and then use a simple conditional statement to see if they are a subscriber and if not send them to the signup page.

Related

How to handle payments with Wordpress WooCommerce Mollie REST API

I am wondering how to implement payments in Flutter(or any other framework, like react or angular).
There is an existing website built in Wordpress and WooCommerce. The following plugin is used:
WooCommerce
Mollie payments for woocommerce (https://nl.wordpress.org/plugins/mollie-payments-for-woocommerce/)
How can I handle a payment, that matches the order id and moves the user to the payment banking screen?
When a user presses the "Checkout" button in the frontend, do I need to do the following?
Call a custom function that was made in Wordpress PHP (wp-json/payment/create)
Call the woocommerce endpoint create order in that PHP function. https://woocommerce.github.io/woocommerce-rest-api-docs/#create-an-order.
And then call the mollie endpoint create payment in that PHP function? https://docs.mollie.com/reference/v2/payments-api/create-payment. Put order id in parameters that I received from the woocommerce endpoint.
Then return the redirect link to the react or flutter app
How can I know that the payment is succesful? Then I can call 'update order' and set the status from 'waiting for payment' to 'processing order'. (So Wordpress admin can see that the customer paid.
I could not find a tutorial on this topic and therefore I decided to make this question public. I only saw wordpress tutorials... So I hope this question can help a lot of people.
How far are you with this? Because I don't know if using the regular mollie plugin is going to help out.
Mollie has documentation on how to also implement their api on JS framework.
The question you need to answer first is:
Are you able to create an order using the WooCommerce API. So can you order a product, without actually using a payment gateway (the add to cart to checkout flow)?
Have you tried using the Mollie nodejs version?
A tip:
Any payment gateway(stripe, mollie etc) add the order_id as meta_data on a order. So after going through the payment flow the order has to be created, with the right payment_id + the status (failed, pending blabla).
Edit:
Another option could be to create custom endpoints which loads something like this: https://github.com/mollie/mollie-api-php
So maybe something like:
create the order using the woocommerce api
after creating the order, return to the js app and then trigger another endpoint
this endpoint would load the custom Mollie api
I hope this makes sense?

Accepting paypal payments via WordPress plugin

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.

keep a track of paypal payment made online

My question may seem to be very basic and view dependent but i wish to know every aspect of it.
I have created a mobile app where the users need to register themselves in order to use the app, but my client wishes to have the admin panel in the form of a website, where the user can register themselves by paying a specific amount through paypal and then they can use the mobile app version.
I have completed the main page and have created the paypal button on the user page, but for the admin page i wish to show a list of all users who have successfully paid for the product.
Is it possible to do so, can i keep a track of user details and their payments on the website??? if yes then can anyone guide me with it, would appreciate some help
use Paypal IPN to save the paypal transaction information to your database.
Use a database. Save each payment record after payment maybe.

receive payments with paypal

I'm creating a really small website where I'll sell some products.
I need this website to show the available products, the users can add to the cart, and pay at the end, then I'll send the product for them by my self. It's a really small business.
I was taking a look at the paypal options and I didn't understand very well how it works.
For what I understand, with a free account I can only use their buttons, but I can't have a dynamic solution where I can manage my products on my website (look's like I need to add the products information like name and price on their website ).
What I wanted to do was just use my own website to handle this very simple store/products, and at the end, the user click on a CheckOut button, and Then I redirect the user to a paypal page where they can pay for the total value and then paypal redirect them back to me ( as a free account or at least with the 5$ account ).
Is that possible?
By the way I'm using CakePHP to build that, and I already have the website built with this framework, and to build what I need it's more than enough, I don't really need any solution like magento or others eCommerce platform.
Thank you.
If you use Paypal's free account then your visitor will leave your website, go to Paypal's website to make the payment, and then return to your website. Paypals paid version allows you to keep your visitor on your page, but you have to program you site to work with their API. Plus the cost can add up. Paypal also has other service other than just buttons. For instance they have a shopping cart too, but here again your vistor will leave your website to go to Paypals site to add the items to the shopping cart.
Another company that you might want to look at is https://stripe.com/ here you keep the vistor on your site as well as only paying per transaction rather than a monthly fee like at Paypal.
If you want to manage your items and inventory from your website and not enter everything into buttons at PayPal.com, I would suggest that you use Express Checkout. Express Checkout is also a free service and allows you to send all of the payments details to PayPal via API and PayPal will authenticate and allow your buyers to select shipping details. The user can then be redirected back to your website to complete their order.
You can find additional information here: https://www.x.com/developers/paypal/documentation-tools/express-checkout/gs_expresscheckout
Thanks,

Moodle Plugin to register new users using Paypal?

I'm trying to implement a plugin in Moodle where new users are registered using Paypal.
And the registration for the new users will require paypal payment to complete registration.
If anybody can help me with any example, code, plugin, or any link, I'll be grateful.
PayPal enrollment is included as part of Moodle's core code, so you just need to enable and then configure it. Documentation is here. This covers enrollment in a specific course, rather than new user signup as typically people want to charge different amounts for different courses, rather than a flat rate for access to everything.
There is no existing PayPal authentication plugin to make it so that a user must pay to register on the site, but if you want to make one the developer docs are here.

Categories