This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,194 @@
<?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" translate="label" type="text" sortOrder="800"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>钱海支付 - Hosted</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" type="text" sortOrder="20"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>结账页标题</label>
</field>
<field id="sandbox" translate="label comment" type="select" sortOrder="30"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>沙盒模式</label>
<comment>启用时使用 test-secure.oceanpayment.com;生产环境使用 secure.oceanpayment.com。</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="account" translate="label" type="obscure" sortOrder="40"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Account</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="terminal" translate="label" type="obscure" sortOrder="50"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Terminal</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="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>
</field>
<field id="public_key" translate="label comment" type="obscure" sortOrder="70"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Key(可选)</label>
<comment>Oceanpayment 提供的 key;托管结账通常无需此字段,配置后将随请求提交。</comment>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="methods" translate="label comment" type="text" sortOrder="80"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>支付方式代码</label>
<comment>例如 Credit Card、UnionPay;必须与钱海为该终端开通的官方方法名一致。</comment>
</field>
<field id="language" translate="label comment" type="text" sortOrder="90"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>支付页语言(可选)</label>
<comment>例如 en_US、zh_CN;留空时由钱海按浏览器语言选择。</comment>
</field>
<field id="new_order_status" translate="label" type="select" sortOrder="100"
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="110"
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="120"
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" 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="allowspecific" translate="label" type="allowspecific" sortOrder="140"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>适用国家</label>
<source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
</field>
<field id="specificcountry" translate="label" type="multiselect" sortOrder="150"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>指定国家</label>
<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="160"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>排序</label>
<validate>validate-number</validate>
</field>
<field id="debug" translate="label comment" type="select" sortOrder="170"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>调试日志</label>
<comment>日志会脱敏,不记录 secureCode、key 或完整签名原文。</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
<group id="esun_oceanpayment_onepage" translate="label" type="text" sortOrder="810"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>钱海支付 - OnePage</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" type="text" sortOrder="20"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>结账页标题</label>
</field>
<field id="sandbox" translate="label comment" type="select" sortOrder="30"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>沙盒模式</label>
<comment>启用时由 SDK 使用 test-secure.oceanpayment.com。</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="account" translate="label" type="obscure" sortOrder="40"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Account</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="terminal" translate="label" type="obscure" sortOrder="50"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Terminal</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="secure_code" translate="label comment" type="obscure" sortOrder="60"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Secure Code</label>
<comment>仅在服务器端参与 OnePage 专用签名。</comment>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="public_key" translate="label comment" type="obscure" sortOrder="70"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Key</label>
<comment>OnePage SDK 请求必填的钱海 key。</comment>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>
<field id="methods" translate="label comment" type="text" sortOrder="80"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>支付方式代码</label>
<comment>OnePage 当前使用 Credit Card。</comment>
</field>
<field id="language" translate="label comment" type="text" sortOrder="90"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>支付页语言(可选)</label>
<comment>例如 en_US、zh_CN;留空时按浏览器语言选择。</comment>
</field>
<field id="new_order_status" translate="label" type="select" sortOrder="100"
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="110"
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="120"
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" 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="allowspecific" translate="label" type="allowspecific" sortOrder="140"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>适用国家</label>
<source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
</field>
<field id="specificcountry" translate="label" type="multiselect" sortOrder="150"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>指定国家</label>
<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="160"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>排序</label>
<validate>validate-number</validate>
</field>
<field id="debug" translate="label comment" type="select" sortOrder="170"
showInDefault="1" showInWebsite="1" showInStore="1">
<label>调试日志</label>
<comment>日志会脱敏,不记录 secureCode、key 或完整签名原文。</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
</section>
</system>
</config>
+38
View File
@@ -0,0 +1,38 @@
<?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>
<active>0</active>
<model>Esun\Oceanpayment\Model\PaymentMethod</model>
<title>Oceanpayment</title>
<sandbox>1</sandbox>
<methods>Credit Card</methods>
<language></language>
<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>0</allowspecific>
<sort_order>80</sort_order>
<debug>0</debug>
</esun_oceanpayment>
<esun_oceanpayment_onepage>
<active>0</active>
<model>Esun\Oceanpayment\Model\OnepagePaymentMethod</model>
<title>Oceanpayment OnePage</title>
<sandbox>1</sandbox>
<methods>Credit Card</methods>
<language></language>
<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>0</allowspecific>
<sort_order>81</sort_order>
<debug>0</debug>
</esun_oceanpayment_onepage>
</payment>
</default>
</config>
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
<policies>
<policy id="script-src">
<values>
<value id="oceanpayment_secure_script" type="host">secure.oceanpayment.com</value>
</values>
</policy>
<policy id="frame-src">
<values>
<value id="oceanpayment_secure_frame" type="host">secure.oceanpayment.com</value>
<value id="oceanpayment_test_frame" type="host">test-secure.oceanpayment.com</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="oceanpayment_secure_connect" type="host">secure.oceanpayment.com</value>
<value id="oceanpayment_test_connect" type="host">test-secure.oceanpayment.com</value>
</values>
</policy>
<policy id="form-action">
<values>
<value id="oceanpayment_secure_form" type="host">secure.oceanpayment.com</value>
<value id="oceanpayment_test_form" type="host">test-secure.oceanpayment.com</value>
</values>
</policy>
</policies>
</csp_whitelist>
+57
View File
@@ -0,0 +1,57 @@
<?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\Oceanpayment\Model\Gateway\Client">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Esun\Oceanpayment\Model\Callback\Processor">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Esun\Oceanpayment\Controller\Payment\Redirect">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Esun\Oceanpayment\Controller\Payment\Back">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Esun\Oceanpayment\Controller\Payment\Notify">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Esun\Oceanpayment\Controller\Payment\Onepage">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Esun\Oceanpayment\Controller\Payment\OnepageResult">
<arguments>
<argument name="logger" xsi:type="object">Esun\Oceanpayment\Logger\Logger</argument>
</arguments>
</type>
<type name="Magento\Config\Model\Config\TypePool">
<arguments>
<argument name="sensitive" xsi:type="array">
<item name="payment/esun_oceanpayment/account" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment/terminal" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment/secure_code" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment/public_key" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment_onepage/account" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment_onepage/terminal" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment_onepage/secure_code" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment_onepage/public_key" xsi:type="string">1</item>
</argument>
<argument name="environment" xsi:type="array">
<item name="payment/esun_oceanpayment/sandbox" xsi:type="string">1</item>
<item name="payment/esun_oceanpayment_onepage/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" xsi:type="object">Esun\Oceanpayment\Model\ConfigProvider</item>
</argument>
</arguments>
</type>
</config>
@@ -0,0 +1,12 @@
<?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="oceanpayment" frontName="oceanpayment">
<module name="Esun_Oceanpayment"/>
</route>
<route id="paymentqianhai" frontName="paymentqianhai">
<module name="Esun_Oceanpayment"/>
</route>
</router>
</config>
+12
View File
@@ -0,0 +1,12 @@
<?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_Oceanpayment">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Csp"/>
<module name="Magento_Payment"/>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>