init
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
|
||||
<system>
|
||||
<section id="payment">
|
||||
<group id="esun_oceanpayment_klarna" translate="label" type="text" sortOrder="820"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>钱海支付 - Klarna</label>
|
||||
<field id="active" translate="label" type="select" sortOrder="10"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>启用</label>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
</field>
|
||||
<field id="title" translate="label comment" type="text" sortOrder="20"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>结账页标题</label>
|
||||
<comment>默认 Pay with Klarna;可按 Store View 配置 Klarna 官方认可的当地语言名称。</comment>
|
||||
</field>
|
||||
<field id="sandbox" translate="label comment" type="select" sortOrder="30"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>沙盒模式</label>
|
||||
<comment>启用时使用测试凭据及 test-secure.oceanpayment.com。</comment>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
</field>
|
||||
<field id="sandbox_account" translate="label comment" type="text" sortOrder="40"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>测试 Account</label>
|
||||
<comment>完整显示,便于核对当前配置的测试商户号。</comment>
|
||||
<frontend_model>Esun\OceanpaymentKlarna\Block\Adminhtml\System\Config\Form\Field\DecryptedText</frontend_model>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">1</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="sandbox_terminal" translate="label comment" type="text" sortOrder="50"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>测试 Terminal</label>
|
||||
<comment>完整显示,便于核对当前配置的测试终端号。</comment>
|
||||
<frontend_model>Esun\OceanpaymentKlarna\Block\Adminhtml\System\Config\Form\Field\DecryptedText</frontend_model>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">1</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="sandbox_secure_code" translate="label comment" type="obscure" sortOrder="60"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>测试 Secure Code</label>
|
||||
<comment>仅在服务器端参与签名,不会发送到浏览器。</comment>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">1</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="sandbox_public_key" translate="label comment" type="obscure" sortOrder="70"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>测试 Key</label>
|
||||
<comment>保留 Oceanpayment 提供的 Key;Hosted Checkout 请求不使用此字段。</comment>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">1</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="production_account" translate="label comment" type="text" sortOrder="80"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>正式 Account</label>
|
||||
<comment>完整显示,便于核对当前配置的正式商户号。</comment>
|
||||
<frontend_model>Esun\OceanpaymentKlarna\Block\Adminhtml\System\Config\Form\Field\DecryptedText</frontend_model>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">0</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="production_terminal" translate="label comment" type="text" sortOrder="90"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>正式 Terminal</label>
|
||||
<comment>完整显示,便于核对当前配置的正式终端号。</comment>
|
||||
<frontend_model>Esun\OceanpaymentKlarna\Block\Adminhtml\System\Config\Form\Field\DecryptedText</frontend_model>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">0</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="production_secure_code" translate="label comment" type="obscure" sortOrder="100"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>正式 Secure Code</label>
|
||||
<comment>仅在服务器端参与签名,不会发送到浏览器。</comment>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">0</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="production_public_key" translate="label comment" type="obscure" sortOrder="110"
|
||||
showInDefault="1" showInWebsite="1" showInStore="0">
|
||||
<label>正式 Key</label>
|
||||
<comment>保留 Oceanpayment 提供的 Key;Hosted Checkout 请求不使用此字段。</comment>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
<depends>
|
||||
<field id="sandbox">0</field>
|
||||
</depends>
|
||||
</field>
|
||||
<field id="new_order_status" translate="label" type="select" sortOrder="120"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>新订单状态</label>
|
||||
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
|
||||
</field>
|
||||
<field id="success_order_status" translate="label" type="select" sortOrder="130"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>支付成功状态</label>
|
||||
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
|
||||
</field>
|
||||
<field id="failure_order_status" translate="label" type="select" sortOrder="140"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>支付失败状态</label>
|
||||
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
|
||||
</field>
|
||||
<field id="pending_order_status" translate="label comment" type="select" sortOrder="150"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>预授权/待确认状态</label>
|
||||
<comment>Klarna 返回 payment_status=-1 时使用。</comment>
|
||||
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
|
||||
</field>
|
||||
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="160"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>适用国家</label>
|
||||
<source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
|
||||
</field>
|
||||
<field id="specificcountry" translate="label comment" type="multiselect" sortOrder="170"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>指定国家</label>
|
||||
<comment>默认使用 Oceanpayment 文档列出的 Klarna 支持国家,请以商户终端实际开通范围为准。</comment>
|
||||
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
|
||||
<can_be_empty>1</can_be_empty>
|
||||
</field>
|
||||
<field id="sort_order" translate="label" type="text" sortOrder="180"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>排序</label>
|
||||
<validate>validate-number</validate>
|
||||
</field>
|
||||
<field id="debug" translate="label comment" type="select" sortOrder="190"
|
||||
showInDefault="1" showInWebsite="1" showInStore="1">
|
||||
<label>调试日志</label>
|
||||
<comment>日志会脱敏,不记录凭据、itemList 或完整签名原文。</comment>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
</field>
|
||||
</group>
|
||||
</section>
|
||||
</system>
|
||||
</config>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
|
||||
<default>
|
||||
<payment>
|
||||
<esun_oceanpayment_klarna>
|
||||
<active>0</active>
|
||||
<model>Esun\OceanpaymentKlarna\Model\PaymentMethod</model>
|
||||
<title>Pay with Klarna</title>
|
||||
<sandbox>1</sandbox>
|
||||
<methods>Klarna</methods>
|
||||
<new_order_status>pending_payment</new_order_status>
|
||||
<success_order_status>processing</success_order_status>
|
||||
<failure_order_status>canceled</failure_order_status>
|
||||
<pending_order_status>payment_review</pending_order_status>
|
||||
<allowspecific>1</allowspecific>
|
||||
<specificcountry>AT,BE,CZ,DK,FI,IE,PL,RO,ES,SE,GB,FR,DE,GR,HU,IT,NL,NO,PT,CH,US</specificcountry>
|
||||
<sort_order>82</sort_order>
|
||||
<debug>0</debug>
|
||||
</esun_oceanpayment_klarna>
|
||||
</payment>
|
||||
</default>
|
||||
</config>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Esun\OceanpaymentKlarna\Model\Gateway\Client">
|
||||
<arguments>
|
||||
<argument name="logger" xsi:type="object">Esun\OceanpaymentKlarna\Logger\Logger</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Esun\OceanpaymentKlarna\Model\Callback\Processor">
|
||||
<arguments>
|
||||
<argument name="logger" xsi:type="object">Esun\OceanpaymentKlarna\Logger\Logger</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Esun\OceanpaymentKlarna\Controller\Payment\Redirect">
|
||||
<arguments>
|
||||
<argument name="logger" xsi:type="object">Esun\OceanpaymentKlarna\Logger\Logger</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Esun\OceanpaymentKlarna\Controller\Payment\Back">
|
||||
<arguments>
|
||||
<argument name="logger" xsi:type="object">Esun\OceanpaymentKlarna\Logger\Logger</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Esun\OceanpaymentKlarna\Controller\Payment\Notify">
|
||||
<arguments>
|
||||
<argument name="logger" xsi:type="object">Esun\OceanpaymentKlarna\Logger\Logger</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Config\Model\Config\TypePool">
|
||||
<arguments>
|
||||
<argument name="sensitive" xsi:type="array">
|
||||
<item name="payment/esun_oceanpayment_klarna/sandbox_account" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/sandbox_terminal" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/sandbox_secure_code" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/sandbox_public_key" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/production_account" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/production_terminal" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/production_secure_code" xsi:type="string">1</item>
|
||||
<item name="payment/esun_oceanpayment_klarna/production_public_key" xsi:type="string">1</item>
|
||||
</argument>
|
||||
<argument name="environment" xsi:type="array">
|
||||
<item name="payment/esun_oceanpayment_klarna/sandbox" xsi:type="string">1</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Checkout\Model\CompositeConfigProvider">
|
||||
<arguments>
|
||||
<argument name="configProviders" xsi:type="array">
|
||||
<item name="esun_oceanpayment_klarna" xsi:type="object">Esun\OceanpaymentKlarna\Model\ConfigProvider</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
|
||||
<router id="standard">
|
||||
<route id="oceanpaymentklarna" frontName="oceanpaymentklarna">
|
||||
<module name="Esun_OceanpaymentKlarna"/>
|
||||
</route>
|
||||
</router>
|
||||
</config>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Esun_OceanpaymentKlarna">
|
||||
<sequence>
|
||||
<module name="Magento_Checkout"/>
|
||||
<module name="Magento_Payment"/>
|
||||
<module name="Magento_Sales"/>
|
||||
</sequence>
|
||||
</module>
|
||||
</config>
|
||||
Reference in New Issue
Block a user