Passed
Pull Request — master (#38)
by
unknown
04:47
created

DocumentationLinks::getPaymentMethodDoc()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace BitBag\SyliusMolliePlugin\Documentation;
14
15
use Symfony\Contracts\Translation\TranslatorInterface;
16
17
final class DocumentationLinks implements DocumentationLinksInterface
18
{
19
    public const DOCUMENTATION_LINKS = [
20
        'single_click' => 'https://help.mollie.com/hc/en-us/articles/115000671249-What-are-single-click-payments-and-how-does-it-work-',
21
        'mollie_components' => 'https://www.mollie.com/en/news/post/better-checkout-flows-with-mollie-components',
22
        'payment_methods' => 'https://docs.mollie.com/orders/why-use-orders',
23
    ];
24
25
    /** @var TranslatorInterface */
26
    private $translator;
27
28
    public function __construct(TranslatorInterface $translator)
29
    {
30
        $this->translator = $translator;
31
    }
32
33
    public function getSingleClickDoc(): string
34
    {
35
        $link = '<a target="_blank" href="' . self::DOCUMENTATION_LINKS['single_click'] . '"> ' .
36
            $this->translator->trans('bitbag_sylius_mollie_plugin.ui.mollie_single_click') .
37
            '</a>';
38
39
        return $this->translator->trans('bitbag_sylius_mollie_plugin.ui.read_more_single_click_enabled', [
40
            '%link%' => $link,
41
        ]);
42
    }
43
44
    public function getMollieComponentsDoc(): string
45
    {
46
        $link = '<a target="_blank" href="' . self::DOCUMENTATION_LINKS['mollie_components'] . '"> ' .
47
            $this->translator->trans('bitbag_sylius_mollie_plugin.ui.mollie_components') .
48
            '</a>';
49
50
        return $this->translator->trans('bitbag_sylius_mollie_plugin.ui.read_more_enable_components', [
51
            '%link%' => $link,
52
        ]);
53
    }
54
55
    public function getPaymentMethodDoc(): string
56
    {
57
        return $this->translator->trans('bitbag_sylius_mollie_plugin.ui.click') .
58
            ' <a target="_blank" href="' . self::DOCUMENTATION_LINKS['payment_methods'] . '">' .
59
            $this->translator->trans('bitbag_sylius_mollie_plugin.ui.here') .
60
            '</a> ' . $this->translator->trans('bitbag_sylius_mollie_plugin.ui.payment_methods_doc');
61
    }
62
}
63