diff --git a/Test/Mftf/Test/EcpayBasicTest.xml b/Test/Mftf/Test/EcpayBasicTest.xml new file mode 100644 index 0000000..144792e --- /dev/null +++ b/Test/Mftf/Test/EcpayBasicTest.xml @@ -0,0 +1,25 @@ + + + + + + + + <description value="Verify that the module is installed correctly"/> + <severity value="MINOR"/> + <group value="Ecpay_General"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <amOnPage url="{{AdminDashboardPage.url}}" stepKey="navigateToDashboard"/> + <see userInput="Dashboard" stepKey="seeAdminDashboard"/> + + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + </test> +</tests> \ No newline at end of file diff --git a/composer.json b/composer.json index a99d4f4..f6ae2f8 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "greenworld/magento2-module-general", "type": "magento2-module", - "version": "2.4.2410290", + "version": "2.4.2411050", "license": [ "OSL-3.0", "AFL-3.0" @@ -29,5 +29,8 @@ "psr-4": { "Ecpay\\General\\": "" } + }, + "require-dev": { + "magento/magento2-functional-testing-framework": "^4.0" } } diff --git a/etc/db_schema.xml b/etc/db_schema.xml new file mode 100644 index 0000000..3e2ded8 --- /dev/null +++ b/etc/db_schema.xml @@ -0,0 +1,72 @@ +<?xml version="1.0"?> +<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> + <!-- ecpay_logistic --> + <table name="ecpay_logistic" resource="Ecpay_General::ecpay_logistic"> + <!-- 添加欄位 --> + <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/> + + <column xsi:type="int" name="order_id" comment="Order Id"/> + <column xsi:type="varchar" name="merchant_trade_no" length="255" comment="MerchantTradeNo"/> + <column xsi:type="int" name="rtn_code" comment="RtnCode"/> + <column xsi:type="varchar" name="rtn_msg" length="255" comment="RtnMsg"/> + <column xsi:type="varchar" name="all_pay_logistics_id" length="50" comment="AllPayLogisticsID"/> + <column xsi:type="varchar" name="logistics_type" length="50" comment="LogisticsType"/> + <column xsi:type="varchar" name="logistics_sub_type" length="50" comment="LogisticsSubType"/> + <column xsi:type="varchar" name="booking_note" length="50" comment="BookingNote"/> + <column xsi:type="varchar" name="cvs_payment_no" length="50" comment="CVSPaymentNo"/> + <column xsi:type="varchar" name="cvs_validation_no" length="50" comment="CVSValidationNo"/> + + <!-- 添加外鍵、索引等其他約束 --> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + </constraint> + </table> + + <!-- sales_order --> + <table name="sales_order" resource="Ecpay_General::sales_order"> + <!-- 添加 Logistic 欄位 --> + <column xsi:type="varchar" name="ecpay_logistic_cvs_store_id" length="10" comment="CVSStoreID" nullable="true"/> + <column xsi:type="varchar" name="ecpay_logistic_cvs_store_name" length="10" comment="CVSStoreName" nullable="true"/> + <column xsi:type="varchar" name="ecpay_logistic_cvs_store_address" length="60" comment="CVSAddress" nullable="true"/> + <column xsi:type="varchar" name="ecpay_logistic_cvs_store_telephone" length="20" comment="CVSTelephone" nullable="true"/> + <column xsi:type="int" name="ecpay_logistic_auto_tag" comment="Logistic Auto Tag" nullable="false" default="0"/> + <column xsi:type="int" name="ecpay_shipping_tag" comment="Shipping Tag" nullable="false" default="0"/> + + <!-- 添加 Payment 欄位 --> + <column xsi:type="int" name="ecpay_payment_complete_tag" comment="Payment Complete Tag" nullable="false" default="0"/> + <column xsi:type="varchar" name="ecpay_payment_merchant_trade_no" length="255" comment="Payment Merchant Trade No" nullable="false" default=""/> + </table> + + <!-- ecpay_payment_info --> + <table name="ecpay_payment_info" resource="Ecpay_General::ecpay_payment_info"> + <!-- 添加欄位 --> + <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity ID"/> + + <column xsi:type="int" name="order_id" comment="Order Id"/> + <column xsi:type="varchar" name="merchant_id" length="10" comment="MerchantID"/> + <column xsi:type="varchar" name="merchant_trade_no" length="255" comment="MerchantTradeNo"/> + <column xsi:type="varchar" name="store_id" length="10" comment="StoreID"/> + <column xsi:type="int" name="rtn_code" comment="RtnCode"/> + <column xsi:type="varchar" name="rtn_msg" length="255" comment="RtnMsg"/> + <column xsi:type="varchar" name="trade_no" length="255" comment="TradeNo"/> + <column xsi:type="int" name="trade_amt" comment="TradeAmt"/> + <column xsi:type="varchar" name="payment_type" length="50" comment="PaymentType"/> + <column xsi:type="varchar" name="trade_date" length="50" comment="TradeDate"/> + <column xsi:type="varchar" name="custom_field1" length="100" comment="CustomField1"/> + <column xsi:type="varchar" name="custom_field2" length="100" comment="CustomField2"/> + <column xsi:type="varchar" name="custom_field3" length="100" comment="CustomField3"/> + <column xsi:type="varchar" name="custom_field4" length="100" comment="CustomField4"/> + <column xsi:type="varchar" name="bank_code" length="50" comment="BankCode"/> + <column xsi:type="varchar" name="vaccount" length="50" comment="vAccount"/> + <column xsi:type="varchar" name="expire_date" length="100" comment="ExpireDate"/> + <column xsi:type="varchar" name="payment_no" length="20" comment="PaymentNo"/> + <column xsi:type="varchar" name="barcode1" length="50" comment="Barcode1"/> + <column xsi:type="varchar" name="barcode2" length="50" comment="Barcode2"/> + <column xsi:type="varchar" name="barcode3" length="50" comment="Barcode3"/> + + <!-- 添加外鍵、索引等其他約束 --> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + </constraint> + </table> +</schema> \ No newline at end of file diff --git a/etc/module.xml b/etc/module.xml index d669384..ac5b6c1 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,5 +1,5 @@ <?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="Ecpay_General" setup_version="2.4.2410290"> + <module name="Ecpay_General" setup_version="2.4.2411050"> </module> </config> \ No newline at end of file