[MediaWiki-commits] [Gerrit] mediawiki...vendor[master]: Update SmashPig lib

2017-03-23 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/344454 )

Change subject: Update SmashPig lib
..


Update SmashPig lib

Change-Id: I5c8ffb254fa143c52f760fcbafa64840bac45757
---
M composer/installed.json
M wikimedia/smash-pig/Core/Http/OutboundRequest.php
M wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
A wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/Data/availability.response
M 
wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
M wikimedia/smash-pig/PaymentProviders/PayPal/Job.php
M wikimedia/smash-pig/PaymentProviders/PayPal/PaymentMessage.php
M wikimedia/smash-pig/PaymentProviders/PayPal/RecurringMessage.php
M wikimedia/smash-pig/PaymentProviders/PayPal/RefundMessage.php
A wikimedia/smash-pig/PaymentProviders/PayPal/Tests/Data/recurring_payment.json
A 
wikimedia/smash-pig/PaymentProviders/PayPal/Tests/Data/recurring_payment_transformed.json
M 
wikimedia/smash-pig/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
M wikimedia/smash-pig/SmashPig.yaml
13 files changed, 215 insertions(+), 14 deletions(-)

Approvals:
  Ejegg: Verified; Looks good to me, approved



diff --git a/composer/installed.json b/composer/installed.json
index 8e57f31..359c136 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -1014,7 +1014,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;,
-"reference": "d1a135b94870ff263154c5dab084416eb318e05f"
+"reference": "5abbd06ab629e218d7c1842443c0a0627c31d0c3"
 },
 "require": {
 "amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
@@ -1031,7 +1031,7 @@
 "jakub-onderka/php-parallel-lint": "^0.9",
 "phpunit/phpunit": "^4.8"
 },
-"time": "2017-03-20 17:58:32",
+"time": "2017-03-23 17:11:20",
 "type": "library",
 "installation-source": "source",
 "autoload": {
diff --git a/wikimedia/smash-pig/Core/Http/OutboundRequest.php 
b/wikimedia/smash-pig/Core/Http/OutboundRequest.php
index 92e6cae..8eeb187 100644
--- a/wikimedia/smash-pig/Core/Http/OutboundRequest.php
+++ b/wikimedia/smash-pig/Core/Http/OutboundRequest.php
@@ -12,15 +12,18 @@
/**
 * @var array
 */
-   protected $headers;
+   protected $headers = array();
+
/**
 * @var Configuration
 */
protected $config;
+
/**
 * @var string HTTP method
 */
protected $method;
+
/**
 * @var string Request body
 */
diff --git 
a/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php 
b/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
index 87c034d..4844bbc 100644
--- a/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
+++ b/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
@@ -4,6 +4,7 @@
 
 use SmashPig\Core\Context;
 use Psr\Cache\CacheItemPoolInterface;
+use SmashPig\Core\Http\OutboundRequest;
 
 /**
  * Handle bank payments via Ingenico
@@ -23,9 +24,15 @@
 */
protected $cache;
 
+   /**
+* @var array()
+*/
+   protected $availabilityParameters;
+
public function __construct( array $options = array() ) {
parent::__construct( $options );
$this->cacheParameters = $options['cache-parameters'];
+   $this->availabilityParameters = 
$options['availability-parameters'];
// FIXME: provide objects in constructor
$config = Context::get()->getConfiguration();
$this->cache = $config->object( 'cache' );
@@ -45,7 +52,7 @@
$cacheItem = $this->cache->getItem( $cacheKey );
 
if ( !$cacheItem->isHit() || $this->shouldBeExpired( $cacheItem 
) ) {
-   $query = array(
+   /*$query = array(
'countryCode' => $country,
'currencyCode' => $currency
);
@@ -56,7 +63,28 @@
 
foreach ( $response['entries'] as $entry ) {
$banks[$entry['issuerId']] = 
$entry['issuerName'];
+   }*/
+
+   $banks = array();
+
+   // HAAACK!
+   // Use undocumented API to get availability straight 
from iDEAL,
+   // until Ingenico can incorporate this into their 
directory
+   if ( $country === 'NL' && $currency === 'EUR' ) {
+   $url = $this->availabilityParameters['url'];
+   $threshold = 
$this->availabilityParameters['threshold'];
+
+   

[MediaWiki-commits] [Gerrit] mediawiki...vendor[master]: Update SmashPig lib

2017-03-23 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344454 )

Change subject: Update SmashPig lib
..

Update SmashPig lib

Change-Id: I5c8ffb254fa143c52f760fcbafa64840bac45757
---
M composer/installed.json
M wikimedia/smash-pig/Core/Http/OutboundRequest.php
M wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
A wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/Data/availability.response
M 
wikimedia/smash-pig/PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php
M wikimedia/smash-pig/PaymentProviders/PayPal/Job.php
M wikimedia/smash-pig/PaymentProviders/PayPal/PaymentMessage.php
M wikimedia/smash-pig/PaymentProviders/PayPal/RecurringMessage.php
M wikimedia/smash-pig/PaymentProviders/PayPal/RefundMessage.php
A wikimedia/smash-pig/PaymentProviders/PayPal/Tests/Data/recurring_payment.json
A 
wikimedia/smash-pig/PaymentProviders/PayPal/Tests/Data/recurring_payment_transformed.json
M 
wikimedia/smash-pig/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
M wikimedia/smash-pig/SmashPig.yaml
13 files changed, 215 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface/vendor 
refs/changes/54/344454/1

diff --git a/composer/installed.json b/composer/installed.json
index 8e57f31..359c136 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -1014,7 +1014,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;,
-"reference": "d1a135b94870ff263154c5dab084416eb318e05f"
+"reference": "5abbd06ab629e218d7c1842443c0a0627c31d0c3"
 },
 "require": {
 "amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
@@ -1031,7 +1031,7 @@
 "jakub-onderka/php-parallel-lint": "^0.9",
 "phpunit/phpunit": "^4.8"
 },
-"time": "2017-03-20 17:58:32",
+"time": "2017-03-23 17:11:20",
 "type": "library",
 "installation-source": "source",
 "autoload": {
diff --git a/wikimedia/smash-pig/Core/Http/OutboundRequest.php 
b/wikimedia/smash-pig/Core/Http/OutboundRequest.php
index 92e6cae..8eeb187 100644
--- a/wikimedia/smash-pig/Core/Http/OutboundRequest.php
+++ b/wikimedia/smash-pig/Core/Http/OutboundRequest.php
@@ -12,15 +12,18 @@
/**
 * @var array
 */
-   protected $headers;
+   protected $headers = array();
+
/**
 * @var Configuration
 */
protected $config;
+
/**
 * @var string HTTP method
 */
protected $method;
+
/**
 * @var string Request body
 */
diff --git 
a/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php 
b/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
index 87c034d..4844bbc 100644
--- a/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
+++ b/wikimedia/smash-pig/PaymentProviders/Ingenico/BankPaymentProvider.php
@@ -4,6 +4,7 @@
 
 use SmashPig\Core\Context;
 use Psr\Cache\CacheItemPoolInterface;
+use SmashPig\Core\Http\OutboundRequest;
 
 /**
  * Handle bank payments via Ingenico
@@ -23,9 +24,15 @@
 */
protected $cache;
 
+   /**
+* @var array()
+*/
+   protected $availabilityParameters;
+
public function __construct( array $options = array() ) {
parent::__construct( $options );
$this->cacheParameters = $options['cache-parameters'];
+   $this->availabilityParameters = 
$options['availability-parameters'];
// FIXME: provide objects in constructor
$config = Context::get()->getConfiguration();
$this->cache = $config->object( 'cache' );
@@ -45,7 +52,7 @@
$cacheItem = $this->cache->getItem( $cacheKey );
 
if ( !$cacheItem->isHit() || $this->shouldBeExpired( $cacheItem 
) ) {
-   $query = array(
+   /*$query = array(
'countryCode' => $country,
'currencyCode' => $currency
);
@@ -56,7 +63,28 @@
 
foreach ( $response['entries'] as $entry ) {
$banks[$entry['issuerId']] = 
$entry['issuerName'];
+   }*/
+
+   $banks = array();
+
+   // HAAACK!
+   // Use undocumented API to get availability straight 
from iDEAL,
+   // until Ingenico can incorporate this into their 
directory
+   if ( $country === 'NL' && $currency === 'EUR' ) {
+   $url = $this->availabilityParameters['url'];
+   $threshold =