PluginProbe
PayPlug for WooCommerce (Official) / 3.1.0
PayPlug for WooCommerce (Official) v3.1.0
3.1.0 3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 All 102 releases
← All changes | vendor/payplug/payplug-php/README.rst +100 -15 1.2.10 → 3.1.0 View file →
@@ -1,5 +1,5 @@
1 -PHP library for the PayPlug API
1 +PHP library for the Payplug API
2 2 ===============================
3 3
4 4 .. image:: https://travis-ci.org/payplug/payplug-php.svg?branch=master
5 5 :target: https://travis-ci.org/payplug/payplug-php
@@ -8,40 +8,49 @@
8 8 .. image:: https://img.shields.io/packagist/v/payplug/payplug-php.svg
9 9 :target: https://packagist.org/packages/payplug/payplug-php
10 10 :alt: Packagist
11 11
12 -This is the documentation of PayPlug's PHP library. It is designed to
13 -help developers to use PayPlug as payment solution in a simple, yet robust way.
12 +This is the documentation of Payplug's PHP library. It is designed to
13 +help developers use Payplug as a payment solution in a simple, yet robust way.
14 14
15 -You can create a PayPlug account at https://www.payplug.com/.
15 +You can create a Payplug account at https://www.payplug.com/.
16 16
17 +Maintenance
18 +-----------
19 +
20 +CA certificate (cacert.pem) should be updated every year during the first week of December.
21 +Go to https://curl.se/docs/caextract.html to get a recent one.
22 +
17 23 Prerequisites
18 24 -------------
19 25
20 -PayPlug's library relies on **cURL** to perform HTTP requests and requires **OpenSSL (1.0.1 or newer)** to secure transactions. You also need **PHP 5.3** or newer for the PayPlug PHP V2.
26 +Payplug's library relies on **cURL** to perform HTTP requests and requires **OpenSSL (1.0.1 or newer)** to secure transactions. You also need **PHP 5.3** or newer for the Payplug PHP V2.
21 27
22 -For version **PHP 5.2** or older you must refer to PayPlug PHP V1.
28 +For version **PHP 5.2** or older, you must refer to Payplug PHP V1.
23 29
24 30 Documentation
25 31 -------------
26 -Please see https://docs.payplug.com/api for latest documentation.
27 32
33 +Please see https://docs.payplug.com/api for the latest documentation.
34 +
28 35 Installation
36 +-------------
37 +
29 38 **Option 1 - Strongly preferred)** via composer:
30 39
31 -- Get composer from `composer website`_.
40 +- Get composer from the `composer website`_.
32 41 - Make sure you have initialized your *composer.json*.
33 42 - Run *composer require payplug/payplug-php* from your project directory.
34 43
35 44 .. _composer website: https://getcomposer.org/download/
36 45
37 -**Option 2)** clone the repository :
46 +**Option 2-** clone the repository:
47 +
38 48 ::
39 49
40 50 git clone https://github.com/payplug/payplug-php.git
41 51
42 -**Option 3)** download as a tarball :
52 +**Option 3)** download as a tarball:
43 53
44 54 - Download the most recent tarball from the `download page V2`_ (V2 for **PHP 5.3** or newer)
45 55 - Download the most recent tarball from the `download page V1`_ (V1 for **PHP 5.2** or older)
46 56 - Unpack the tarball
@@ -53,19 +62,82 @@
53 62 __ https://bitbucket.org/payplug/payplug_php/downloads#tag-downloads
54 63
55 64 To get started, add the following to your PHP script (if you are not running a framework):
56 65
57 -.. sourcecode :: php
66 +.. code-block:: php
58 67
59 68 <?php
60 69 require_once("PATH_TO_PAYPLUG/payplug_php/lib/init.php");
61 70
71 +Project Git Workflow
72 +=====================
73 +
74 +This repository follows a specific Git workflow to ensure smooth collaboration and controlled releases. Please follow the steps outlined below when contributing to this project.
75 +
76 +Git Workflow Steps
77 +------------------
78 +
79 +1. **Create a feature or fix branch:**
80 +
81 + Before making any changes, create a new branch from the `develop` branch:
82 +
83 + ::
84 +
85 + git checkout develop
86 + git pull origin develop
87 + git checkout -b <feature-name>
88 +
89 + For a bug fix, use:
90 +
91 + ::
92 +
93 + git checkout develop
94 + git pull origin develop
95 + git checkout -b <fix-name>
96 +
97 +2. **Work on your feature or fix:**
98 +
99 + Make your code changes and commit them to your feature or fix branch.
100 +
101 +3. **Create a merge request:**
102 +
103 + Once your feature or fix is ready, create a merge request from your branch to the `develop` branch. Get your changes reviewed by your peers.
104 +
105 +4. **Release preparation:**
106 +
107 + When it's time for a release, create an intermediary branch called `release-<version-number>` from the `develop` branch:
108 +
109 + ::
110 +
111 + git checkout develop
112 + git pull origin develop
113 + git checkout -b release-<version-number>
114 +
115 +5. **Finalize the release:**
116 +
117 + Test the code on the `release-<version-number>` branch thoroughly. Fix any bugs or issues that arise.
118 +
119 +6. **Merge to master:**
120 +
121 + Once the release is tested and stable, create a merge request from the `release-<version-number>` branch to the `master` branch. This signifies a successful release.
122 +
123 +7. **Tag the release:**
124 +
125 + After the merge to `master`, create a new tag to mark the release version:
126 +
127 + ::
128 +
129 + git checkout master
130 + git pull origin master
131 + git tag -a <version-number> -m "Release <version-number>"
132 + git push origin master --tags
133 +
62 134 Usage
63 135 -----
64 136
65 137 Here's how simple it is to create a payment request:
66 138
67 -.. sourcecode :: php
139 +.. code-block:: php
68 140
69 141 <?php
70 142 require_once("PATH_TO_PAYPLUG/payplug_php/lib/init.php"); // If not using a framework
71 143
@@ -75,9 +147,9 @@
75 147 'apiVersion' => 'THE_API_VERSION_YOU_WANT',
76 148 ));
77 149
78 150 // Create a payment request of €9.99. The payment confirmation (IPN) will be sent to "'https://example.net/notifications?id='.$customer_id".
79 - // note that all amounts must be expressed in centimes as positive whole numbers (€9.99 = 999 centimes).
151 + // Note that all amounts must be expressed in centimes as positive whole numbers (€9.99 = 999 centimes).
80 152 // Metadata allow you to include additional information when processing payments or refunds.
81 153 $customer_id = '42710';
82 154
83 155 $payment = Payplug\Payment::create(array(
@@ -114,12 +186,11 @@
114 186 'metadata' => array(
115 187 'customer_id' => $customer_id
116 188 )
117 189 ));
118 - ?>
119 190
120 191 // You will be able to find how the payment object is built in the documentation.
121 - // For instance, if you want to get an URL to the payment page, you get do:
192 + // For instance, if you want to get a URL to the payment page, you can do:
122 193 $paymentUrl = $payment->hosted_payment->payment_url;
123 194
124 195 // Then, you can redirect the user to the payment page
125 196 header("Location: $paymentUrl");
@@ -128,4 +199,17 @@
128 199 -----------
129 200 Tests:
130 201 ++++++
131 202 See tests/README.rst.
203 +
204 +Project Owners
205 +--------------
206 +
207 +This project is maintained by:
208 +
209 +
210 +- [Imène Lajili](https://github.com/ilajili)
211 +- [Manuel Mesquita](https://github.com/PPmmesquita)
212 +
213 +For any questions or concerns about the workflow, feel free to reach out to the project owners.
214 +
215 +