Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/333154 )
Change subject: WIP base class for Ingenico payments using SDK ...................................................................... WIP base class for Ingenico payments using SDK Change-Id: I4996945c83e31a60f695912fd5458895ba00ad4c --- A PaymentProviders/Ingenico/IngenicoPaymentProvider.php M SmashPig.yaml M composer.json M composer.lock 4 files changed, 96 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/54/333154/1 diff --git a/PaymentProviders/Ingenico/IngenicoPaymentProvider.php b/PaymentProviders/Ingenico/IngenicoPaymentProvider.php new file mode 100644 index 0000000..c089c2b --- /dev/null +++ b/PaymentProviders/Ingenico/IngenicoPaymentProvider.php @@ -0,0 +1,33 @@ +<?php + +namespace SmashPig\PaymentProviders\Ingenico; + +use Ingenico\Connect\Sdk\Client; +use Ingenico\Connect\Sdk\Communicator; +use SmashPig\Core\Context; +use SmashPig\Core\Configuration; + +/** + * Base class for Ingenico payments. Each payment product group should get + * a concrete subclass implementing PaymentProvider + */ +abstract class IngenicoPaymentProvider { + + /** + * @var Client + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + public function __construct() { + $this->config = Context::get()->getConfiguration(); + $connection = $this->config->object( 'connection' ); + $communicatorConfiguration = $this->config->object( 'communicator-config' ); + $communicator = new Communicator( $connection, $communicatorConfiguration ); + $this->client = new Client( $communicator ); + } +} diff --git a/SmashPig.yaml b/SmashPig.yaml index e09d775..2569269 100644 --- a/SmashPig.yaml +++ b/SmashPig.yaml @@ -411,3 +411,16 @@ endpoints: listener: class: SmashPig\PaymentProviders\GlobalCollect\GlobalCollectListener + +ingenico: + # https://developer.globalcollect.com/documentation/sdk/server/php/#initialization + communicator-configuration: + class: Ingenico\Connect\Sdk\CommunicatorConfiguration + constructor-parameters: + - 'apiKey' + - 'apiSecret' + - 'baseUri' + - 'integrator' + connection: + class: Ingenico\Connect\Sdk\DefaultConnection + constructor-parameters: [] diff --git a/composer.json b/composer.json index ead77ea..cfaaa6b 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "symfony/event-dispatcher": "^2.1", "symfony/http-foundation": "^2.1", "symfony/yaml": "^2.8", - "amzn/login-and-pay-with-amazon-sdk-php": "dev-master" + "amzn/login-and-pay-with-amazon-sdk-php": "dev-master", + "Ingenico-ePayments/connect-sdk-php": "^5.1" }, "require-dev": { "jakub-onderka/php-parallel-lint": "^0.9", diff --git a/composer.lock b/composer.lock index c438192..93bb3cb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b9fb8f640ad664864e5c9ea93dbc8b1a", - "content-hash": "6f0c1657143a0d54fdac09cb749ba44b", + "hash": "c3f38e54779883f73a3c2a6b850ce50a", + "content-hash": "f450e8dd0ec298cc0aeb00b7add291fd", "packages": [ { "name": "amzn/login-and-pay-with-amazon-sdk-php", @@ -152,6 +152,52 @@ "time": "2017-01-04 21:01:15" }, { + "name": "ingenico-epayments/connect-sdk-php", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/Ingenico-ePayments/connect-sdk-php.git", + "reference": "f72d2738c939925b037a197abbed24ee5cafb5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ingenico-ePayments/connect-sdk-php/zipball/f72d2738c939925b037a197abbed24ee5cafb5c5", + "reference": "f72d2738c939925b037a197abbed24ee5cafb5c5", + "shasum": "" + }, + "require": { + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "~4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ingenico\\Connect\\Sdk\\": [ + "src/Ingenico/Connect/Sdk", + "lib/Ingenico/Connect/Sdk" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ingenico ePayments", + "homepage": "http://www.ingenico.com/epayments/" + } + ], + "description": "PHP SDK to communicate with the GlobalCollect platform server-to-server API", + "homepage": "http://www.ingenico.com/epayments/", + "keywords": [ + "sdk" + ], + "time": "2016-12-20 12:21:28" + }, + { "name": "ircmaxell/password-compat", "version": "v1.0.4", "source": { -- To view, visit https://gerrit.wikimedia.org/r/333154 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4996945c83e31a60f695912fd5458895ba00ad4c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits