Transaction::get_data()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 21
ccs 0
cts 21
cp 0
crap 2
rs 9.7333
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Nocks;
4
5
use Pronamic\WordPress\Pay\Core\Util as Core_Util;
6
7
/**
8
 * Title: Nocks transaction
9
 * Description:
10
 * Copyright: 2005-2020 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Reüel van der Steege
14
 * @version 2.0.0
15
 * @since   1.0.0
16
 */
17
class Transaction {
18
	public $merchant_profile;
19
20
	public $currency;
21
22
	public $amount;
23
24
	public $payment_method;
25
26
	public $issuer;
27
28
	public $metadata;
29
30
	public $order_id;
31
32
	public $description;
33
34
	public $payment_id;
35
36
	public $redirect_url;
37
38
	public $callback_url;
39
40
	public $locale;
41
42
	public function get_data() {
43
		return array(
44
			'merchant_profile' => $this->merchant_profile,
45
			'source_currency'  => $this->currency,
46
			'amount'           => array(
47
				'currency' => $this->currency,
48
				'amount'   => (string) $this->amount,
49
			),
50
			'payment_method'   => array(
51
				'method'   => $this->payment_method,
52
				'metadata' => array(
53
					'issuer' => $this->issuer,
54
				),
55
			),
56
			'metadata'         => array(
57
				'pronamic_payment_id' => $this->payment_id,
58
			),
59
			'description'      => $this->description,
60
			'redirect_url'     => $this->redirect_url,
61
			'callback_url'     => $this->callback_url,
62
			'locale'           => $this->locale,
63
		);
64
	}
65
}
66