Skip to content

Commit

Permalink
Add payment library to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Dec 17, 2024
1 parent e8e941e commit 150597e
Show file tree
Hide file tree
Showing 27 changed files with 1,822 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/payment-gateway/.distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.distignore
.ddev
.git*
tests/
vendor/**/test*
*.lock
package-lock.json
*.xml.*
97 changes: 97 additions & 0 deletions lib/payment-gateway/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# [1.6.0](https://github.com/inpsyde/payment-gateway/compare/1.5.2...1.6.0) (2024-11-19)


### Features

* Filterable checkout components ([#34](https://github.com/inpsyde/payment-gateway/issues/34)) ([76f8c16](https://github.com/inpsyde/payment-gateway/commit/76f8c1626f3360b9763c6210393a6f7a40a0ccd7)), closes [#35](https://github.com/inpsyde/payment-gateway/issues/35)

## [1.5.2](https://github.com/inpsyde/payment-gateway/compare/1.5.1...1.5.2) (2024-11-13)


### Bug Fixes

* allow node 22 ([1a28fdd](https://github.com/inpsyde/payment-gateway/commit/1a28fdd38be46459d1c63cd99192d9f2bc22e25d))
* allow node 22 ([93a85e6](https://github.com/inpsyde/payment-gateway/commit/93a85e69eb329620dc636180298253ac18742a66))

## [1.5.1](https://github.com/inpsyde/payment-gateway/compare/1.5.0...1.5.1) (2024-09-23)


### Bug Fixes

* Fix PaymentGatewayBlocks::$gateway type. ([#31](https://github.com/inpsyde/payment-gateway/issues/31)) ([58cd64c](https://github.com/inpsyde/payment-gateway/commit/58cd64cb64bc11fcd1a89d9aa0690d90738162a4))

# [1.5.0](https://github.com/inpsyde/payment-gateway/compare/1.4.1...1.5.0) (2024-09-20)


### Bug Fixes

* code style, remove PaymentGatewayBlocks::$name type ([32ed490](https://github.com/inpsyde/payment-gateway/commit/32ed490e73414383c6f6eb34529a483468afb56c))


### Features

* Allow to interrupt refund with a message ([e5c6e10](https://github.com/inpsyde/payment-gateway/commit/e5c6e10d06b228483b8725cfbd41686fb0c5b776))

## [1.4.1](https://github.com/inpsyde/payment-gateway/compare/1.4.0...1.4.1) (2024-09-18)


### Bug Fixes

* use variable in process_refund() ([afabd5c](https://github.com/inpsyde/payment-gateway/commit/afabd5cc6e08a830238af5067500df3fb462644f))

# [1.4.0](https://github.com/inpsyde/payment-gateway/compare/1.3.2...1.4.0) (2024-09-13)


### Features

* [PROD-169] Implement l10n for errors & order notes ([#26](https://github.com/inpsyde/payment-gateway/issues/26)) ([7806c79](https://github.com/inpsyde/payment-gateway/commit/7806c798bc1a6e450f91d703fc94f7c07e8aea96)), closes [#1](https://github.com/inpsyde/payment-gateway/issues/1) [#2](https://github.com/inpsyde/payment-gateway/issues/2)

## [1.3.2](https://github.com/inpsyde/payment-gateway/compare/1.3.1...1.3.2) (2024-07-12)


### Bug Fixes

* Keep frontend source and composer.json in releases ([ee1f8a3](https://github.com/inpsyde/payment-gateway/commit/ee1f8a3642d9240927b8df39b70e8022b000ad4f))

## [1.3.1](https://github.com/inpsyde/payment-gateway/compare/1.3.0...1.3.1) (2024-07-01)


### Bug Fixes

* Do not use PHP_INT_MIN for hooks ([8e5e15d](https://github.com/inpsyde/payment-gateway/commit/8e5e15d4f09364333b5937a2d09b44210fe0c2f4))
* Move comment outside of expression ([c80b6cd](https://github.com/inpsyde/payment-gateway/commit/c80b6cde33661b53fe0ac73824f5eaae3fda9db7))

# [1.3.0](https://github.com/inpsyde/payment-gateway/compare/1.2.0...1.3.0) (2024-06-05)


### Features

* Add locators for method title & description ([#24](https://github.com/inpsyde/payment-gateway/issues/24)) ([27a73a9](https://github.com/inpsyde/payment-gateway/commit/27a73a90965af918da92185526315a97ab8b8c48))

# [1.2.0](https://github.com/inpsyde/payment-gateway/compare/1.1.1...1.2.0) (2024-06-05)


### Features

* Check required services during init ([79ae2b9](https://github.com/inpsyde/payment-gateway/commit/79ae2b9bb178376419c91b418bdfa2b593b99346)), closes [#15](https://github.com/inpsyde/payment-gateway/issues/15)

## [1.1.1](https://github.com/inpsyde/payment-gateway/compare/1.1.0...1.1.1) (2024-06-04)


### Bug Fixes

* don't register gateway for blocks if disabled ([e577b52](https://github.com/inpsyde/payment-gateway/commit/e577b522ef0452104a2e54c499f39e9953876a38))

# [1.1.0](https://github.com/inpsyde/payment-gateway/compare/1.0.1...1.1.0) (2024-06-04)


### Features

* Add a new service to allow skipping blocks registration ([#21](https://github.com/inpsyde/payment-gateway/issues/21)) ([e1978d1](https://github.com/inpsyde/payment-gateway/commit/e1978d19654a2c685265a9d32fa12ff49c7b6249))

# 1.0.0 (2024-05-21)


### Bug Fixes

* specify playwright dependency ([1060e5c](https://github.com/inpsyde/payment-gateway/commit/1060e5cafece37c465e6e78077d2c7378f723b46))
112 changes: 112 additions & 0 deletions lib/payment-gateway/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"name": "inpsyde/payment-gateway",
"type": "inpsyde-module",
"description": "",
"license": "GPL-2.0",
"authors": [
{
"name": "Inpsyde GmbH",
"homepage": "https://inpsyde.com/",
"email": "[email protected]",
"role": "Company"
}
],
"repositories": [
{
"type": "composer",
"url": "https://repo.packagist.com/inpsyde/"
}
],
"require": {
"php": "^7.4 | ^8.0",
"inpsyde/modularity": "^1.5"
},
"require-dev": {
"brain/monkey": "^2.0",
"brainmaestro/composer-git-hooks": "^2.8",
"inpsyde/composer-assets-compiler": "^2.5",
"inpsyde/ddev-tools": "dev-main",
"inpsyde/php-coding-standards": "^2.0",
"inpsyde/wp-translation-downloader": "^2.4",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^8.0 | ^9.0",
"php-stubs/wordpress-stubs": "^5.0@stable",
"php-stubs/woocommerce-stubs": "^5.0@stable",
"vimeo/psalm": "^4.3"
},
"autoload": {
"psr-4": {
"Inpsyde\\PaymentGateway\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Inpsyde\\PaymentGateway\\Test\\": "tests/PHPUnit/Helper"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"phpcs": "@php ./vendor/bin/phpcs -n -s --parallel=24",
"phpcs:phpcbf": "@php ./vendor/bin/phpcbf --parallel=24;exit 0",
"phpcs:interactive": "@php ./vendor/bin/phpcs -a",
"phpcs:dev": [
"@cs:phpcbf",
"@cs:interactive"
],
"phpunit": "vendor/bin/phpunit",
"test": [
"@phpunit"
],
"cghooks": "vendor/bin/cghooks",
"post-install-cmd": [
"@cghooks add --ignore-lock"
],
"post-update-cmd": [
"@cghooks update"
]
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"inpsyde/composer-assets-compiler": true,
"composer/installers": true,
"inpsyde/wp-translation-downloader": true
}
},
"extra": {
"hooks": {
"pre-commit": [
"vendor/bin/phpcbf -q --parallel=24; exit 0"
]
},
"wp-translation-downloader": {
"auto-run": false,
"languageRootDir": "./",
"languages": [
"de_DE",
"en_US"
],
"api": {
"names": {
"inpsyde/*": "https://translate.inpsyde.com/products/api/translations/%projectName%"
}
},
"directories": {
"names": {
"inpsyde/*": "languages/"
}
}
},
"composer-asset-compiler": {
"auto-run": false,
"dependencies": "install",
"script": "build",
"default-env": {
"WEBPACK_ENV": "production"
}
}
}
}
31 changes: 31 additions & 0 deletions lib/payment-gateway/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);
/**
* Plugin Name: ddev-wordpress-plugin-example
* Plugin URI: https://inpsyde.com
* Description: {DESCRIPTION}
* Version: {VERSION}
* SHA: ${GIT_SHA}
* Requires at least: 5.8
* Requires PHP: 7.2
* WC requires at least: 4.3
* WC tested up to: 5.5
* Author: Inpsyde
* Author URI: https://inpsyde.com
* License: GPL-2.0
* Text Domain: ddev-wordpress-plugin-example
* Domain Path: /languages
*/

add_action('rest_api_init', function () {
register_rest_route('inpsyde', 'example', [
'method' => 'GET',
'callback' => function () {
return ['hello' => __('world', 'ddev-wordpress-plugin-example')];
},
'permission_callback' => '__return_true',
]);
});


36 changes: 36 additions & 0 deletions lib/payment-gateway/languages/ddev-wordpress-plugin-example.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (C) 2023 Inpsyde
# This file is distributed under the GPL-2.0.
msgid ""
msgstr ""
"Project-Id-Version: ddev-wordpress-plugin-example {VERSION}\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ddev-wordpress-plugin-example\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-02-01T14:03:42+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Domain: ddev-wordpress-plugin-example\n"

#. Plugin Name of the plugin
msgid "ddev-wordpress-plugin-example"
msgstr ""

#. Plugin URI of the plugin
#. Author URI of the plugin
msgid "https://inpsyde.com"
msgstr ""

#. Description of the plugin
msgid "{DESCRIPTION}"
msgstr ""

#. Author of the plugin
msgid "Inpsyde"
msgstr ""

#: ddev-wordpress-plugin-example.php:25
msgid "world"
msgstr ""
34 changes: 34 additions & 0 deletions lib/payment-gateway/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@inpsyde/generic-payment-gateway",
"version": "0.1.0",
"engines": {
"node": "^16 || ^18 || ^20 || ^22"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^12.0.0",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.3",
"@semantic-release/npm": "^12.0.0",
"@semantic-release/release-notes-generator": "^13.0.0",
"@woocommerce/dependency-extraction-webpack-plugin": "3.0.0",
"@woocommerce/settings": "^1.0.0",
"@wordpress/hooks": "^4.11.0",
"@wordpress/html-entities": "^3.39.0",
"@wordpress/i18n": "^4.39.0",
"@wordpress/scripts": "^26.10.0",
"semantic-release": "^23.0.8",
"ts-loader": "^9.0.0",
"typescript": "^5.1.6"
},
"scripts": {
"build": "wp-scripts build",
"build:dev": "wp-scripts build --mode development",
"dev": "wp-scripts build --mode development --watch",
"start": "wp-scripts start",
"lint:md": "wp-scripts lint-md-docs docs/**/*.md",
"lint:js": "wp-scripts lint-js resources/js/**/*",
"lint:style": "wp-scripts lint-style resources/scss/**/*.scss"
}
}
Loading

0 comments on commit 150597e

Please sign in to comment.