rails_trade 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +20 -165
- data/README.md +8 -1
- data/app/apis/trade/apple_pay_api.rb +33 -0
- data/app/controllers/trade/admin/advances_controller.rb +58 -0
- data/app/controllers/trade/admin/base_controller.rb +3 -4
- data/app/controllers/trade/admin/card_advances_controller.rb +60 -0
- data/app/controllers/trade/admin/card_logs_controller.rb +44 -0
- data/app/controllers/trade/admin/card_payments_controller.rb +60 -0
- data/app/controllers/trade/admin/card_prepayments_controller.rb +58 -0
- data/app/controllers/trade/admin/card_promotes_controller.rb +63 -0
- data/app/controllers/trade/admin/card_templates_controller.rb +69 -0
- data/app/controllers/trade/admin/cards_controller.rb +66 -0
- data/app/controllers/trade/admin/carts_controller.rb +74 -0
- data/app/controllers/trade/admin/cash_givens_controller.rb +55 -0
- data/app/controllers/trade/admin/cash_logs_controller.rb +45 -0
- data/app/controllers/trade/admin/cashes_controller.rb +41 -0
- data/app/controllers/trade/admin/order_payments_controller.rb +42 -40
- data/app/controllers/trade/admin/orders_controller.rb +73 -83
- data/app/controllers/trade/admin/payment_methods_controller.rb +71 -84
- data/app/controllers/trade/admin/payment_orders_controller.rb +45 -42
- data/app/controllers/trade/admin/payment_references_controller.rb +45 -39
- data/app/controllers/trade/admin/payment_strategies_controller.rb +43 -40
- data/app/controllers/trade/admin/payments_controller.rb +68 -74
- data/app/controllers/trade/admin/payouts_controller.rb +67 -0
- data/app/controllers/trade/admin/promote_carts_controller.rb +54 -0
- data/app/controllers/trade/admin/promote_charges_controller.rb +55 -53
- data/app/controllers/trade/admin/promote_goods_controller.rb +51 -46
- data/app/controllers/trade/admin/promotes_controller.rb +3 -67
- data/app/controllers/trade/admin/refunds_controller.rb +51 -40
- data/app/controllers/trade/admin/trade_items_controller.rb +103 -98
- data/app/controllers/trade/admin/trade_promotes_controller.rb +36 -54
- data/app/controllers/trade/admin/users_controller.rb +30 -0
- data/app/controllers/trade/advances_controller.rb +50 -0
- data/app/controllers/trade/base_controller.rb +4 -0
- data/app/controllers/trade/card_templates_controller.rb +61 -0
- data/app/controllers/trade/controller/application.rb +35 -0
- data/app/controllers/trade/controller/promote.rb +68 -0
- data/app/controllers/trade/my/advances_controller.rb +66 -0
- data/app/controllers/trade/my/base_controller.rb +3 -3
- data/app/controllers/trade/my/card_logs_controller.rb +15 -0
- data/app/controllers/trade/my/cards_controller.rb +78 -0
- data/app/controllers/trade/my/carts_controller.rb +50 -29
- data/app/controllers/trade/my/cash_logs_controller.rb +10 -0
- data/app/controllers/trade/my/orders_controller.rb +145 -81
- data/app/controllers/trade/my/payment_methods_controller.rb +40 -57
- data/app/controllers/trade/my/payments_controller.rb +56 -0
- data/app/controllers/trade/my/payouts_controller.rb +33 -0
- data/app/controllers/trade/my/trade_items_controller.rb +54 -44
- data/app/controllers/trade/panel/base_controller.rb +4 -0
- data/app/controllers/trade/panel/exchange_rates_controller.rb +53 -0
- data/app/controllers/trade/payments_controller.rb +53 -51
- data/app/models/payment/trade/alipay_payment.rb +5 -0
- data/app/models/payment/trade/apple_payment.rb +5 -0
- data/app/models/payment/trade/bank_payment.rb +5 -0
- data/app/models/payment/trade/card_payment.rb +5 -0
- data/app/models/payment/trade/hand_payment.rb +5 -0
- data/app/models/payment/trade/paypal_payment.rb +5 -0
- data/app/models/payment/trade/stripe_payment.rb +5 -0
- data/app/models/payment/trade/wxpay_payment.rb +5 -0
- data/app/models/payment_method/trade/alipay_method.rb +4 -0
- data/app/models/payment_method/trade/bank_method.rb +4 -0
- data/app/models/payment_method/trade/stripe_method.rb +5 -0
- data/app/models/payout/trade/wxpay_payout.rb +5 -0
- data/app/models/promote_charge/trade/discount_promote_charge.rb +5 -0
- data/app/models/promote_charge/trade/final_promote_charge.rb +5 -0
- data/app/models/promote_charge/trade/minus_promote_charge.rb +5 -0
- data/app/models/promote_charge/trade/plus_promote_charge.rb +5 -0
- data/app/models/refund/trade/alipay_refund.rb +5 -0
- data/app/models/refund/trade/bank_refund.rb +5 -0
- data/app/models/refund/trade/card_refund.rb +5 -0
- data/app/models/refund/trade/hand_refund.rb +5 -0
- data/app/models/refund/trade/paypal_refund.rb +5 -0
- data/app/models/refund/trade/stripe_refund.rb +5 -0
- data/app/models/refund/trade/wxpay_refund.rb +5 -0
- data/app/models/trade/advance.rb +6 -0
- data/app/models/trade/application_record.rb +5 -0
- data/app/models/trade/card.rb +6 -0
- data/app/models/trade/card_advance.rb +5 -0
- data/app/models/trade/card_log.rb +5 -0
- data/app/models/trade/card_prepayment.rb +5 -0
- data/app/models/trade/card_promote.rb +5 -0
- data/app/models/trade/card_template.rb +5 -0
- data/app/models/trade/cart.rb +7 -0
- data/app/models/trade/cash.rb +6 -0
- data/app/models/trade/cash_given.rb +5 -0
- data/app/models/trade/cash_log.rb +5 -0
- data/app/models/trade/exchange_rate.rb +5 -0
- data/app/models/trade/ext/payable.rb +50 -0
- data/app/models/trade/ext/user.rb +38 -0
- data/app/models/trade/model/advance.rb +43 -0
- data/app/models/trade/model/agency.rb +10 -0
- data/app/models/trade/model/amount.rb +41 -0
- data/app/models/trade/model/card.rb +64 -0
- data/app/models/trade/model/card_advance.rb +52 -0
- data/app/models/trade/model/card_log.rb +17 -0
- data/app/models/trade/model/card_prepayment.rb +31 -0
- data/app/models/trade/model/card_promote.rb +14 -0
- data/app/models/trade/model/card_template.rb +31 -0
- data/app/models/trade/model/cart.rb +60 -0
- data/app/models/trade/model/cash.rb +32 -0
- data/app/models/trade/model/cash_given.rb +40 -0
- data/app/models/trade/model/cash_log.rb +26 -0
- data/app/models/trade/model/compute.rb +33 -0
- data/app/models/trade/model/exchange_rate.rb +44 -0
- data/app/models/trade/model/good.rb +66 -0
- data/app/models/trade/model/member.rb +25 -0
- data/app/models/trade/model/order.rb +127 -0
- data/app/models/trade/model/payment/alipay_payment.rb +17 -0
- data/app/models/trade/model/payment/apple_payment.rb +9 -0
- data/app/models/trade/model/payment/bank_payment.rb +19 -0
- data/app/models/trade/model/payment/card_payment.rb +72 -0
- data/app/models/trade/model/payment/hand_payment.rb +10 -0
- data/app/models/trade/model/payment/paypal_payment.rb +10 -0
- data/app/models/trade/model/payment/stripe_payment.rb +11 -0
- data/app/models/trade/model/payment/wxpay_payment.rb +15 -0
- data/app/models/trade/model/payment.rb +131 -0
- data/app/models/trade/model/payment_method/stripe_method.rb +59 -0
- data/app/models/trade/model/payment_method.rb +67 -0
- data/app/models/trade/model/payment_order.rb +108 -0
- data/app/models/trade/model/payment_reference.rb +21 -0
- data/app/models/trade/model/payment_strategy.rb +22 -0
- data/app/models/trade/model/payout/wxpay_payout.rb +31 -0
- data/app/models/trade/model/payout.rb +71 -0
- data/app/models/trade/model/plan_attender.rb +33 -0
- data/app/models/trade/model/profile.rb +10 -0
- data/app/models/trade/model/promote.rb +59 -0
- data/app/models/trade/model/promote_cart.rb +30 -0
- data/app/models/trade/model/promote_charge/discount_promote_charge.rb +19 -0
- data/app/models/trade/model/promote_charge/final_promote_charge.rb +11 -0
- data/app/models/trade/model/promote_charge/minus_promote_charge.rb +20 -0
- data/app/models/trade/model/promote_charge/plus_promote_charge.rb +9 -0
- data/app/models/trade/model/promote_charge.rb +86 -0
- data/app/models/trade/model/promote_extra.rb +16 -0
- data/app/models/trade/model/promote_good.rb +28 -0
- data/app/models/trade/model/refund/alipay_refund.rb +29 -0
- data/app/models/trade/model/refund/bank_refund.rb +4 -0
- data/app/models/trade/model/refund/card_refund.rb +45 -0
- data/app/models/trade/model/refund/hand_refund.rb +9 -0
- data/app/models/trade/model/refund/paypal_refund.rb +27 -0
- data/app/models/trade/model/refund/stripe_refund.rb +20 -0
- data/app/models/trade/model/refund/wxpay_refund.rb +74 -0
- data/app/models/trade/model/refund.rb +70 -0
- data/app/models/trade/model/sell.rb +24 -0
- data/app/models/trade/model/trade_item.rb +214 -0
- data/app/models/trade/model/trade_promote.rb +69 -0
- data/app/models/trade/order.rb +8 -0
- data/app/models/trade/ordering/payment.rb +112 -0
- data/app/models/trade/ordering/refund.rb +36 -0
- data/app/models/trade/payment.rb +6 -0
- data/app/models/trade/payment_method.rb +5 -0
- data/app/models/trade/payment_order.rb +5 -0
- data/app/models/trade/payment_reference.rb +5 -0
- data/app/models/trade/payment_strategy.rb +5 -0
- data/app/models/trade/payment_type/alipay.rb +35 -0
- data/app/models/trade/payment_type/apple_pay.rb +20 -0
- data/app/models/trade/payment_type/paypal.rb +84 -0
- data/app/models/trade/payment_type/stripe.rb +57 -0
- data/app/models/trade/payment_type/svf_card.rb +24 -0
- data/app/models/trade/payment_type/wxpay.rb +104 -0
- data/app/models/trade/payout.rb +5 -0
- data/app/models/trade/promote.rb +6 -0
- data/app/models/trade/promote_cart.rb +5 -0
- data/app/models/trade/promote_charge.rb +5 -0
- data/app/models/trade/promote_extra.rb +5 -0
- data/app/models/trade/promote_good.rb +5 -0
- data/app/models/trade/refund.rb +5 -0
- data/app/models/trade/trade_item.rb +5 -0
- data/app/models/trade/trade_promote.rb +5 -0
- data/app/models/trade.rb +11 -0
- data/app/views/admin/_trade_nav.html.erb +35 -0
- data/app/views/my/_trade_nav.html.erb +4 -9
- data/app/views/panel/_trade_nav.html.erb +10 -0
- data/app/views/trade/admin/advances/_breadcrumb.html.erb +7 -0
- data/app/views/trade/admin/advances/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/advances/_form.html.erb +4 -0
- data/app/views/trade/admin/advances/_index_tbody.html.erb +3 -0
- data/app/views/trade/admin/advances/_index_thead.html.erb +4 -0
- data/app/views/trade/admin/advances/_new_form.html.erb +4 -0
- data/app/views/trade/admin/advances/index.html.erb +5 -0
- data/app/views/trade/admin/advances/show.html.erb +30 -0
- data/app/views/trade/admin/base/_nav.html.erb +4 -0
- data/app/views/trade/admin/card_advances/_breadcrumb.html.erb +7 -0
- data/app/views/trade/admin/card_advances/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/card_advances/_form.html.erb +3 -0
- data/app/views/trade/admin/card_advances/_index_tbody.html.erb +5 -0
- data/app/views/trade/admin/card_advances/_index_thead.html.erb +6 -0
- data/app/views/trade/admin/card_advances/_new_form.html.erb +4 -0
- data/app/views/trade/admin/card_advances/_show_table.html.erb +20 -0
- data/app/views/trade/admin/card_advances/index.html.erb +5 -0
- data/app/views/trade/admin/card_logs/_breadcrumb.html.erb +7 -0
- data/app/views/trade/admin/card_logs/_card_log.json.jbuilder +11 -0
- data/app/views/trade/admin/card_logs/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/card_logs/_filter_form.html.erb +8 -0
- data/app/views/trade/admin/card_logs/_form.html.erb +3 -0
- data/app/views/trade/admin/card_logs/_index_tbody.html.erb +8 -0
- data/app/views/trade/admin/card_logs/_index_thead.html.erb +9 -0
- data/app/views/trade/admin/card_logs/_index_tr.html.erb +10 -0
- data/app/views/trade/admin/card_logs/_new_form.html.erb +4 -0
- data/app/views/trade/admin/card_logs/_show.json.jbuilder +1 -0
- data/app/views/trade/admin/card_logs/_show_table.html.erb +24 -0
- data/app/views/trade/admin/card_logs/index.html.erb +5 -0
- data/app/views/trade/admin/card_logs/index.json.jbuilder +1 -0
- data/app/views/trade/admin/card_payments/_breadcrumb.html.erb +7 -0
- data/app/views/trade/admin/{orders/_search_form.html.erb → card_payments/_button.html.erb} +0 -0
- data/app/views/trade/admin/card_payments/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/card_payments/_filter_form.html.erb +9 -0
- data/app/views/trade/admin/card_payments/_form.html.erb +2 -0
- data/app/views/trade/admin/card_payments/_index_tbody.html.erb +3 -0
- data/app/views/trade/admin/card_payments/_index_thead.html.erb +4 -0
- data/app/views/trade/admin/card_payments/_new_form.html.erb +4 -0
- data/app/views/trade/admin/card_payments/_show_table.html.erb +12 -0
- data/app/views/trade/admin/card_payments/index.html.erb +5 -0
- data/app/views/trade/admin/card_prepayments/_breadcrumb.html.erb +6 -0
- data/app/views/trade/admin/card_prepayments/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/card_prepayments/_filter_form.html.erb +9 -0
- data/app/views/trade/admin/card_prepayments/_form.html.erb +3 -0
- data/app/views/trade/admin/card_prepayments/_index_tbody.html.erb +3 -0
- data/app/views/trade/admin/card_prepayments/_index_thead.html.erb +4 -0
- data/app/views/trade/admin/card_prepayments/_new_form.html.erb +4 -0
- data/app/views/trade/admin/card_prepayments/_show_table.html.erb +16 -0
- data/app/views/trade/admin/card_prepayments/index.html.erb +5 -0
- data/app/views/trade/admin/card_promotes/_breadcrumb.html.erb +6 -0
- data/app/views/trade/admin/card_promotes/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/card_promotes/_filter_form.html.erb +9 -0
- data/app/views/trade/admin/card_promotes/_form.html.erb +4 -0
- data/app/views/trade/admin/card_promotes/_index_tbody.html.erb +5 -0
- data/app/views/trade/admin/card_promotes/_index_thead.html.erb +6 -0
- data/app/views/trade/admin/card_promotes/_new_form.html.erb +4 -0
- data/app/views/trade/admin/card_promotes/_show_table.html.erb +12 -0
- data/app/views/trade/admin/card_promotes/index.html.erb +5 -0
- data/app/views/trade/admin/card_templates/_advance_options.html.erb +1 -0
- data/app/views/trade/admin/card_templates/_card_template.json.jbuilder +7 -0
- data/app/views/trade/admin/card_templates/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/card_templates/_filter_form.html.erb +9 -0
- data/app/views/trade/admin/card_templates/_form.html.erb +11 -0
- data/app/views/trade/admin/card_templates/_index_tbody.html.erb +14 -0
- data/app/views/trade/admin/card_templates/_index_thead.html.erb +10 -0
- data/app/views/trade/admin/card_templates/_index_tr.html.erb +25 -0
- data/app/views/trade/admin/card_templates/_item_form.html.erb +15 -0
- data/app/views/trade/admin/card_templates/_new_form.html.erb +4 -0
- data/app/views/trade/admin/card_templates/_show.json.jbuilder +1 -0
- data/app/views/trade/admin/card_templates/_show_table.html.erb +12 -0
- data/app/views/trade/admin/card_templates/advance_options.js.erb +3 -0
- data/app/views/trade/admin/card_templates/index.html.erb +5 -0
- data/app/views/trade/admin/card_templates/index.json.jbuilder +1 -0
- data/app/views/trade/admin/cards/_breadcrumb.html.erb +6 -0
- data/app/views/trade/admin/cards/_button.html.erb +3 -0
- data/app/views/trade/admin/cards/_card.json.jbuilder +10 -0
- data/app/views/trade/admin/cards/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/cards/_filter_form.html.erb +10 -0
- data/app/views/trade/admin/cards/_filter_table.html.erb +11 -0
- data/app/views/trade/admin/cards/_form.html.erb +4 -0
- data/app/views/trade/admin/cards/_index_tbody.html.erb +25 -0
- data/app/views/trade/admin/cards/_index_thead.html.erb +14 -0
- data/app/views/trade/admin/cards/_index_tr.html.erb +19 -0
- data/app/views/trade/admin/cards/_new_form.html.erb +5 -0
- data/app/views/trade/admin/cards/_show.json.jbuilder +1 -0
- data/app/views/trade/admin/cards/_show_table.html.erb +20 -0
- data/app/views/trade/admin/cards/index.html.erb +5 -0
- data/app/views/trade/admin/cards/index.json.jbuilder +1 -0
- data/app/views/trade/admin/{promote_buyers/show.html.erb → carts/_button.html.erb} +0 -0
- data/app/views/trade/admin/{cart_item_serves → carts}/_check.html.erb +0 -0
- data/app/views/trade/admin/{cart_item_serves → carts}/_index.html.erb +1 -3
- data/app/views/trade/admin/carts/_index_tbody.html.erb +6 -0
- data/app/views/trade/admin/carts/_index_thead.html.erb +7 -0
- data/app/views/trade/admin/{cart_item_serves → carts}/_new.html.erb +1 -1
- data/app/views/trade/admin/{cart_item_serves → carts}/_serve.html.erb +2 -2
- data/app/views/trade/admin/{cart_item_serves → carts}/_single.html.erb +0 -0
- data/app/views/trade/admin/{cart_item_serves → carts}/_single_table.html.erb +0 -0
- data/app/views/trade/admin/{cart_item_serves → carts}/_total.html.erb +0 -0
- data/app/views/trade/admin/{cart_item_serves → carts}/_total_table.html.erb +0 -0
- data/app/views/trade/admin/carts/index.html.erb +5 -0
- data/app/views/trade/admin/cash_givens/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/cash_givens/_filter_form.html.erb +5 -0
- data/app/views/trade/admin/cash_givens/_form.html.erb +4 -0
- data/app/views/trade/admin/cash_givens/_index_tbody.html.erb +17 -0
- data/app/views/trade/admin/cash_givens/_index_thead.html.erb +4 -0
- data/app/views/trade/admin/cash_givens/_new_form.html.erb +4 -0
- data/app/views/trade/admin/cash_givens/_show_table.html.erb +12 -0
- data/app/views/trade/admin/cash_givens/index.html.erb +5 -0
- data/app/views/trade/admin/cash_logs/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/cash_logs/_filter_form.html.erb +8 -0
- data/app/views/trade/admin/cash_logs/_form.html.erb +2 -0
- data/app/views/trade/admin/cash_logs/_index_tbody.html.erb +25 -0
- data/app/views/trade/admin/cash_logs/_index_thead.html.erb +11 -0
- data/app/views/trade/admin/cash_logs/_new_form.html.erb +4 -0
- data/app/views/trade/admin/cash_logs/_show_table.html.erb +20 -0
- data/app/views/trade/admin/cash_logs/index.html.erb +5 -0
- data/app/views/trade/admin/cashes/_button.html.erb +0 -0
- data/app/views/trade/admin/cashes/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/cashes/_filter_form.html.erb +5 -0
- data/app/views/trade/admin/cashes/_form.html.erb +3 -0
- data/app/views/trade/admin/cashes/_index_tbody.html.erb +18 -0
- data/app/views/trade/admin/cashes/_index_thead.html.erb +12 -0
- data/app/views/trade/admin/cashes/_new_form.html.erb +4 -0
- data/app/views/trade/admin/cashes/_show_tbody.html.erb +20 -0
- data/app/views/trade/admin/cashes/index.html.erb +5 -0
- data/app/views/trade/admin/goods/_form.html.erb +1 -1
- data/app/views/trade/admin/goods/_item.html.erb +1 -1
- data/app/views/trade/admin/goods/_new.html.erb +1 -1
- data/app/views/trade/admin/order_payments/_index_tbody.html.erb +6 -0
- data/app/views/trade/admin/order_payments/_index_thead.html.erb +6 -0
- data/app/views/trade/admin/order_payments/_index_tr.html.erb +4 -0
- data/app/views/trade/admin/order_payments/_new_form.html.erb +30 -0
- data/app/views/trade/admin/order_payments/_payment_orders.html.erb +2 -2
- data/app/views/trade/admin/order_payments/index.html.erb +12 -0
- data/app/views/trade/admin/orders/_addresses.html.erb +3 -3
- data/app/views/trade/admin/orders/_breadcrumb.html.erb +5 -0
- data/app/views/trade/admin/orders/_button.html.erb +0 -0
- data/app/views/trade/admin/orders/_edit_form.html.erb +3 -0
- data/app/views/trade/admin/orders/_filter_form.html.erb +9 -0
- data/app/views/trade/admin/orders/_filter_table.html.erb +20 -0
- data/app/views/trade/admin/orders/_index_tbody.html.erb +16 -0
- data/app/views/trade/admin/orders/_index_thead.html.erb +8 -0
- data/app/views/trade/admin/orders/_index_tr.html.erb +10 -0
- data/app/views/trade/admin/orders/_invoice_addresses.html.erb +3 -3
- data/app/views/trade/admin/orders/_show/_breadcrumb.html.erb +6 -0
- data/app/views/trade/admin/orders/index.html.erb +2 -49
- data/app/views/trade/admin/orders/new.html.erb +1 -1
- data/app/{assets/javascripts/controllers → views}/trade/admin/orders/new.js +0 -0
- data/app/views/trade/admin/orders/payments.html.erb +6 -6
- data/app/views/trade/admin/orders/refund.turbo_stream.erb +3 -0
- data/app/views/trade/admin/orders/show.html.erb +12 -20
- data/app/views/trade/admin/payment_methods/_breadcrumb.html.erb +10 -0
- data/app/views/trade/admin/payment_methods/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/payment_methods/_filter_form.html.erb +12 -0
- data/app/views/trade/admin/payment_methods/_filter_table.html.erb +9 -0
- data/app/views/trade/admin/payment_methods/_form.html.erb +1 -2
- data/app/views/trade/admin/payment_methods/_index_tbody.html.erb +17 -0
- data/app/views/trade/admin/payment_methods/_index_thead.html.erb +7 -0
- data/app/views/trade/admin/payment_methods/_index_tr.html.erb +10 -0
- data/app/views/trade/admin/payment_methods/_new_form.html.erb +4 -0
- data/app/views/trade/admin/payment_methods/_unverified/_index_tbody.html.erb +37 -0
- data/app/views/trade/admin/payment_methods/index.html.erb +4 -25
- data/app/views/trade/admin/payment_methods/mine.html.erb +3 -3
- data/app/views/trade/admin/payment_methods/unverified.html.erb +4 -57
- data/app/views/trade/admin/payment_orders/_index.html.erb +5 -7
- data/app/views/trade/admin/payment_orders/_new.html.erb +5 -8
- data/app/views/trade/admin/payment_orders/_orders.html.erb +1 -3
- data/app/views/trade/admin/payment_orders/cancel.js.erb +2 -2
- data/app/views/trade/admin/payment_orders/create.js.erb +2 -2
- data/app/views/trade/admin/payment_orders/new.turbo_stream.erb +2 -0
- data/app/views/trade/admin/payment_orders/update.js.erb +2 -2
- data/app/views/trade/admin/payment_orders/update_fail.js.erb +2 -2
- data/app/views/trade/admin/payment_strategies/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/payment_strategies/_form.html.erb +2 -5
- data/app/views/trade/admin/payment_strategies/_index_tbody.html.erb +12 -0
- data/app/views/trade/admin/payment_strategies/_index_thead.html.erb +3 -0
- data/app/views/trade/admin/payment_strategies/_new_form.html.erb +4 -0
- data/app/views/trade/admin/payment_strategies/index.html.erb +4 -36
- data/app/views/trade/admin/payments/_breadcrumb.html.erb +5 -0
- data/app/views/trade/admin/payments/_button.html.erb +2 -0
- data/app/views/trade/admin/payments/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/payments/_filter_form.html.erb +13 -0
- data/app/views/trade/admin/payments/_filter_table.html.erb +29 -0
- data/app/views/trade/admin/payments/_form.html.erb +2 -3
- data/app/views/trade/admin/payments/_index_tbody.html.erb +24 -0
- data/app/views/trade/admin/payments/_index_thead.html.erb +15 -0
- data/app/views/trade/admin/payments/_index_tr.html.erb +17 -0
- data/app/views/trade/admin/payments/_new_form.html.erb +4 -0
- data/app/views/trade/admin/payments/dashboard.html.erb +0 -3
- data/app/views/trade/admin/payments/index.html.erb +2 -37
- data/app/views/trade/admin/payouts/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/payouts/_filter_form.html.erb +10 -0
- data/app/views/trade/admin/payouts/_form.html.erb +4 -0
- data/app/views/trade/admin/payouts/_index_tbody.html.erb +12 -0
- data/app/views/trade/admin/payouts/_index_thead.html.erb +11 -0
- data/app/views/trade/admin/payouts/_index_tr.html.erb +9 -0
- data/app/views/trade/admin/payouts/_new_form.html.erb +4 -0
- data/app/views/trade/admin/payouts/_show_table.html.erb +32 -0
- data/app/views/trade/admin/payouts/index.html.erb +5 -0
- data/app/views/trade/admin/promote_carts/_breadcrumb.html.erb +10 -0
- data/app/views/trade/admin/promote_carts/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/promote_carts/_filter_form.html.erb +9 -0
- data/app/views/trade/admin/promote_carts/_form.html.erb +9 -0
- data/app/views/trade/admin/promote_carts/_index_tbody.html.erb +3 -0
- data/app/views/trade/admin/promote_carts/_index_thead.html.erb +4 -0
- data/app/views/trade/admin/promote_carts/_index_tr.html.erb +10 -0
- data/app/views/trade/admin/promote_carts/_new_form.html.erb +4 -0
- data/app/views/trade/admin/{promote_buyers → promote_carts}/_promote_buyer.json.jbuilder +0 -0
- data/app/{assets/javascripts/controllers/trade/admin/promote_buyers → views/trade/admin/promote_carts}/edit.js +0 -0
- data/app/views/trade/admin/promote_carts/index.html.erb +5 -0
- data/app/views/trade/admin/{promote_buyers → promote_carts}/index.json.jbuilder +0 -0
- data/app/{assets/javascripts/controllers/trade/admin/promote_buyers → views/trade/admin/promote_carts}/new.js +0 -0
- data/app/views/trade/admin/promote_carts/show.json.jbuilder +1 -0
- data/app/views/trade/admin/promote_charges/_base_price_form.html.erb +1 -1
- data/app/views/trade/admin/promote_charges/_breadcrumb.html.erb +7 -0
- data/app/views/trade/admin/promote_charges/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/promote_charges/_filter_form.html.erb +13 -0
- data/app/views/trade/admin/promote_charges/_form.html.erb +5 -7
- data/app/views/trade/admin/promote_charges/_index_tbody.html.erb +17 -0
- data/app/views/trade/admin/promote_charges/_index_thead.html.erb +12 -0
- data/app/views/trade/admin/promote_charges/_index_tr.html.erb +13 -0
- data/app/views/trade/admin/promote_charges/_new_form.html.erb +4 -0
- data/app/views/trade/admin/promote_charges/index.html.erb +2 -62
- data/app/views/trade/admin/promote_goods/_breadcrumb.html.erb +9 -0
- data/app/views/trade/admin/promote_goods/_button.html.erb +3 -0
- data/app/views/trade/admin/promote_goods/_filter_form.html.erb +10 -0
- data/app/views/trade/admin/promote_goods/_form.html.erb +7 -8
- data/app/views/trade/admin/promote_goods/_index_tbody.html.erb +10 -0
- data/app/views/trade/admin/promote_goods/_index_thead.html.erb +5 -0
- data/app/views/trade/admin/promote_goods/_index_tr.html.erb +16 -0
- data/app/views/trade/admin/promote_goods/_new_form.html.erb +4 -0
- data/app/views/trade/admin/promote_goods/goods.js.erb +1 -1
- data/app/views/trade/admin/promote_goods/index.html.erb +2 -58
- data/app/views/trade/admin/promotes/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/promotes/_filter_table.html.erb +11 -0
- data/app/views/trade/admin/promotes/_form.html.erb +3 -8
- data/app/views/trade/admin/promotes/_index_tbody.html.erb +18 -0
- data/app/views/trade/admin/promotes/_index_thead.html.erb +12 -0
- data/app/views/trade/admin/promotes/_index_tr.html.erb +22 -0
- data/app/views/trade/admin/promotes/_new_form.html.erb +4 -0
- data/app/views/trade/admin/promotes/_new_promote_charge.html.erb +1 -1
- data/app/views/trade/admin/promotes/_show_table.html.erb +4 -0
- data/app/views/trade/admin/promotes/index.html.erb +4 -78
- data/app/views/trade/admin/refunds/_breadcrumb.html.erb +6 -0
- data/app/views/trade/admin/refunds/_filter_form.html.erb +13 -0
- data/app/views/trade/admin/refunds/_index_tbody.html.erb +25 -0
- data/app/views/trade/admin/refunds/_index_thead.html.erb +12 -0
- data/app/views/trade/admin/refunds/_index_tr.html.erb +3 -0
- data/app/views/trade/admin/refunds/_logs_form.html.erb +33 -0
- data/app/views/trade/admin/refunds/_new.html.erb +8 -18
- data/app/views/trade/admin/refunds/confirm.turbo_stream.erb +3 -0
- data/app/views/trade/admin/refunds/deny.turbo_stream.erb +3 -0
- data/app/views/trade/admin/refunds/index.html.erb +4 -52
- data/app/views/trade/admin/refunds/logs.turbo_stream.erb +1 -0
- data/app/views/trade/admin/trade_items/_filter.html.erb +5 -5
- data/app/views/trade/admin/trade_items/_good_price.html.erb +5 -5
- data/app/views/trade/admin/trade_items/_order_price.html.erb +8 -8
- data/app/views/trade/admin/trade_items/_retail_price.html.erb +3 -3
- data/app/views/trade/admin/trade_items/_show/_breadcrumb.html.erb +7 -0
- data/app/views/trade/admin/trade_items/_single_price.html.erb +10 -10
- data/app/{assets/javascripts/controllers/trade/admin/cart_items → views/trade/admin/trade_items}/create.js +0 -0
- data/app/views/trade/admin/trade_items/index.html.erb +31 -42
- data/app/{assets/javascripts/controllers/trade/admin/cart_items → views/trade/admin/trade_items}/index.js +0 -0
- data/app/views/trade/admin/trade_items/only.html.erb +2 -2
- data/app/{assets/javascripts/controllers/trade/admin/cart_items → views/trade/admin/trade_items}/only.js +0 -0
- data/app/views/trade/admin/trade_items/show.html.erb +0 -0
- data/app/views/trade/admin/trade_promotes/_edit_form.html.erb +4 -0
- data/app/views/trade/admin/trade_promotes/{_filter.html.erb → _filter_form.html.erb} +2 -2
- data/app/views/trade/admin/trade_promotes/_form.html.erb +3 -6
- data/app/views/trade/admin/trade_promotes/_index_tbody.html.erb +2 -0
- data/app/views/trade/admin/trade_promotes/_index_thead.html.erb +3 -0
- data/app/views/trade/admin/trade_promotes/_new_form.html.erb +4 -0
- data/app/views/trade/admin/trade_promotes/_show_table.html.erb +8 -20
- data/app/views/trade/admin/trade_promotes/index.html.erb +3 -36
- data/app/views/trade/admin/{buyers → users}/index.html.erb +4 -4
- data/app/views/trade/admin/{buyers → users}/orders.html.erb +6 -6
- data/app/views/trade/admin/{buyers → users}/overdue.html.erb +2 -2
- data/app/views/trade/advances/index.html.erb +15 -0
- data/app/views/trade/card_templates/_card_template.json.jbuilder +9 -0
- data/app/views/trade/card_templates/_filter_form.html.erb +8 -0
- data/app/views/trade/card_templates/_show_table.html.erb +16 -0
- data/app/views/trade/card_templates/index.html.erb +16 -0
- data/app/views/trade/card_templates/index.json.jbuilder +1 -0
- data/app/views/trade/card_templates/show.json.jbuilder +1 -0
- data/app/views/trade/goods/_search.html.erb +3 -3
- data/app/views/trade/goods/taxon/_breadcrumb.html.erb +2 -2
- data/app/views/trade/my/advances/index.json.jbuilder +11 -0
- data/app/views/trade/my/advances/order.json.jbuilder +14 -0
- data/app/views/trade/my/card_logs/_wallet_log.json.jbuilder +1 -0
- data/app/views/trade/my/card_logs/index.html.erb +15 -0
- data/app/views/trade/my/card_logs/index.json.jbuilder +5 -0
- data/app/views/trade/my/cards/index.html.erb +45 -0
- data/app/views/trade/my/cards/new.html.erb +0 -0
- data/app/views/trade/my/cards/token.html.erb +11 -0
- data/app/views/trade/my/{trade_items → carts}/_additions.html.erb +0 -2
- data/app/views/trade/my/carts/_addresses/_index_table.html.erb +14 -0
- data/app/views/trade/my/carts/_addresses/_index_tbody.html.erb +5 -0
- data/app/views/trade/my/carts/_addresses/_index_tr.html.erb +13 -0
- data/app/views/trade/my/carts/_filter_form.html.erb +9 -0
- data/app/views/trade/my/carts/_form.html.erb +1 -1
- data/app/views/trade/my/carts/_show/_address.html.erb +18 -0
- data/app/views/trade/my/carts/_show/_tab_bar.html.erb +22 -0
- data/app/views/trade/my/carts/_show_table.html.erb +16 -28
- data/app/views/trade/my/carts/_show_thead.html.erb +6 -0
- data/app/views/trade/my/carts/_total_price.html.erb +44 -0
- data/app/views/trade/my/carts/_trade_item.html.erb +52 -0
- data/app/views/trade/my/carts/add.html.erb +23 -0
- data/app/views/trade/my/carts/add.turbo_stream.erb +3 -0
- data/app/views/trade/my/carts/addresses.html.erb +5 -0
- data/app/views/trade/my/carts/destroy.turbo_stream.erb +3 -0
- data/app/views/trade/my/carts/show.html+phone.erb +45 -25
- data/app/views/trade/my/carts/show.html.erb +25 -0
- data/app/views/trade/my/carts/update.turbo_stream.erb +9 -0
- data/app/views/trade/my/cash_logs/_cash_log.json.jbuilder +1 -0
- data/app/views/trade/my/cash_logs/index.json.jbuilder +4 -0
- data/app/views/trade/my/orders/_date_form.html.erb +2 -2
- data/app/views/trade/my/orders/_edit_form.html.erb +4 -0
- data/app/views/trade/my/orders/_edit_payment_type.html.erb +3 -12
- data/app/views/trade/my/orders/_form.html.erb +1 -4
- data/app/views/trade/my/orders/_payment_types/_show_table.html.erb +35 -0
- data/app/views/trade/my/orders/_show/_breadcrumb.html.erb +6 -0
- data/app/views/trade/my/orders/_success.html.erb +9 -0
- data/app/views/trade/my/orders/alipay_pay.json.jbuilder +1 -0
- data/app/views/trade/my/orders/create.turbo_stream.erb +3 -0
- data/app/views/trade/my/orders/edit_payment_type.html.erb +3 -0
- data/app/views/trade/my/orders/index.html+phone.erb +14 -11
- data/app/views/trade/my/orders/index.html.erb +15 -15
- data/app/views/trade/my/orders/new.html.erb +25 -36
- data/app/views/trade/my/orders/payment_types.html+phone.erb +51 -0
- data/app/views/trade/my/orders/payment_types.html.erb +5 -0
- data/app/views/trade/my/orders/refresh.turbo_stream.erb +3 -0
- data/app/views/trade/my/orders/show.html+phone.erb +2 -2
- data/app/views/trade/my/orders/show.html.erb +54 -97
- data/app/views/trade/my/orders/success.html.erb +2 -9
- data/app/views/trade/my/orders/wxpay_pay.html.erb +13 -0
- data/app/views/trade/my/orders/wxpay_pay_err.html.erb +5 -0
- data/app/views/trade/my/orders/wxpay_pc_pay.html.erb +24 -0
- data/app/views/trade/my/payment_methods/_button.html.erb +3 -0
- data/app/views/trade/my/payment_methods/_edit_form.html.erb +4 -0
- data/app/views/trade/my/payment_methods/{_item.html.erb → _index_tbody.html.erb} +3 -4
- data/app/views/trade/my/payment_methods/_index_thead.html.erb +4 -0
- data/app/views/trade/my/payment_methods/_new_form.html.erb +4 -0
- data/app/views/trade/my/payment_methods/index.html.erb +5 -1
- data/app/views/trade/my/payments/_edit_form.html.erb +4 -0
- data/app/views/trade/my/payments/_filter_form.html.erb +9 -0
- data/app/views/trade/my/payments/_form.html.erb +2 -0
- data/app/views/trade/my/payments/_index_tbody.html.erb +1 -0
- data/app/views/trade/my/payments/_index_thead.html.erb +2 -0
- data/app/views/trade/my/payments/_new_form.html.erb +4 -0
- data/app/views/trade/my/payments/_show_table.html.erb +4 -0
- data/app/views/trade/my/payments/create.turbo_stream.erb +3 -0
- data/app/views/trade/my/payments/destroy.turbo_stream.erb +3 -0
- data/app/views/trade/my/payments/index.html.erb +5 -0
- data/app/views/trade/my/payouts/_payout.json.jbuilder +11 -0
- data/app/views/trade/my/payouts/index.json.jbuilder +3 -0
- data/app/views/trade/my/payouts/list.json.jbuilder +2 -0
- data/app/views/trade/my/payouts/show.json.jbuilder +1 -0
- data/app/views/trade/my/shared/_cash.json.jbuilder +6 -0
- data/app/views/trade/my/trade_items/_show/_breadcrumb.html.erb +7 -0
- data/app/views/trade/my/trade_items/promote.html.erb +12 -0
- data/app/views/trade/my/trade_items/show.html.erb +0 -0
- data/app/views/trade/my/trade_items/toggle.turbo_stream.erb +3 -0
- data/app/views/trade/panel/exchange_rates/_edit_form.html.erb +4 -0
- data/app/views/trade/panel/exchange_rates/_filter_form.html.erb +9 -0
- data/app/views/trade/panel/exchange_rates/_form.html.erb +4 -0
- data/app/views/trade/panel/exchange_rates/_index_tbody.html.erb +3 -0
- data/app/views/trade/panel/exchange_rates/_index_thead.html.erb +4 -0
- data/app/views/trade/panel/exchange_rates/_new_form.html.erb +4 -0
- data/app/views/trade/panel/exchange_rates/_show_table.html.erb +12 -0
- data/app/views/trade/panel/exchange_rates/index.html.erb +5 -0
- data/config/locales/en.attributes.yml +35 -0
- data/config/locales/en.controller.yml +73 -0
- data/config/locales/en.yml +28 -44
- data/config/locales/zh.attributes.yml +78 -16
- data/config/locales/zh.controller.yml +53 -1
- data/config/locales/zh.enum.yml +44 -18
- data/config/locales/zh.help.yml +7 -7
- data/config/locales/zh.yml +24 -0
- data/config/routes.rb +164 -89
- data/lib/rails_trade/config.rb +0 -2
- data/lib/rails_trade/engine.rb +2 -1
- data/lib/rails_trade.rb +2 -10
- metadata +465 -322
- data/app/assets/javascripts/controllers/trade/admin/payment_methods/edit.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/payment_methods/new.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/payments/edit.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/payments/new.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/promote_charges/edit.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/promote_charges/new.js +0 -7
- data/app/assets/javascripts/controllers/trade/admin/promote_goods/edit.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/promote_goods/new.js +0 -17
- data/app/assets/javascripts/controllers/trade/admin/promotes/edit.js +0 -2
- data/app/assets/javascripts/controllers/trade/admin/promotes/new.js +0 -5
- data/app/assets/javascripts/controllers/trade/admin/refunds/index.js +0 -1
- data/app/assets/javascripts/controllers/trade/admin/refunds/new.js +0 -1
- data/app/assets/javascripts/controllers/trade/my/carts/show-phone-ready.js +0 -1
- data/app/assets/javascripts/controllers/trade/my/carts/show-ready.js +0 -28
- data/app/assets/javascripts/controllers/trade/my/orders/wait-phone.js +0 -8
- data/app/assets/javascripts/controllers/trade/my/trade_items/create.js +0 -2
- data/app/assets/stylesheets/controllers/trade/admin/promote_charges/index.css +0 -4
- data/app/assets/stylesheets/controllers/trade/admin/promotes/index.css +0 -4
- data/app/assets/stylesheets/controllers/trade/my/carts/show-phone.css +0 -1
- data/app/assets/stylesheets/controllers/trade/payments/wxpay_result.css +0 -57
- data/app/channels/paid_channel.rb +0 -7
- data/app/controllers/concerns/controller_order_types.rb +0 -89
- data/app/controllers/rails_trade/my_cart.rb +0 -16
- data/app/controllers/trade/admin/buyers_controller.rb +0 -37
- data/app/controllers/trade/admin/cart_serves_controller.rb +0 -66
- data/app/controllers/trade/admin/goods_controller.rb +0 -96
- data/app/controllers/trade/admin/produces_controller.rb +0 -66
- data/app/controllers/trade/admin/promote_buyers_controller.rb +0 -57
- data/app/controllers/trade/buyers_controller.rb +0 -8
- data/app/controllers/trade/my/order_items_controller.rb +0 -49
- data/app/models/cart.rb +0 -4
- data/app/models/order.rb +0 -4
- data/app/models/payment/alipay_payment.rb +0 -3
- data/app/models/payment/apple_payment.rb +0 -3
- data/app/models/payment/bank_payment.rb +0 -3
- data/app/models/payment/hand_payment.rb +0 -3
- data/app/models/payment/paypal_payment.rb +0 -3
- data/app/models/payment/stripe_payment.rb +0 -3
- data/app/models/payment/wxpay_payment.rb +0 -3
- data/app/models/payment.rb +0 -4
- data/app/models/payment_method/alipay_method.rb +0 -7
- data/app/models/payment_method/bank_method.rb +0 -7
- data/app/models/payment_method/stripe_method.rb +0 -3
- data/app/models/payment_method.rb +0 -3
- data/app/models/payment_order.rb +0 -3
- data/app/models/payment_reference.rb +0 -3
- data/app/models/payment_strategy.rb +0 -3
- data/app/models/payment_type.rb +0 -3
- data/app/models/promote.rb +0 -3
- data/app/models/promote_buyer.rb +0 -3
- data/app/models/promote_charge/cash_promote_charge.rb +0 -3
- data/app/models/promote_charge/discount_promote_charge.rb +0 -3
- data/app/models/promote_charge/final_promote_charge.rb +0 -3
- data/app/models/promote_charge/minus_promote_charge.rb +0 -3
- data/app/models/promote_charge/plus_promote_charge.rb +0 -3
- data/app/models/promote_charge.rb +0 -3
- data/app/models/promote_extra.rb +0 -3
- data/app/models/promote_good.rb +0 -3
- data/app/models/rails_trade/amount.rb +0 -44
- data/app/models/rails_trade/buyer.rb +0 -35
- data/app/models/rails_trade/cart.rb +0 -64
- data/app/models/rails_trade/good.rb +0 -71
- data/app/models/rails_trade/order.rb +0 -98
- data/app/models/rails_trade/ordering/payment.rb +0 -113
- data/app/models/rails_trade/ordering/refund.rb +0 -34
- data/app/models/rails_trade/payment/alipay_payment.rb +0 -15
- data/app/models/rails_trade/payment/apple_payment.rb +0 -7
- data/app/models/rails_trade/payment/bank_payment.rb +0 -13
- data/app/models/rails_trade/payment/hand_payment.rb +0 -8
- data/app/models/rails_trade/payment/paypal_payment.rb +0 -8
- data/app/models/rails_trade/payment/stripe_payment.rb +0 -9
- data/app/models/rails_trade/payment/wxpay_payment.rb +0 -13
- data/app/models/rails_trade/payment.rb +0 -134
- data/app/models/rails_trade/payment_method/stripe_method.rb +0 -60
- data/app/models/rails_trade/payment_method.rb +0 -67
- data/app/models/rails_trade/payment_order.rb +0 -108
- data/app/models/rails_trade/payment_reference.rb +0 -18
- data/app/models/rails_trade/payment_strategy.rb +0 -19
- data/app/models/rails_trade/payment_type/alipay.rb +0 -28
- data/app/models/rails_trade/payment_type/apple_pay.rb +0 -18
- data/app/models/rails_trade/payment_type/paypal.rb +0 -82
- data/app/models/rails_trade/payment_type/stripe.rb +0 -55
- data/app/models/rails_trade/payment_type/wxpay.rb +0 -55
- data/app/models/rails_trade/promote.rb +0 -78
- data/app/models/rails_trade/promote_buyer.rb +0 -27
- data/app/models/rails_trade/promote_charge/cash_promote_charge.rb +0 -12
- data/app/models/rails_trade/promote_charge/discount_promote_charge.rb +0 -17
- data/app/models/rails_trade/promote_charge/final_promote_charge.rb +0 -12
- data/app/models/rails_trade/promote_charge/minus_promote_charge.rb +0 -11
- data/app/models/rails_trade/promote_charge/plus_promote_charge.rb +0 -7
- data/app/models/rails_trade/promote_charge.rb +0 -84
- data/app/models/rails_trade/promote_extra.rb +0 -13
- data/app/models/rails_trade/promote_good.rb +0 -22
- data/app/models/rails_trade/refund/alipay_refund.rb +0 -33
- data/app/models/rails_trade/refund/bank_refund.rb +0 -5
- data/app/models/rails_trade/refund/hand_refund.rb +0 -5
- data/app/models/rails_trade/refund/paypal_refund.rb +0 -32
- data/app/models/rails_trade/refund/stripe_refund.rb +0 -26
- data/app/models/rails_trade/refund/wxpay_refund.rb +0 -48
- data/app/models/rails_trade/refund.rb +0 -74
- data/app/models/rails_trade/sell.rb +0 -24
- data/app/models/rails_trade/trade_item.rb +0 -153
- data/app/models/rails_trade/trade_promote.rb +0 -92
- data/app/models/rails_trade/user.rb +0 -9
- data/app/models/refund/alipay_refund.rb +0 -3
- data/app/models/refund/bank_refund.rb +0 -3
- data/app/models/refund/hand_refund.rb +0 -3
- data/app/models/refund/paypal_refund.rb +0 -3
- data/app/models/refund/stripe_refund.rb +0 -3
- data/app/models/refund/wxpay_refund.rb +0 -3
- data/app/models/refund.rb +0 -3
- data/app/models/trade_item.rb +0 -3
- data/app/models/trade_promote.rb +0 -3
- data/app/views/application/_trade_nav.html.erb +0 -16
- data/app/views/trade/admin/buyers/_form.html.erb +0 -17
- data/app/views/trade/admin/buyers/_menu.html.erb +0 -5
- data/app/views/trade/admin/buyers/_search_form.html.erb +0 -11
- data/app/views/trade/admin/buyers/edit.html.erb +0 -6
- data/app/views/trade/admin/buyers/new.html.erb +0 -5
- data/app/views/trade/admin/buyers/show.html.erb +0 -4
- data/app/views/trade/admin/cart_item_serves/add.js.erb +0 -47
- data/app/views/trade/admin/cart_item_serves/create.js.erb +0 -3
- data/app/views/trade/admin/cart_item_serves/destroy.js.erb +0 -50
- data/app/views/trade/admin/cart_item_serves/index.js.erb +0 -50
- data/app/views/trade/admin/cart_item_serves/new.js.erb +0 -5
- data/app/views/trade/admin/cart_item_serves/single.js.erb +0 -55
- data/app/views/trade/admin/cart_item_serves/total.js.erb +0 -55
- data/app/views/trade/admin/order_payments/_index.html.erb +0 -44
- data/app/views/trade/admin/order_payments/_new.html.erb +0 -44
- data/app/views/trade/admin/order_payments/create.js.erb +0 -2
- data/app/views/trade/admin/order_payments/destroy.js.erb +0 -2
- data/app/views/trade/admin/order_payments/index.js.erb +0 -8
- data/app/views/trade/admin/order_payments/new.js.erb +0 -8
- data/app/views/trade/admin/orders/_filter.html.erb +0 -26
- data/app/views/trade/admin/orders/_form.html.erb +0 -4
- data/app/views/trade/admin/orders/refresh.js.erb +0 -7
- data/app/views/trade/admin/payment_methods/_edit.html.erb +0 -6
- data/app/views/trade/admin/payment_methods/_filter.html.erb +0 -18
- data/app/views/trade/admin/payment_methods/_index_layout.html.erb +0 -12
- data/app/views/trade/admin/payment_methods/_new.html.erb +0 -13
- data/app/views/trade/admin/payment_methods/_payment_method.html.erb +0 -24
- data/app/views/trade/admin/payment_methods/create.js.erb +0 -2
- data/app/views/trade/admin/payment_methods/destroy.js.erb +0 -1
- data/app/views/trade/admin/payment_methods/edit.html.erb +0 -15
- data/app/views/trade/admin/payment_methods/edit.js.erb +0 -8
- data/app/views/trade/admin/payment_methods/new.html.erb +0 -15
- data/app/views/trade/admin/payment_methods/new.js.erb +0 -7
- data/app/views/trade/admin/payment_methods/update.js.erb +0 -2
- data/app/views/trade/admin/payment_orders/new.js.erb +0 -6
- data/app/views/trade/admin/payment_strategies/edit.html.erb +0 -13
- data/app/views/trade/admin/payment_strategies/new.html.erb +0 -13
- data/app/views/trade/admin/payments/_edit.html.erb +0 -12
- data/app/views/trade/admin/payments/_filter.html.erb +0 -40
- data/app/views/trade/admin/payments/_item.html.erb +0 -41
- data/app/views/trade/admin/payments/_new.html.erb +0 -12
- data/app/views/trade/admin/payments/edit.html.erb +0 -13
- data/app/views/trade/admin/payments/edit.js.erb +0 -3
- data/app/views/trade/admin/payments/new.html.erb +0 -13
- data/app/views/trade/admin/payments/new.js.erb +0 -3
- data/app/views/trade/admin/payments/show.html.erb +0 -4
- data/app/views/trade/admin/promote_buyers/_filter.html.erb +0 -7
- data/app/views/trade/admin/promote_buyers/_form.html.erb +0 -17
- data/app/views/trade/admin/promote_buyers/edit.html.erb +0 -14
- data/app/views/trade/admin/promote_buyers/edit.js.erb +0 -3
- data/app/views/trade/admin/promote_buyers/index.html.erb +0 -52
- data/app/views/trade/admin/promote_buyers/new.html.erb +0 -13
- data/app/views/trade/admin/promote_buyers/new.js.erb +0 -3
- data/app/views/trade/admin/promote_buyers/show.json.jbuilder +0 -1
- data/app/views/trade/admin/promote_charges/_edit.html.erb +0 -13
- data/app/views/trade/admin/promote_charges/_filter.html.erb +0 -11
- data/app/views/trade/admin/promote_charges/_new.html.erb +0 -13
- data/app/views/trade/admin/promote_goods/_filter.html.erb +0 -8
- data/app/views/trade/admin/promotes/_edit.html.erb +0 -12
- data/app/views/trade/admin/promotes/_filter.html.erb +0 -9
- data/app/views/trade/admin/promotes/_new.html.erb +0 -12
- data/app/views/trade/admin/promotes/create.js.erb +0 -2
- data/app/views/trade/admin/refunds/_filter.html.erb +0 -11
- data/app/views/trade/admin/refunds/_form.html.erb +0 -17
- data/app/views/trade/admin/refunds/_logs_table.html.erb +0 -33
- data/app/views/trade/admin/refunds/edit.html.erb +0 -6
- data/app/views/trade/admin/refunds/logs.js.erb +0 -8
- data/app/views/trade/admin/refunds/new.html.erb +0 -5
- data/app/views/trade/admin/refunds/new.js.erb +0 -8
- data/app/views/trade/admin/refunds/show.html.erb +0 -4
- data/app/views/trade/admin/trade_items/destroy.js.erb +0 -1
- data/app/views/trade/admin/trade_items/update.js.erb +0 -11
- data/app/views/trade/admin/trade_promotes/edit.html.erb +0 -9
- data/app/views/trade/admin/trade_promotes/edit.js.erb +0 -3
- data/app/views/trade/admin/trade_promotes/new.html.erb +0 -9
- data/app/views/trade/admin/trade_promotes/new.js.erb +0 -3
- data/app/views/trade/admin/trade_promotes/show.html.erb +0 -7
- data/app/views/trade/admin/trade_promotes/show.js.erb +0 -3
- data/app/views/trade/admin/trade_promotes/update.js.erb +0 -1
- data/app/views/trade/buyers/_show.html.erb +0 -7
- data/app/views/trade/buyers/show.js.erb +0 -1
- data/app/views/trade/my/carts/_filter.html.erb +0 -7
- data/app/views/trade/my/carts/edit.html.erb +0 -9
- data/app/views/trade/my/carts/edit.js.erb +0 -3
- data/app/views/trade/my/carts/index.html.erb +0 -47
- data/app/views/trade/my/carts/new.html.erb +0 -9
- data/app/views/trade/my/carts/new.js.erb +0 -3
- data/app/views/trade/my/order_items/_form.html.erb +0 -17
- data/app/views/trade/my/order_items/edit.html.erb +0 -6
- data/app/views/trade/my/order_items/index.html.erb +0 -25
- data/app/views/trade/my/order_items/new.html.erb +0 -5
- data/app/views/trade/my/order_items/show.html.erb +0 -8
- data/app/views/trade/my/orders/_edit.html.erb +0 -10
- data/app/views/trade/my/orders/destroy.js.erb +0 -1
- data/app/views/trade/my/orders/edit.js.erb +0 -4
- data/app/views/trade/my/orders/edit_payment_type.js.erb +0 -4
- data/app/views/trade/my/orders/refresh.js.erb +0 -7
- data/app/views/trade/my/orders/update.js.erb +0 -3
- data/app/views/trade/my/orders/wxpay_pay.js.erb +0 -16
- data/app/views/trade/my/orders/wxpay_pay_err.js.erb +0 -5
- data/app/views/trade/my/payment_methods/_edit.html.erb +0 -13
- data/app/views/trade/my/payment_methods/_index.html.erb +0 -25
- data/app/views/trade/my/payment_methods/_new.html.erb +0 -13
- data/app/views/trade/my/payment_methods/create.js.erb +0 -3
- data/app/views/trade/my/payment_methods/destroy.js.erb +0 -1
- data/app/views/trade/my/payment_methods/edit.js.erb +0 -8
- data/app/views/trade/my/payment_methods/index.js.erb +0 -1
- data/app/views/trade/my/payment_methods/new.js.erb +0 -8
- data/app/views/trade/my/payment_methods/show.html.erb +0 -4
- data/app/views/trade/my/payment_methods/update.js.erb +0 -2
- data/app/views/trade/my/trade_items/_cart_item.js.erb +0 -2
- data/app/views/trade/my/trade_items/_single_price.html.erb +0 -6
- data/app/views/trade/my/trade_items/_total_price.html.erb +0 -8
- data/app/views/trade/my/trade_items/_trade_items.html.erb +0 -68
- data/app/views/trade/my/trade_items/create.html.erb +0 -1
- data/app/views/trade/my/trade_items/destroy.js.erb +0 -1
- data/app/views/trade/my/trade_items/update.js.erb +0 -1
- data/app/views/trade/my/users/_form.html.erb +0 -17
- data/app/views/trade/my/users/edit.html.erb +0 -44
- data/app/views/trade/my/users/show.html.erb +0 -18
- data/lib/rails_trade/apple_pay.rb +0 -32
- data/lib/rails_trade/version.rb +0 -3
@@ -0,0 +1,67 @@
|
|
1
|
+
module Trade
|
2
|
+
class Admin::PayoutsController < Admin::BaseController
|
3
|
+
before_action :set_payout, only: [:show, :edit, :update, :do_pay, :destroy]
|
4
|
+
|
5
|
+
def index
|
6
|
+
q_params = {}
|
7
|
+
q_params.merge! params.permit(:id, :cash_id, :payout_uuid)
|
8
|
+
|
9
|
+
@payouts = Payout.default_where(q_params).page(params[:page])
|
10
|
+
end
|
11
|
+
|
12
|
+
def new
|
13
|
+
@payout = Payout.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@payout = Payout.new(payout_params)
|
18
|
+
|
19
|
+
if @payout.save
|
20
|
+
render 'create'
|
21
|
+
else
|
22
|
+
render :new, locals: { model: @payout }, status: :unprocessable_entity
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def show
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
@payout.assign_attributes(payout_params)
|
34
|
+
|
35
|
+
unless @payout.save
|
36
|
+
render :edit, locals: { model: @payout }, status: :unprocessable_entity
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def do_pay
|
41
|
+
@payout.do_pay
|
42
|
+
end
|
43
|
+
|
44
|
+
def destroy
|
45
|
+
@payout.destroy
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
def set_payout
|
50
|
+
@payout = Payout.find(params[:id])
|
51
|
+
end
|
52
|
+
|
53
|
+
def payout_params
|
54
|
+
p = params.fetch(:payout, {}).permit(
|
55
|
+
:actual_amount,
|
56
|
+
:payout_uuid,
|
57
|
+
:to_bank,
|
58
|
+
:to_name,
|
59
|
+
:to_identifier,
|
60
|
+
:proof
|
61
|
+
)
|
62
|
+
p.merge! operator_id: current_member.id
|
63
|
+
p
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Trade
|
2
|
+
class Admin::PromoteCartsController < Admin::BaseController
|
3
|
+
before_action :set_promote_cart, only: [:show, :destroy]
|
4
|
+
|
5
|
+
def index
|
6
|
+
q_params = {}
|
7
|
+
q_params.merge! params.permit(:promote_id, :user_id, :member_id)
|
8
|
+
|
9
|
+
@promote_carts = PromoteCart.includes(:buyer, :promote).default_where(q_params).page(params[:page])
|
10
|
+
if params[:promote_good_id]
|
11
|
+
@promote_good = PromoteGood.find params[:promote_good_id]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def show
|
16
|
+
end
|
17
|
+
|
18
|
+
def new
|
19
|
+
@promote_cart = PromoteCart.new(
|
20
|
+
promote_id: params[:promote_id],
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
@promote_cart = PromoteCart.new(promote_cart_params)
|
26
|
+
|
27
|
+
if @promote_cart.save
|
28
|
+
render 'create'
|
29
|
+
else
|
30
|
+
render :new, locals: { model: @promote_cart }, status: :unprocessable_entity
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def destroy
|
35
|
+
@promote_cart.destroy
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
def set_promote_cart
|
40
|
+
@promote_cart = PromoteCart.find(params[:id])
|
41
|
+
end
|
42
|
+
|
43
|
+
def promote_cart_params
|
44
|
+
params.fetch(:promote_cart, {}).permit(
|
45
|
+
:cart_id,
|
46
|
+
:promote_good_id,
|
47
|
+
:status,
|
48
|
+
:effect_at,
|
49
|
+
:expire_at
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
@@ -1,67 +1,69 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
def index
|
6
|
-
q_params = {}
|
7
|
-
q_params.merge! params.permit(PromoteCharge.extra_columns)
|
8
|
-
q_params.merge! 'filter_min-lte': params[:value], 'filter_max-gte': params[:value]
|
9
|
-
|
10
|
-
@promote_charges = @promote.promote_charges.default_where(q_params).order(min: :asc).page(params[:page]).per(params[:per])
|
11
|
-
end
|
12
|
-
|
13
|
-
def options
|
14
|
-
|
15
|
-
end
|
1
|
+
module Trade
|
2
|
+
class Admin::PromoteChargesController < Admin::BaseController
|
3
|
+
before_action :set_promote, except: [:options]
|
4
|
+
before_action :set_charge, only: [:edit, :update, :destroy]
|
16
5
|
|
17
|
-
|
18
|
-
|
19
|
-
|
6
|
+
def index
|
7
|
+
q_params = {}
|
8
|
+
q_params.merge! params.permit(PromoteCharge.extra_columns)
|
9
|
+
q_params.merge! 'filter_min-lte': params[:value], 'filter_max-gte': params[:value]
|
20
10
|
|
21
|
-
|
22
|
-
@promote_charge = @promote.promote_charges.build(promote_charge_params)
|
23
|
-
|
24
|
-
if @promote_charge.save
|
25
|
-
render :new, locals: { model: @promote_charge }, status: :unprocessable_entity
|
11
|
+
@promote_charges = @promote.promote_charges.default_where(q_params).order(min: :asc).page(params[:page]).per(params[:per])
|
26
12
|
end
|
27
|
-
end
|
28
13
|
|
29
|
-
|
14
|
+
def options
|
30
15
|
|
31
|
-
|
16
|
+
end
|
32
17
|
|
33
|
-
|
34
|
-
|
18
|
+
def new
|
19
|
+
@promote_charge = @promote.promote_charges.build
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
@promote_charge = @promote.promote_charges.build(promote_charge_params)
|
35
24
|
|
36
|
-
|
37
|
-
|
25
|
+
unless @promote_charge.save
|
26
|
+
render :new, locals: { model: @promote_charge }, status: :unprocessable_entity
|
27
|
+
end
|
38
28
|
end
|
39
|
-
end
|
40
29
|
|
41
|
-
|
42
|
-
@promote_charge.destroy
|
43
|
-
end
|
30
|
+
def edit
|
44
31
|
|
45
|
-
|
46
|
-
def promote_charge_params
|
47
|
-
params.fetch(:promote_charge, {}).permit(
|
48
|
-
:min,
|
49
|
-
:max,
|
50
|
-
:type,
|
51
|
-
:unit,
|
52
|
-
:parameter,
|
53
|
-
:contain_min,
|
54
|
-
:contain_max,
|
55
|
-
*PromoteCharge.extra_columns
|
56
|
-
)
|
57
|
-
end
|
32
|
+
end
|
58
33
|
|
59
|
-
|
60
|
-
|
61
|
-
end
|
34
|
+
def update
|
35
|
+
@promote_charge.assign_attributes(promote_charge_params)
|
62
36
|
|
63
|
-
|
64
|
-
|
65
|
-
|
37
|
+
unless @promote_charge.save
|
38
|
+
render :edit, locals: { model: @promote_charge }, status: :unprocessable_entity
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def destroy
|
43
|
+
@promote_charge.destroy
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
def promote_charge_params
|
48
|
+
params.fetch(:promote_charge, {}).permit(
|
49
|
+
:min,
|
50
|
+
:max,
|
51
|
+
:type,
|
52
|
+
:unit,
|
53
|
+
:parameter,
|
54
|
+
:contain_min,
|
55
|
+
:contain_max,
|
56
|
+
*PromoteCharge.extra_columns
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
def set_promote
|
61
|
+
@promote = Promote.find params[:promote_id]
|
62
|
+
end
|
66
63
|
|
64
|
+
def set_charge
|
65
|
+
@promote_charge = @promote.promote_charges.find params[:id]
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
67
69
|
end
|
@@ -1,63 +1,68 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Trade
|
2
|
+
class Admin::PromoteGoodsController < Admin::BaseController
|
3
|
+
before_action :set_promote_good, only: [:show, :edit, :update, :destroy]
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
def index
|
6
|
+
q_params = {}
|
7
|
+
q_params.merge! params.permit(:promote_id, :good_type, :good_id)
|
8
|
+
|
9
|
+
@promote_goods = PromoteGood.default_where(q_params).page(params[:page])
|
10
|
+
if params[:promote_id]
|
11
|
+
@promote = Promote.find params[:promote_id]
|
12
|
+
end
|
10
13
|
end
|
11
|
-
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
def goods
|
16
|
+
# todo support search
|
17
|
+
@goods = params[:good_type].constantize.default_where(default_params).order(id: :desc)
|
18
|
+
@promote_good = PromoteGood.new
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
+
def show
|
22
|
+
end
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
def new
|
25
|
+
@promote_good = PromoteGood.new(params.permit(:promote_id, :good_type, :good_id))
|
26
|
+
end
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
+
def edit
|
29
|
+
end
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
+
def create
|
32
|
+
@promote_good = PromoteGood.new(promote_good_params)
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
+
unless @promote_good.save
|
35
|
+
render :new, locals: { model: @promote_good }, status: :unprocessable_entity
|
36
|
+
end
|
34
37
|
end
|
35
|
-
end
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
+
def update
|
40
|
+
@promote_good.assign_attributes(promote_good_params)
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
+
unless @promote_good.save
|
43
|
+
render :edit, locals: { model: @promote_good }, status: :unprocessable_entity
|
44
|
+
end
|
42
45
|
end
|
43
|
-
end
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
47
|
+
def destroy
|
48
|
+
@promote_good.destroy
|
49
|
+
end
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
private
|
52
|
+
def set_promote_good
|
53
|
+
@promote_good = PromoteGood.find(params[:id])
|
54
|
+
end
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
def promote_good_params
|
57
|
+
params.fetch(:promote_good, {}).permit(
|
58
|
+
:promote_id,
|
59
|
+
:good_type,
|
60
|
+
:good_id,
|
61
|
+
:effect_at,
|
62
|
+
:expire_at,
|
63
|
+
:status
|
64
|
+
)
|
65
|
+
end
|
62
66
|
|
67
|
+
end
|
63
68
|
end
|
@@ -1,69 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
def index
|
5
|
-
q_params = {}
|
6
|
-
q_params.merge! default_params
|
7
|
-
q_params.merge! params.permit(:scope)
|
8
|
-
|
9
|
-
@promotes = Promote.default_where(q_params).order(id: :desc).page(params[:page])
|
10
|
-
end
|
11
|
-
|
12
|
-
def search
|
13
|
-
@promotes = Promote.default_where('name-like': params[:q])
|
14
|
-
render json: { results: @promotes.as_json(only: [:id, :name]) }
|
15
|
-
end
|
16
|
-
|
17
|
-
def new
|
18
|
-
@promote = Promote.new
|
19
|
-
end
|
20
|
-
|
21
|
-
def create
|
22
|
-
@promote = Promote.new(promote_params)
|
23
|
-
|
24
|
-
if @promote.save
|
25
|
-
@promote_charge = @promote.promote_charges.build
|
26
|
-
else
|
27
|
-
render :new, locals: { model: @promote }, status: :unprocessable_entity
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def show
|
32
|
-
end
|
33
|
-
|
34
|
-
def edit
|
35
|
-
end
|
36
|
-
|
37
|
-
def update
|
38
|
-
@promote.assign_attributes promote_params
|
39
|
-
|
40
|
-
unless @promote.save
|
41
|
-
render :edit, locals: { model: @promote }, status: :unprocessable_entity
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def destroy
|
46
|
-
@promote.destroy
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
def set_promote
|
51
|
-
@promote = Promote.find(params[:id])
|
52
|
-
end
|
53
|
-
|
54
|
-
def promote_params
|
55
|
-
p = params.fetch(:promote, {}).permit(
|
56
|
-
:name,
|
57
|
-
:code,
|
58
|
-
:short_name,
|
59
|
-
:description,
|
60
|
-
:scope,
|
61
|
-
:metering,
|
62
|
-
:effect_at,
|
63
|
-
:expire_at,
|
64
|
-
:editable,
|
65
|
-
extra: []
|
66
|
-
)
|
67
|
-
p.merge! default_form_params
|
1
|
+
module Trade
|
2
|
+
class Admin::PromotesController < Admin::BaseController
|
3
|
+
include Controller::Promote
|
68
4
|
end
|
69
5
|
end
|
@@ -1,57 +1,68 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Trade
|
2
|
+
class Admin::RefundsController < Admin::BaseController
|
3
|
+
before_action :set_refund, only: [:show, :edit, :update, :confirm, :deny, :destroy]
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
def index
|
6
|
+
q_params = {}
|
7
|
+
q_params.merge! default_params
|
8
|
+
q_params.merge! params.permit(:order_id, :payment_id)
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
@refunds = Refund.includes(:order, :payment).default_where(q_params).page(params[:page])
|
11
|
+
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
def new
|
14
|
+
@refund = @payment.refunds.build
|
15
|
+
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
+
def create
|
18
|
+
@refund = Refund.new(refund_params)
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
+
unless @refund.save
|
21
|
+
render :new, locals: { model: @refund }, status: :unprocessable_entity
|
22
|
+
end
|
23
|
+
end
|
20
24
|
|
21
|
-
|
22
|
-
|
25
|
+
def show
|
26
|
+
end
|
27
|
+
|
28
|
+
def edit
|
23
29
|
end
|
24
|
-
end
|
25
30
|
|
26
|
-
|
27
|
-
|
31
|
+
def update
|
32
|
+
@refund.assign_attributes(refund_params)
|
28
33
|
|
29
|
-
|
30
|
-
|
34
|
+
unless @refund.save
|
35
|
+
render :new, locals: { model: @refund }, status: :unprocessable_entity
|
36
|
+
end
|
31
37
|
end
|
32
|
-
end
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
def confirm
|
40
|
+
@refund.do_refund
|
41
|
+
@refund.operator = current_member
|
42
|
+
@refund.refunded_at = Time.current
|
38
43
|
|
39
|
-
|
40
|
-
|
41
|
-
redirect_to admin_refunds_url(order_id: @refund.order_id)
|
42
|
-
end
|
44
|
+
@refund.save
|
45
|
+
end
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
+
def deny
|
48
|
+
@refund.state = 'denied'
|
49
|
+
@refund.operator = current_member
|
47
50
|
|
48
|
-
|
49
|
-
|
50
|
-
@refund = Refund.find(params[:id])
|
51
|
-
end
|
51
|
+
@refund.save
|
52
|
+
end
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
def destroy
|
55
|
+
@refund.destroy
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
def set_refund
|
60
|
+
@refund = Refund.find(params[:id])
|
61
|
+
end
|
56
62
|
|
63
|
+
def refund_params
|
64
|
+
params.fetch(:refund, {})
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
57
68
|
end
|