Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Mar 23, 2016
2 parents a0a2596 + b3f80b0 commit 143fc45
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 45 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased][unreleased]
-

## [1.0.3] - 2016-03-22
- Added webhook listener.
- Added scheduled events to check transaction status.
- Updated gateway settings.

## [1.0.2] - 2016-03-02
- Added get_settings function.
Expand All @@ -18,6 +22,7 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## 1.0.0 - 2016-02-01
- First release.

[unreleased]: https://github.com/wp-pay-gateways/ing-kassa-compleet/compare/1.0.2...HEAD
[unreleased]: https://github.com/wp-pay-gateways/ing-kassa-compleet/compare/1.0.3...HEAD
[1.0.3]: https://github.com/wp-pay-gateways/ing-kassa-compleet/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/wp-pay-gateways/ing-kassa-compleet/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/wp-pay-gateways/ing-kassa-compleet/compare/1.0.0...1.0.1
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -29,14 +29,14 @@
"require": {
"php": ">=5.2.4",
"xrstf/composer-php52": "1.*",
"wp-pay/core": "^1.3.4",
"wp-pay-gateways/common": "^1.0.1"
"wp-pay/core": "^1.3.5",
"wp-pay-gateways/common": "^1.0.2"
},
"require-dev": {
"phpmd/phpmd": "^2.2.3",
"satooshi/php-coveralls": "^0.7.1",
"squizlabs/php_codesniffer": "^2.2.0",
"wp-coding-standards/wpcs": "0.8.0",
"wp-coding-standards/wpcs": "0.9.0",
"wp-cli/wp-cli": "^0.21.1"
},
"scripts": {
Expand Down
64 changes: 32 additions & 32 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ing-kassa-compleet",
"version": "1.0.2",
"version": "1.0.3",
"description": "ING Kassa Compleet driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions phpcs.ruleset.xml
Expand Up @@ -6,6 +6,8 @@

<exclude name="Squiz.Commenting" />
<exclude name="Squiz.PHP.CommentedOutCode.Found" />

<exclude name="WordPress.VIP.RestrictedFunctions.file_get_contents" />
</rule>

<rule ref="WordPress.VIP.SlowDBQuery.slow_db_query">
Expand Down
11 changes: 10 additions & 1 deletion src/Gateway.php
Expand Up @@ -7,7 +7,7 @@
* Company: Pronamic
*
* @author Reüel van der Steege
* @version 1.0.1
* @version 1.0.3
* @since 1.0.0
*/
class Pronamic_WP_Pay_Gateways_ING_KassaCompleet_Gateway extends Pronamic_WP_Pay_Gateway {
Expand Down Expand Up @@ -162,6 +162,15 @@ public function start( Pronamic_Pay_PaymentDataInterface $data, Pronamic_Pay_Pay
} else {
$this->error = $this->client->get_error();
}

/*
* Schedule transaction status request
*
* @since 1.0.1
*/
$time = time();

wp_schedule_single_event( $time + 30, 'pronamic_ideal_check_transaction_status', array( 'payment_id' => $payment->get_id(), 'seconds' => 30 ) );
}

/////////////////////////////////////////////////
Expand Down
10 changes: 9 additions & 1 deletion src/Integration.php
Expand Up @@ -7,15 +7,23 @@
* Company: Pronamic
*
* @author Reüel van der Steege
* @version 1.0.2
* @version 1.0.3
* @since 1.0.0
*/
class Pronamic_WP_Pay_Gateways_ING_KassaCompleet_Integration extends Pronamic_WP_Pay_Gateways_AbstractIntegration {
public function __construct() {
$this->id = 'ing-kassa-compleet';
$this->name = 'ING Kassa Compleet';
$this->provider = 'ing';
$this->product_url = 'https://www.ing.nl/zakelijk/betalen/geld-ontvangen/kassa-compleet/';
$this->dashboard_url = 'https://portal.kassacompleet.nl/';

// Actions
$function = array( 'Pronamic_WP_Pay_Gateways_ING_KassaCompleet_Listener', 'listen' );

if ( ! has_action( 'wp_loaded', $function ) ) {
add_action( 'wp_loaded', $function );
}
}

public function get_config_factory_class() {
Expand Down
28 changes: 28 additions & 0 deletions src/Listener.php
@@ -0,0 +1,28 @@
<?php

/**
* Title: ING Kassa Compleet listener
* Description:
* Copyright: Copyright (c) 2005 - 2016
* Company: Pronamic
*
* @author Reüel van der Steege
* @version 1.0.3
* @since 1.0.1
*/
class Pronamic_WP_Pay_Gateways_ING_KassaCompleet_Listener implements Pronamic_Pay_Gateways_ListenerInterface {
/**
* Listen to ING Kassa Compleet webhook requests.
*/
public static function listen() {
if ( filter_has_var( INPUT_GET, 'ing_kassa_compleet_webhook' ) ) {
$data = json_decode( file_get_contents( 'php://input' ) );

if ( is_object( $data ) && isset( $data->order_id ) ) {
$payment = get_pronamic_payment_by_transaction_id( $data->order_id );

Pronamic_WP_Pay_Plugin::update_payment( $payment, false );
}
}
}
}

0 comments on commit 143fc45

Please sign in to comment.