SplitPaymentDataRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 11 3
1
<?php
2
/**
3
 * Copyright © Getnet. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See LICENSE for license details.
7
 */
8
9
namespace Getnet\PaymentMagento\Gateway\Request;
10
11
use InvalidArgumentException;
12
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
13
use Magento\Payment\Gateway\Request\BuilderInterface;
14
15
/**
16
 * Class Split Payment Data Request - Payment amount structure.
17
 */
18
class SplitPaymentDataRequest implements BuilderInterface
19
{
20
    public const BLOCK_NAME_MARKETPLACE_SUBSELLER_PAYMENTS = 'marketplace_subseller_payments';
21
    public const BLOCK_NAME_SUB_SELLER_ID = 'subseller_id';
22
    public const BLOCK_NAME_SUBSELLER_SALES_AMOUNT = 'subseller_sales_amount';
23
    public const BLOCK_NAME_ORDER_ITEMS = 'order_items';
24
    public const BLOCK_NAME_AMOUNT = 'amount';
25
    public const BLOCK_NAME_CURRENCY = 'currency';
26
    public const BLOCK_NAME_ID = 'id';
27
    public const BLOCK_NAME_DESCRIPTION = 'description';
28
    public const BLOCK_NAME_TAX_AMOUNT = 'tax_amount';
29
30
    /**
31
     * Build.
32
     *
33
     * @param array $buildSubject
34
     */
35
    public function build(array $buildSubject)
36
    {
37
        if (!isset($buildSubject['payment'])
38
        || !$buildSubject['payment'] instanceof PaymentDataObjectInterface
39
        ) {
40
            throw new InvalidArgumentException('Payment data object should be provided');
41
        }
42
43
        $result = [];
44
45
        return $result;
46
    }
47
}
48