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?
Related
I am trying to integrate a payment gateway by creating a plugin. So I'll need a page where after the user places an order and pays, the payment gateway will redirect to with some query params which I can use to verify the status of the transaction. I'll appreciate any help
I have install woocommerce in my wordpress application and also install eway payment gateway plugin. it is showing perfect on my default checkout page.
But i want to call it on different location ( i have donation page in my application and want to use eway there as well) as I am new to wordpress got stuck very badly.
please give me suggestion whatever possible and ask me for code if you want any.
Basically, you can't use eway payment gateway without e-commerce plugin. Which means you need product :), and you can't consider a donation as a product at all. I am sure that you have installed the plugin for Woocommerce only. To integrate eway on donation page you need to use eway API. here is the reference for the same.
https://www.eway.com.au/developers/api
We are planning to use a payment gateway that does not have a standard woocommerce plugin. Before we did that, I wanted to know is it even possible to do this?
Basically we will have the API from the Payment gateway (in PHP) and will need to make calls to get a payment processed and send a success / failure response to Woocommerce -
Is this even possible? If so, any leads / documentation on how to do this would be highly appreciated.
Please follow below tutorials to create plugin for payment gateway you wish:
https://www.sitepoint.com/building-a-woocommerce-payment-extension/
https://docs.woocommerce.com/document/payment-gateway-api/
I have installed woo-commerce subscriptions on my word-press site, integrating a payment gateway for checkout. The gateway is not supported by woo-commerce directly.
I have the checkout page and the payment processing page with code provided by the gateway to process the online payment.
I need to update the subscription status for the customer once his payment has gone through successfully via the gateway and the confirmation is received back.
Any pointers on how to update the subscription record in woocommerce subscriptions using a php code snippet would be very helpful.
I have searched around and found links on how to add a product in woocommerce, but not much on how to update or add a subscription record using a custom php snippet.
The solution is to create an order, then create a subscription, link the order to the subscription using woocommerce classes. A very helpful link found on SO outlines the steps:
wordpress.stackexchange.com/questions/202873/
The response given by Jeremy Warne worked for my website's logical flow.
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.