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
|
|
|
'profile_id' => 'https://www.mollie.com/dashboard/developers/api-keys', |
24
|
|
|
'api_key' => 'https://www.mollie.com/dashboard/developers/api-keys', |
25
|
|
|
]; |
26
|
|
|
|
27
|
|
|
/** @var TranslatorInterface */ |
28
|
|
|
private $translator; |
29
|
|
|
|
30
|
|
|
public function __construct(TranslatorInterface $translator) |
31
|
|
|
{ |
32
|
|
|
$this->translator = $translator; |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function getSingleClickDoc(): string |
36
|
|
|
{ |
37
|
|
|
$link = \sprintf('<a target="_blank" href="%s"> %s </a>', self::DOCUMENTATION_LINKS['single_click'], |
38
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.mollie_single_click')); |
39
|
|
|
|
40
|
|
|
return $this->translator->trans('bitbag_sylius_mollie_plugin.ui.read_more_single_click_enabled', [ |
41
|
|
|
'%link%' => $link, |
42
|
|
|
]); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function getMollieComponentsDoc(): string |
46
|
|
|
{ |
47
|
|
|
$link = \sprintf('<a target="_blank" href="%s"> %s </a>', self::DOCUMENTATION_LINKS['mollie_components'], |
48
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.mollie_components')); |
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 \sprintf('%s <a target="_blank" href="%s"> %s </a> %s', |
58
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.click'), |
59
|
|
|
self::DOCUMENTATION_LINKS['payment_methods'], |
60
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.here'), |
61
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.payment_methods_doc') |
62
|
|
|
); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getApiKeyDoc(): string |
66
|
|
|
{ |
67
|
|
|
return \sprintf('%s <a target="_blank" href="%s"> %s </a> %s', |
68
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.find_you_api_key'), |
69
|
|
|
self::DOCUMENTATION_LINKS['api_key'], |
70
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.mollie_profile'), |
71
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.it_starts_with') |
72
|
|
|
); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function getProfileIdDoc(): string |
76
|
|
|
{ |
77
|
|
|
return \sprintf('%s <a target="_blank" href="%s"> %s </a>', |
78
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.you_can_find_you_profile_id'), |
79
|
|
|
self::DOCUMENTATION_LINKS['profile_id'], |
80
|
|
|
$this->translator->trans('bitbag_sylius_mollie_plugin.ui.mollie_profile_id') |
81
|
|
|
); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|