|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Gateway |
|
4
|
|
|
* |
|
5
|
|
|
* @author Pronamic <[email protected]> |
|
6
|
|
|
* @copyright 2005-2018 Pronamic |
|
7
|
|
|
* @license GPL-3.0-or-later |
|
8
|
|
|
* @package Pronamic\WordPress\Pay\Gateways\Adyen |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Pronamic\WordPress\Pay\Gateways\Adyen; |
|
12
|
|
|
|
|
13
|
|
|
use Pronamic\WordPress\Pay\Core\Gateway as Core_Gateway; |
|
14
|
|
|
use Pronamic\WordPress\Pay\Core\PaymentMethods; |
|
15
|
|
|
use Pronamic\WordPress\Pay\Payments\Payment; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Gateway |
|
19
|
|
|
* |
|
20
|
|
|
* @author Remco Tolsma |
|
21
|
|
|
* @version 2.0.0 |
|
22
|
|
|
* @since 1.0.0 |
|
23
|
|
|
* @link https://github.com/adyenpayments/php/blob/master/generatepaymentform.php |
|
24
|
|
|
*/ |
|
25
|
|
|
class Gateway extends Core_Gateway { |
|
26
|
|
|
/** |
|
27
|
|
|
* Slug of this gateway |
|
28
|
|
|
* |
|
29
|
|
|
* @var string |
|
30
|
|
|
*/ |
|
31
|
|
|
const SLUG = 'adyen'; |
|
32
|
|
|
|
|
33
|
|
|
///////////////////////////////////////////////// |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* Constructs and initializes an InternetKassa gateway |
|
37
|
|
|
* |
|
38
|
|
|
* @param Pronamic_WP_Pay_GatewayConfig $config |
|
39
|
|
|
*/ |
|
40
|
|
|
public function __construct( Pronamic_WP_Pay_GatewayConfig $config ) { |
|
|
|
|
|
|
41
|
|
|
parent::__construct( $config ); |
|
42
|
|
|
|
|
43
|
|
|
$this->set_method( self::METHOD_HTML_FORM ); |
|
44
|
|
|
$this->set_has_feedback( true ); |
|
|
|
|
|
|
45
|
|
|
$this->set_amount_minimum( 0.01 ); |
|
|
|
|
|
|
46
|
|
|
$this->set_slug( self::SLUG ); |
|
47
|
|
|
|
|
48
|
|
|
$this->client = new Adyen(); |
|
|
|
|
|
|
49
|
|
|
$this->client->set_payment_server_url( $config->getPaymentServerUrl() ); |
|
50
|
|
|
$this->client->set_skin_code( $config->get_buckaroo_skin_code() ); |
|
51
|
|
|
$this->client->set_merchant_account( $config->get_buckaroo_merchant_account() ); |
|
52
|
|
|
$this->client->set_shared_secret( $config->get_buckaroo_shared_secret() ); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
///////////////////////////////////////////////// |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Start |
|
59
|
|
|
* |
|
60
|
|
|
* @param Pronamic_Pay_Payment $payment |
|
61
|
|
|
* @see Pronamic_WP_Pay_Gateway::start() |
|
62
|
|
|
*/ |
|
63
|
|
|
public function start( Pronamic_Pay_Payment $payment ) { |
|
|
|
|
|
|
64
|
|
|
$payment->set_transaction_id( md5( time() . $payment->get_order_id() ) ); |
|
65
|
|
|
$payment->set_action_url( $this->client->get_payment_server_url() ); |
|
66
|
|
|
|
|
67
|
|
|
$this->client->set_merchant_reference( $payment->get_order_id() ); |
|
68
|
|
|
$this->client->set_payment_amount( $payment->get_amount() ); |
|
69
|
|
|
$this->client->set_currency_code( $payment->get_currency() ); |
|
70
|
|
|
$this->client->set_ship_before_date( new DateTime( '+5 days' ) ); |
|
|
|
|
|
|
71
|
|
|
$this->client->set_shopper_locale( $payment->get_locale() ); |
|
72
|
|
|
$this->client->set_order_data( $payment->get_description() ); |
|
73
|
|
|
$this->client->set_session_validity( new DateTime( '+1 hour' ) ); |
|
74
|
|
|
$this->client->set_shopper_reference( $payment->get_email() ); |
|
75
|
|
|
$this->client->set_shopper_email( $payment->get_email() ); |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
///////////////////////////////////////////////// |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Get output HTML |
|
82
|
|
|
* |
|
83
|
|
|
* @see Pronamic_WP_Pay_Gateway::get_output_html() |
|
84
|
|
|
*/ |
|
85
|
|
|
public function get_output_html() { |
|
86
|
|
|
return $this->client->get_html_fields(); |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths