Passed
Push — master ( ff7474...c002dd )
by Gabriel
05:50
created

LibrapayData::getServerCompletePurchaseRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 27
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 33
rs 9.488
1
<?php
2
3
namespace ByTIC\Payments\Tests\Fixtures\Records\Gateways\Providers\Librapay;
4
5
use Symfony\Component\HttpFoundation\Request as HttpRequest;
6
7
/**
8
 * Class LibrapayData
9
 * @package ByTIC\Payments\Tests\Fixtures\Records\Gateways\Providers\Librapay
10
 */
11
class LibrapayData
12
{
13
    /**
14
     * @return string
15
     */
16
    public static function getMethodOptions()
17
    {
18
        $data = 'a:2:{s:15:"payment_gateway";s:8:"librapay";s:8:"librapay";a:7:{s:7:"sandbox";s:2:"no";s:8:"merchant";s:15:"'.getenv('LIBRAPAY_MERCHANT').'";s:12:"merchantName";s:36:"'.getenv('LIBRAPAY_MERCHANTNAME').'";s:13:"merchantEmail";s:17:"'.getenv('LIBRAPAY_MERCHANTEMAIL').'";s:11:"merchantUrl";s:16:"register.42km.ro";s:8:"terminal";s:8:"'.getenv('LIBRAPAY_TERMINAL').'";s:3:"key";s:32:"'.getenv('LIBRAPAY_KEY').'";}}';
19
        return $data;
20
    }
21
22
    /**
23
     * @return HttpRequest
24
     */
25
    public static function getServerCompletePurchaseRequest()
26
    {
27
        $httpRequest = new HttpRequest();
28
29
        $httpRequest->query->add(['hash' => "2fe4c45ebabc6f90b826180e67840f411f81e8e0"]);
30
31
        $post = [
32
            'AMOUNT' => 50.00,
33
            'CURRENCY' => 'RON',
34
            'ORDER' => 172490,
35
            'DESC' => 'Plata RUN IOR - 17 oct 2020 [#1602436479-343556]',
36
            'MERCH_NAME' => '',
37
            'MERCH_URL' => '',
38
            'MERCHANT' => '',
39
            'TERMINAL' => '88002369',
40
            'EMAIL' => '',
41
            'TRTYPE' => 0,
42
            'COUNTRY' => '',
43
            'MERCH_GMT' => '',
44
            'ACTION' => 0,
45
            'TIMESTAMP' => 20201011171601,
46
            'RC' => '00',
47
            'MESSAGE' => 'Approved',
48
            'RRN' => '028584881920',
49
            'INT_REF' => '1111',
50
            'APPROVAL' => '1111',
51
            'NONCE' => 'c3c18b5fce9ea177def8f1433630449b',
52
            'SO' => '',
53
            'P_SIGN' => '4348995B1491E5DA26337C7E331EF40199FF28FF'
54
        ];
55
        $httpRequest->request->add($post);
56
57
        return $httpRequest;
58
    }
59
}
60