#148

Product support

Get help in the plugin support forum.

Categories

  • Developer Tools
  • E-Commerce
  • Utility

PLEASE NOTE that this plugin only adds a payment gateway to your own projects. You will have to create your own table and write your own code to create orders first. You only add this plugin after you have created this functionality yourself. This plugin works great with my Room Booking plugin and Workflow plugin

If you are unable to create your own table and write your own code to create orders this plugin will not be of use to you. This plugin is not a shoppingcart it does not create an order, it only handles payments for orders.

Features

  • A standardized way to add online payments using Omnipay (https://omnipay.thephpleague.com/)
  • You can (re)use this standardized plugin to handle your online payments for many different projects
  • This is just a payment gateway, you will have to create the orders first yourself

Supported Payment Service Providers (PSP's)

  • Mollie - iDeal, creditcard, PayPal, Bitcoin, etc.
  • PayPal Express - PayPal and creditcard
  • Stripe (code your own components)
  • ... (please contact me if you would like others)

This plugin automatically includes the following packages for you through composer.json when installed from the marketplace:

{
    "require": {
        "league/omnipay": "^3",
        "omnipay/paypal": "^3.0",
        "omnipay/mollie": "^5.0",
        "omnipay/stripe": "^3.0"
    }
}

Requirements for using the default components

  • After you create and store your order yourself you redirect users to a page on your website using the $_GET['id'] parameter to identify the order ID.
  • You have to create the table you use to store orders in. It should have at least columns with the following functions (the actual column names can be mapped in Settings > Omnipay):
Column Function
id (int) unique incremented ID (e.g. 132)
paymentid (varchar) set by PSP
description (varchar) description of what is purchased
currency (varchar) currency (e.g. EUR)
amount (decimal) amount (e.g. 100.00)
ispaid (boolean) if the order is paid (e.g. 1)

A word about payment process flow (and Stripe)

Online payments should be handled by a Payment Service Provider (PSP). The PSP is the only one who needs to know your creditcard details. This is how Mollie and PayPal are designed.

  1. Collect order details on your website (products, pricing, shipping information)
  2. Save the order in your database
  3. Prepare the payment using the API of an PSP (e.g. request and store a paymentid in your database)
  4. Redirect the user to the website of the PSP (e.g. include the orderid)
  5. Pay on the website of the PSP
  6. Redirect the user back to your website (e.g. include the orderid)
  7. Check if the order is paid using the API of an PSP (e.g. check the status of the order using the paymentid)
  8. Mark the order as paid in your database
  9. Provide feedback to the users
  10. If the order was not paid use a webhook to periodically check if the order is paid

Some Payment Service Providers like Stripe actually do collect creditcard details on your site. Yes, I know these details do not have to be stored on your server and are send over SSL but I personally have a problem with this as there is no way for the visitors of your website to be sure that you do not store creditcard details anyway (for whatever reason).

The point being that as a visitor of your website I now do not only have to trust you to send me the items that I purchased on your site (creditcards are insured against this scenario) but I also have to trust that you do not store or transmit my creditcard details in a manner that is potentially insecure (even if you do not need to store creditcard details yourself you could if you wanted to). 50% of those fears would instantly go away by only asking for creditcard details on the website of the PSP. Stripe currently does not offer this possibility.

I have included Stripe but you will have to code your own components.

PLEASE NOTE PayPal Express also supports guest checkout using creditcards for visitors who do not have a PayPal account. You enter creditcard details on the website of PayPal.

Getting started

Hello, I am Wiego Bergsma. Please start by reading the whole documentation! If you have any questions, find a bug or experience difficulties getting the plugin to work please use the Support Forum. Only leave a Review if you are happy with the plugin or are still unhappy with the plugin after reaching out to me in the Support Forum. Thank you! Wiego

  1. Go to Settings > Omnipay
  2. Map the columns of the database table you use to store orders
  3. Add the needed components to the correct pages on your website

Pay component

Add this component to the page on your website you redirect users to after creating the order and writing it to the database. This component uses $_GET['id'] to fetch the correct order from the database.

Please enter the following properties:

Property Description
Table The name of the table you store your orders in
PSP The Payment Service Provider you want to use
API-key The API-key (Mollie)
Username Username (PayPal)
Password Password (PayPal)
Signature Signature (PayPal)
Test-mode Test-mode (PayPal)
Return URL The PSP will redirect users back to this page on your site
Cancel URL The PSP will redirect users back to this page on your site

Paid component

Add this component to the page on your website your PSP will redirect users to after completing the payment. This component uses $_GET['id'] to fetch the correct order from the database.

Please enter the following properties:

Property Description
Table The name of the table you store your orders in
PSP The Payment Service Provider you want to use
API-key The API-key (Mollie)
Username Username (PayPal)
Password Password (PayPal)
Signature Signature (PayPal)
Test-mode Test-mode (PayPal)

Feedback to users

The component paid returns feedback to the user upon returning to the website. You can either overwrite the partial or use the page variable paid in your HTML (it can have value 'yes' or value 'no').

Events

I have made 2 events available: briddle.omnipay.pay and briddle.omnipay.paid. You can use these events in combination with my Workflow plugin to send confirmation mails etc.

1.0.4

Added backend translations and provided feedback view to Paid component

Oct 05, 2018

1.0.3

Fixed bug in marking PayPal orders as paid

Oct 03, 2018

1.0.2

Added notifyUrl.

Oct 03, 2018

1.0.1

Initialize plugin.

Oct 02, 2018