├── .gitignore
├── README.md
├── build.sh
├── composer.json
├── composer.lock
├── css
├── complete.css
└── payment.css
├── img
└── loader.gif
├── release.sh
├── templates
├── completed.php
└── payment.php
└── woocommerce-gateway-lightning.php
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor
2 | .vimrc
3 | woocommerce-gateway-lightning.zip
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WooCommerce Gateway Plugin for Lightning
2 |
3 | Gateway plugin to accept Lightning payments at [WooCommerce](https://woocommerce.com) stores,
4 | based on [Lightning Charge](https://github.com/ElementsProject/lightning-charge).
5 |
6 | ## Installation
7 |
8 | Requires PHP >= 5.6 and the `php-curl` and `php-gd` extensions.
9 |
10 | 1. Setup [Lightning Charge](https://github.com/ElementsProject/lightning-charge).
11 |
12 | 2. [Download woocommerce-gateway-lightning.zip](https://github.com/ElementsProject/woocommerce-gateway-lightning/releases/download/v0.2.7/woocommerce-gateway-lightning.zip)
13 |
14 | 3. Install and enable the plugin on your WordPress installation.
15 |
16 | 4. Under the WordPress administration panel, go to `WooCommerce -> Settings -> Checkout -> Lightning` to configure your Lightning Charge server URL and API token.
17 |
18 | That's it! The "Bitcoin Lightning" payment option should now be available in your checkout page.
19 |
20 | ## Screenshots
21 |
22 |
23 |
24 |
25 |
26 |
27 | ## License
28 |
29 | MIT
30 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | composer install --no-dev
3 | zip -r woocommerce-gateway-lightning.zip composer.json woocommerce-gateway-lightning.php vendor templates css img README.md --exclude='vendor/bacon/bacon-qr-code/tests/*'
4 |
5 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "elementsproject/woocommerce-gateway-lightning",
3 | "description": "WooCommerce Gateway Plugin for Lightning Charge",
4 | "version": "0.2.7",
5 | "license": "MIT",
6 | "minimum-stability": "dev",
7 | "require": {
8 | "bacon/bacon-qr-code": "^1.0",
9 | "elementsproject/lightning-charge-client-php": "^0.1.3"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 | "This file is @generated automatically"
6 | ],
7 | "hash": "b6a2854067c61917fde3f4ad286638f4",
8 | "content-hash": "f6ec27bba43744175813baa5f5b325da",
9 | "packages": [
10 | {
11 | "name": "bacon/bacon-qr-code",
12 | "version": "1.0.3",
13 | "source": {
14 | "type": "git",
15 | "url": "https://github.com/Bacon/BaconQrCode.git",
16 | "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee"
17 | },
18 | "dist": {
19 | "type": "zip",
20 | "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee",
21 | "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee",
22 | "shasum": ""
23 | },
24 | "require": {
25 | "ext-iconv": "*",
26 | "php": "^5.4|^7.0"
27 | },
28 | "require-dev": {
29 | "phpunit/phpunit": "^4.8"
30 | },
31 | "suggest": {
32 | "ext-gd": "to generate QR code images"
33 | },
34 | "type": "library",
35 | "autoload": {
36 | "psr-0": {
37 | "BaconQrCode": "src/"
38 | }
39 | },
40 | "notification-url": "https://packagist.org/downloads/",
41 | "license": [
42 | "BSD-2-Clause"
43 | ],
44 | "authors": [
45 | {
46 | "name": "Ben Scholzen 'DASPRiD'",
47 | "email": "mail@dasprids.de",
48 | "homepage": "http://www.dasprids.de",
49 | "role": "Developer"
50 | }
51 | ],
52 | "description": "BaconQrCode is a QR code generator for PHP.",
53 | "homepage": "https://github.com/Bacon/BaconQrCode",
54 | "time": "2017-10-17 09:59:25"
55 | },
56 | {
57 | "name": "elementsproject/lightning-charge-client-php",
58 | "version": "0.1.3",
59 | "source": {
60 | "type": "git",
61 | "url": "https://github.com/ElementsProject/lightning-charge-client-php.git",
62 | "reference": "1ee22161e90318296770135519cbdd624dcb796a"
63 | },
64 | "dist": {
65 | "type": "zip",
66 | "url": "https://api.github.com/repos/ElementsProject/lightning-charge-client-php/zipball/1ee22161e90318296770135519cbdd624dcb796a",
67 | "reference": "1ee22161e90318296770135519cbdd624dcb796a",
68 | "shasum": ""
69 | },
70 | "require": {
71 | "tcdent/php-restclient": "^0.1"
72 | },
73 | "require-dev": {
74 | "clue/phar-composer": "^1.0",
75 | "phpunit/phpunit": "^6.4"
76 | },
77 | "type": "library",
78 | "autoload": {
79 | "files": [
80 | "client.php"
81 | ]
82 | },
83 | "notification-url": "https://packagist.org/downloads/",
84 | "license": [
85 | "MIT"
86 | ],
87 | "description": "PHP client for the Lightning Charge REST API",
88 | "time": "2017-12-29 19:18:18"
89 | },
90 | {
91 | "name": "tcdent/php-restclient",
92 | "version": "0.1.7",
93 | "source": {
94 | "type": "git",
95 | "url": "https://github.com/tcdent/php-restclient.git",
96 | "reference": "4522e8518eaef770d715977fcb45f187f8ad7499"
97 | },
98 | "dist": {
99 | "type": "zip",
100 | "url": "https://api.github.com/repos/tcdent/php-restclient/zipball/4522e8518eaef770d715977fcb45f187f8ad7499",
101 | "reference": "4522e8518eaef770d715977fcb45f187f8ad7499",
102 | "shasum": ""
103 | },
104 | "require": {
105 | "ext-curl": "*",
106 | "ext-json": "*",
107 | "php": ">=5.4.0"
108 | },
109 | "require-dev": {
110 | "php": ">=5.5.7",
111 | "phpunit/phpunit": ">=4.5"
112 | },
113 | "type": "library",
114 | "autoload": {
115 | "files": [
116 | "restclient.php"
117 | ]
118 | },
119 | "notification-url": "https://packagist.org/downloads/",
120 | "license": [
121 | "MIT"
122 | ],
123 | "authors": [
124 | {
125 | "name": "Travis Dent",
126 | "email": "tcdent@gmail.com",
127 | "role": "Developer"
128 | }
129 | ],
130 | "description": "A generic REST API client for PHP",
131 | "homepage": "http://github.com/tcdent/php-restclient",
132 | "keywords": [
133 | "api",
134 | "client",
135 | "curl",
136 | "json",
137 | "rest",
138 | "xml"
139 | ],
140 | "time": "2017-09-07 20:44:36"
141 | }
142 | ],
143 | "packages-dev": [],
144 | "aliases": [],
145 | "minimum-stability": "dev",
146 | "stability-flags": [],
147 | "prefer-stable": false,
148 | "prefer-lowest": false,
149 | "platform": [],
150 | "platform-dev": []
151 | }
152 |
--------------------------------------------------------------------------------
/css/complete.css:
--------------------------------------------------------------------------------
1 | .woocommerce-order .order_details .payreq {
2 | word-wrap: break-word;
3 | }
4 |
--------------------------------------------------------------------------------
/css/payment.css:
--------------------------------------------------------------------------------
1 | /* Hide WooCommerce default title payment details */
2 | header.entry-header, .order_details {
3 | display: none;
4 | }
5 |
6 | .woocommerce-breadcrumb {
7 | margin-bottom: 0;
8 | }
9 |
10 | .ln-pay { margin-bottom: 2em; }
11 |
12 | .ln-pay h2 { margin-bottom: 0; }
13 |
14 | .ln-pay h4 {
15 | color: #999;
16 | clear: none;
17 | }
18 |
19 | .ln-pay .qr {
20 | display: block;
21 | float: right;
22 | width: 200px;
23 | margin-top: -10px;
24 | }
25 |
26 | .ln-pay .payreq {
27 | word-wrap: break-word;
28 | margin-right: 220px;
29 | }
30 |
31 | .ln-pay code {
32 | display: block;
33 | margin: 1em 0;
34 | padding: 0.75em;
35 | }
36 |
37 | .ln-pay p {
38 | margin: 1em 0;
39 | }
40 |
41 | .ln-pay .loader {
42 | display: inline;
43 | }
44 |
45 | @media (max-width: 550px) {
46 | .ln-pay { text-align: center; }
47 | .ln-pay .qr { float: none; margin: 0 auto; }
48 | .ln-pay .payreq { margin-right: 0; }
49 | }
50 |
--------------------------------------------------------------------------------
/img/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ElementsProject/woocommerce-gateway-lightning/068d5e7cd9415715bc2878f7c2cd0e41f681ff02/img/loader.gif
--------------------------------------------------------------------------------
/release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -eo pipefail
4 | set -x
5 |
6 | [ -z "$1" ] && { echo >&2 version required; exit 1; }
7 |
8 | sed -i 's!"version": ".*"!"version": "'"$1"'"!' composer.json
9 | sed -ri "s!Version:( *).*!Version:\\1$1!" woocommerce-gateway-lightning.php
10 | sed -ri s!download/v[^/]+/woocommerce-gateway-lightning.zip!download/v$1/woocommerce-gateway-lightning.zip! README.md
11 |
12 | composer update
13 |
14 | ./build.sh
15 |
16 | read -p "Release v$1 ready, press Enter to publish"
17 |
18 | git add README.md composer.json composer.lock woocommerce-gateway-lightning.php
19 | git commit -m v$1 && git tag v$1
20 | git push && git push --tags
21 |
22 | echo Attach zip file: https://github.com/ElementsProject/woocommerce-gateway-lightning/releases/edit/v$1
23 |
--------------------------------------------------------------------------------
/templates/completed.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
payreq ?>
14 |
15 |
16 | Awaiting payment.
17 | The invoice expires .
18 |