@@ -71,17 +71,28 @@ public function getConfig()
71
71
if ($ this ->scopeConfig ->getValue ('payment/moyasar_payments_stc_pay/active ' )) {
72
72
$ enabled_method [] = 'stcpay ' ;
73
73
}
74
+ // Samsung Pay
75
+ if ($ this ->scopeConfig ->getValue ('payment/moyasar_payments_samsung_pay/active ' )) {
76
+ $ enabled_method [] = 'samsungpay ' ;
77
+ }
74
78
75
79
$ supported_networks = $ this ->scopeConfig ->getValue ('payment/moyasar_payments/schemes ' );
80
+ $ samsung_supported_networks = $ this ->scopeConfig ->getValue ('payment/moyasar_payments_samsung_pay/schemes ' );
76
81
77
82
78
83
$ config = [
79
84
'api_key ' => $ this ->moyasarHelper ->publishableApiKey (),
80
85
'base_url ' => $ this ->moyasarHelper ->apiBaseUrl (),
81
86
'country ' => $ this ->scopeConfig ->getValue ('general/country/default ' ),
82
87
'store_name ' => $ this ->getStoreName (),
88
+ 'apple_store_name ' => $ this ->getAppleStoreName (),
89
+ 'samsung ' => [
90
+ 'store_name ' => $ this ->getSamsungStoreName (),
91
+ 'service_id ' => $ this ->scopeConfig ->getValue ('payment/moyasar_payments_samsung_pay/service_id ' ),
92
+ 'supported_networks ' => $ samsung_supported_networks ? explode (', ' , $ samsung_supported_networks ) : []
93
+ ],
83
94
'domain_name ' => $ matches [1 ],
84
- 'supported_networks ' => explode (', ' , $ supported_networks ? $ supported_networks : []) ,
95
+ 'supported_networks ' => $ supported_networks ? explode (', ' , $ supported_networks ) : [],
85
96
'methods ' => $ enabled_method ,
86
97
'version ' => 'Moyasar Http; Magento Plugin v ' . MoyasarHelper::VERSION
87
98
];
@@ -96,13 +107,33 @@ public function getConfig()
96
107
*
97
108
* @return string
98
109
*/
99
- public function getStoreName ()
110
+ public function getStoreName ($ name = null )
100
111
{
101
- $ store_name = $ this ->scopeConfig ->getValue (self ::XML_PATH_STORE_NAME ) ?? $ this ->storeManager ->getStore ()->getName () ?? 'Store ' ;
112
+ $ store_name = $ name ?? $ this ->scopeConfig ->getValue (self ::XML_PATH_STORE_NAME ) ?? $ this ->storeManager ->getStore ()->getName () ?? 'Store ' ;
102
113
// Check is store english (Regex)
103
114
if (!preg_match ('/\A[\x00-\x7F]+\z/ ' , $ store_name )) {
104
115
$ store_name = 'Store ' ;
105
116
}
106
117
return $ store_name ;
107
118
}
119
+
120
+ /**
121
+ * Get Apple store name
122
+ *
123
+ * @return string
124
+ */
125
+ public function getAppleStoreName ()
126
+ {
127
+ return $ this ->getStoreName ($ this ->scopeConfig ->getValue ('payment/moyasar_payments_apple_pay/apple_store_name ' ));
128
+ }
129
+
130
+ /**
131
+ * Get Samsung store name
132
+ *
133
+ * @return string
134
+ */
135
+ public function getSamsungStoreName ()
136
+ {
137
+ return $ this ->getStoreName ($ this ->scopeConfig ->getValue ('payment/moyasar_payments_samsung_pay/samsung_store_name ' ));
138
+ }
108
139
}
0 commit comments