rails_trade 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +37 -15
- data/Rakefile +9 -27
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/create.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/index.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/only.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/orders/new.js +0 -0
- data/app/assets/javascripts/controllers/trade/admin/payment_methods/edit.js +1 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/payment_methods/new.js +0 -0
- data/app/assets/javascripts/controllers/trade/admin/payments/edit.js +1 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/payments/new.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/promote_buyers/edit.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/promote_buyers/new.js +3 -1
- data/app/assets/javascripts/controllers/trade/admin/promote_charges/edit.js +1 -0
- data/app/assets/javascripts/controllers/trade/admin/promote_charges/new.js +7 -0
- data/app/assets/javascripts/controllers/trade/admin/promote_goods/edit.js +1 -0
- data/app/assets/javascripts/controllers/trade/admin/promote_goods/new.js +17 -0
- data/app/assets/javascripts/controllers/trade/admin/promotes/edit.js +2 -0
- data/app/assets/javascripts/controllers/trade/admin/promotes/new.js +5 -0
- data/app/assets/javascripts/controllers/trade/admin/refunds/index.js +1 -0
- data/app/assets/javascripts/controllers/trade/admin/refunds/new.js +1 -0
- data/app/assets/javascripts/controllers/trade/my/carts/show-phone-ready.js +1 -0
- data/app/assets/javascripts/controllers/trade/my/carts/show-ready.js +28 -0
- data/app/assets/javascripts/controllers/trade/my/orders/wait-phone.js +8 -0
- data/app/{views/goods/show.html.erb → assets/javascripts/controllers/trade/my/trade_items/create.js} +0 -0
- data/app/assets/stylesheets/controllers/trade/admin/promote_charges/index.css +4 -0
- data/app/assets/stylesheets/controllers/trade/admin/promotes/index.css +4 -0
- data/app/{views/rails_trade_admin/orders/edit.html.erb → assets/stylesheets/controllers/trade/my/carts/show-phone.css} +0 -0
- data/app/assets/stylesheets/controllers/trade/payments/wxpay_result.css +57 -0
- data/app/channels/paid_channel.rb +7 -0
- data/app/controllers/concerns/controller_order_types.rb +3 -6
- data/app/controllers/rails_trade/my_cart.rb +16 -0
- data/app/controllers/trade/admin/base_controller.rb +5 -0
- data/app/controllers/{the_trade_admin → trade/admin}/buyers_controller.rb +3 -3
- data/app/controllers/{the_trade_admin/cart_item_serves_controller.rb → trade/admin/cart_serves_controller.rb} +8 -5
- data/app/controllers/{goods_controller.rb → trade/admin/goods_controller.rb} +7 -1
- data/app/controllers/{the_trade_admin → trade/admin}/order_payments_controller.rb +6 -3
- data/app/controllers/{the_trade_admin → trade/admin}/orders_controller.rb +23 -16
- data/app/controllers/{the_trade_admin → trade/admin}/payment_methods_controller.rb +8 -5
- data/app/controllers/{the_trade_admin → trade/admin}/payment_orders_controller.rb +10 -12
- data/app/controllers/{the_trade_admin → trade/admin}/payment_references_controller.rb +3 -3
- data/app/controllers/{the_trade_admin → trade/admin}/payment_strategies_controller.rb +9 -5
- data/app/controllers/trade/admin/payments_controller.rb +97 -0
- data/app/controllers/{the_trade_admin → trade/admin}/produces_controller.rb +4 -4
- data/app/controllers/trade/admin/promote_buyers_controller.rb +57 -0
- data/app/controllers/trade/admin/promote_charges_controller.rb +67 -0
- data/app/controllers/trade/admin/promote_goods_controller.rb +63 -0
- data/app/controllers/trade/admin/promotes_controller.rb +69 -0
- data/app/controllers/{the_trade_admin → trade/admin}/refunds_controller.rb +9 -12
- data/app/controllers/{the_trade_admin/cart_items_controller.rb → trade/admin/trade_items_controller.rb} +26 -28
- data/app/controllers/trade/admin/trade_promotes_controller.rb +71 -0
- data/app/controllers/trade/buyers_controller.rb +8 -0
- data/app/controllers/trade/my/base_controller.rb +4 -0
- data/app/controllers/trade/my/carts_controller.rb +32 -0
- data/app/controllers/{the_trade_my → trade/my}/order_items_controller.rb +4 -4
- data/app/controllers/trade/my/orders_controller.rb +106 -0
- data/app/controllers/{the_trade_my → trade/my}/payment_methods_controller.rb +1 -1
- data/app/controllers/trade/my/trade_items_controller.rb +47 -0
- data/app/controllers/trade/payments_controller.rb +71 -0
- data/app/models/cart.rb +4 -0
- data/app/models/order.rb +4 -0
- data/app/models/payment.rb +4 -0
- data/app/models/payment/alipay_payment.rb +3 -0
- data/app/models/payment/apple_payment.rb +3 -0
- data/app/models/payment/bank_payment.rb +3 -0
- data/app/models/payment/hand_payment.rb +3 -0
- data/app/models/payment/paypal_payment.rb +3 -0
- data/app/models/payment/stripe_payment.rb +3 -0
- data/app/models/payment/wxpay_payment.rb +3 -0
- data/app/models/payment_method.rb +3 -0
- data/app/models/{rails_trade/payment_methods → payment_method}/alipay_method.rb +1 -1
- data/app/models/{rails_trade/payment_methods → payment_method}/bank_method.rb +1 -1
- data/app/models/payment_method/stripe_method.rb +3 -0
- data/app/models/payment_order.rb +3 -0
- data/app/models/payment_reference.rb +3 -0
- data/app/models/payment_strategy.rb +3 -0
- data/app/models/payment_type.rb +3 -0
- data/app/models/promote.rb +3 -0
- data/app/models/promote_buyer.rb +3 -0
- data/app/models/promote_charge.rb +3 -0
- data/app/models/promote_charge/cash_promote_charge.rb +3 -0
- data/app/models/promote_charge/discount_promote_charge.rb +3 -0
- data/app/models/promote_charge/final_promote_charge.rb +3 -0
- data/app/models/promote_charge/minus_promote_charge.rb +3 -0
- data/app/models/promote_charge/plus_promote_charge.rb +3 -0
- data/app/models/promote_extra.rb +3 -0
- data/app/models/promote_good.rb +3 -0
- data/app/models/rails_trade/amount.rb +44 -0
- data/app/models/rails_trade/buyer.rb +35 -0
- data/app/models/rails_trade/cart.rb +64 -0
- data/app/models/rails_trade/good.rb +71 -0
- data/app/models/rails_trade/order.rb +78 -91
- data/app/models/rails_trade/ordering/payment.rb +113 -0
- data/app/models/rails_trade/{concerns/the_refund.rb → ordering/refund.rb} +3 -5
- data/app/models/rails_trade/payment.rb +72 -73
- data/app/models/rails_trade/payment/alipay_payment.rb +15 -0
- data/app/models/rails_trade/payment/apple_payment.rb +7 -0
- data/app/models/rails_trade/{payments → payment}/bank_payment.rb +2 -4
- data/app/models/rails_trade/payment/hand_payment.rb +8 -0
- data/app/models/rails_trade/payment/paypal_payment.rb +8 -0
- data/app/models/rails_trade/payment/stripe_payment.rb +9 -0
- data/app/models/rails_trade/{payments → payment}/wxpay_payment.rb +1 -2
- data/app/models/rails_trade/payment_method.rb +22 -12
- data/app/models/rails_trade/{payment_methods → payment_method}/stripe_method.rb +7 -4
- data/app/models/rails_trade/payment_order.rb +84 -51
- data/app/models/rails_trade/payment_reference.rb +12 -9
- data/app/models/rails_trade/payment_strategy.rb +15 -12
- data/app/models/rails_trade/payment_type/alipay.rb +28 -0
- data/app/models/rails_trade/payment_type/apple_pay.rb +18 -0
- data/app/models/rails_trade/{payment_interface/the_paypal.rb → payment_type/paypal.rb} +8 -29
- data/app/models/rails_trade/{payment_interface/the_stripe.rb → payment_type/stripe.rb} +8 -26
- data/app/models/rails_trade/payment_type/wxpay.rb +55 -0
- data/app/models/rails_trade/promote.rb +65 -27
- data/app/models/rails_trade/promote_buyer.rb +25 -7
- data/app/models/rails_trade/promote_charge.rb +78 -11
- data/app/models/rails_trade/promote_charge/cash_promote_charge.rb +12 -0
- data/app/models/rails_trade/promote_charge/discount_promote_charge.rb +17 -0
- data/app/models/rails_trade/promote_charge/final_promote_charge.rb +12 -0
- data/app/models/rails_trade/promote_charge/minus_promote_charge.rb +11 -0
- data/app/models/rails_trade/promote_charge/plus_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_extra.rb +13 -0
- data/app/models/rails_trade/promote_good.rb +20 -7
- data/app/models/rails_trade/refund.rb +30 -19
- data/app/models/rails_trade/{refunds → refund}/alipay_refund.rb +1 -1
- data/app/models/rails_trade/refund/bank_refund.rb +5 -0
- data/app/models/rails_trade/refund/hand_refund.rb +5 -0
- data/app/models/rails_trade/{refunds → refund}/paypal_refund.rb +1 -1
- data/app/models/rails_trade/{refunds → refund}/stripe_refund.rb +1 -1
- data/app/models/rails_trade/{refunds → refund}/wxpay_refund.rb +17 -9
- data/app/models/rails_trade/sell.rb +24 -0
- data/app/models/rails_trade/trade_item.rb +153 -0
- data/app/models/rails_trade/trade_promote.rb +92 -0
- data/app/models/rails_trade/user.rb +9 -0
- data/app/models/refund.rb +3 -0
- data/app/models/refund/alipay_refund.rb +3 -0
- data/app/models/refund/bank_refund.rb +3 -0
- data/app/models/refund/hand_refund.rb +3 -0
- data/app/models/refund/paypal_refund.rb +3 -0
- data/app/models/refund/stripe_refund.rb +3 -0
- data/app/models/refund/wxpay_refund.rb +3 -0
- data/app/models/trade_item.rb +3 -0
- data/app/models/trade_promote.rb +3 -0
- data/app/views/application/_trade_nav.html.erb +16 -0
- data/app/views/my/_trade_nav.html.erb +10 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/_menu.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/_search_form.html.erb +3 -3
- data/app/views/{rails_trade_admin → trade/admin}/buyers/edit.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/buyers/new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/orders.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/buyers/overdue.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/buyers/show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_check.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_serve.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_single.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_single_table.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_total.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_total_table.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/add.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/index.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/single.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/total.js.erb +0 -0
- data/app/views/trade/admin/goods/_form.html.erb +7 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/_item.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/_new.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/_show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/_show_tr.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit_items.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit_pic.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit_promote.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/goods/new.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/goods/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/show.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/update.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_index.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_payment_orders.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_payments.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/create_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/index.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/_addresses.html.erb +1 -1
- data/app/views/trade/admin/orders/_filter.html.erb +26 -0
- data/app/views/trade/admin/orders/_form.html.erb +4 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/_invoice_addresses.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/orders/_item.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/_new_items.html.erb +1 -1
- data/app/{assets/javascripts/controllers/rails_trade_admin/payments/index.js → views/trade/admin/orders/_search_form.html.erb} +0 -0
- data/app/views/trade/admin/orders/index.html.erb +52 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/payments.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/orders/refresh.js.erb +0 -0
- data/app/views/trade/admin/orders/show.html.erb +75 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_edit.html.erb +0 -0
- data/app/views/{rails_trade_admin/payment_methods/_search_form.html.erb → trade/admin/payment_methods/_filter.html.erb} +5 -9
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_index_layout.html.erb +2 -5
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_new.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_payment_method.html.erb +2 -3
- data/app/views/trade/admin/payment_methods/create.js.erb +2 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/edit.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/edit.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/index.html.erb +7 -4
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/mine.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/new.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/unverified.html.erb +4 -6
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/update.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/_index.html.erb +2 -6
- data/app/views/trade/admin/payment_orders/_new.html.erb +23 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/_orders.html.erb +2 -9
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/cancel.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/create_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/raise_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/update.js.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/update_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/_form.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/_new.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/edit.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/edit.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/index.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/new.html.erb +1 -1
- data/app/views/trade/admin/payments/_checked_amount.html.erb +6 -0
- data/app/views/trade/admin/payments/_edit.html.erb +12 -0
- data/app/views/trade/admin/payments/_filter.html.erb +40 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/_form.html.erb +6 -2
- data/app/views/trade/admin/payments/_item.html.erb +41 -0
- data/app/views/trade/admin/payments/_new.html.erb +12 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/analyze.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/dashboard.html.erb +0 -0
- data/app/views/trade/admin/payments/edit.html.erb +13 -0
- data/app/views/trade/admin/payments/edit.js.erb +3 -0
- data/app/views/trade/admin/payments/index.html.erb +40 -0
- data/app/views/trade/admin/payments/new.html.erb +13 -0
- data/app/views/trade/admin/payments/new.js.erb +3 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/show.html.erb +0 -0
- data/app/views/trade/admin/promote_buyers/_filter.html.erb +7 -0
- data/app/views/trade/admin/promote_buyers/_form.html.erb +17 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/_promote_buyer.json.jbuilder +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/edit.html.erb +1 -1
- data/app/views/trade/admin/promote_buyers/edit.js.erb +3 -0
- data/app/views/trade/admin/promote_buyers/index.html.erb +52 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/index.json.jbuilder +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/new.html.erb +1 -1
- data/app/views/trade/admin/promote_buyers/new.js.erb +3 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/show.json.jbuilder +0 -0
- data/app/views/trade/admin/promote_charges/_base_price_form.html.erb +1 -0
- data/app/views/trade/admin/promote_charges/_edit.html.erb +13 -0
- data/app/views/trade/admin/promote_charges/_filter.html.erb +11 -0
- data/app/views/trade/admin/promote_charges/_form.html.erb +11 -0
- data/app/views/trade/admin/promote_charges/_new.html.erb +13 -0
- data/app/views/trade/admin/promote_charges/index.html.erb +65 -0
- data/app/views/trade/admin/promote_charges/options.js.erb +4 -0
- data/app/views/trade/admin/promote_goods/_filter.html.erb +8 -0
- data/app/views/trade/admin/promote_goods/_form.html.erb +8 -0
- data/app/views/trade/admin/promote_goods/_goods_options.html.erb +1 -0
- data/app/views/trade/admin/promote_goods/goods.js.erb +2 -0
- data/app/views/trade/admin/promote_goods/index.html.erb +61 -0
- data/app/views/trade/admin/promotes/_edit.html.erb +12 -0
- data/app/views/trade/admin/promotes/_filter.html.erb +9 -0
- data/app/views/trade/admin/promotes/_form.html.erb +12 -0
- data/app/views/trade/admin/promotes/_new.html.erb +12 -0
- data/app/views/trade/admin/promotes/_new_promote_charge.html.erb +10 -0
- data/app/views/trade/admin/promotes/create.js.erb +2 -0
- data/app/views/trade/admin/promotes/index.html.erb +79 -0
- data/app/views/trade/admin/refunds/_filter.html.erb +11 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/_logs_table.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/_new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/edit.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/index.html.erb +13 -17
- data/app/views/{rails_trade_admin → trade/admin}/refunds/logs.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/show.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_additions.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_filter.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_good_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_order_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_retail_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_single_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_total_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/error.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/index.html.erb +3 -3
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/only.html.erb +2 -2
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/total.js.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/update.js.erb +0 -0
- data/app/views/trade/admin/trade_promotes/_filter.html.erb +7 -0
- data/app/views/trade/admin/trade_promotes/_form.html.erb +6 -0
- data/app/views/trade/admin/trade_promotes/_show_table.html.erb +20 -0
- data/app/views/trade/admin/trade_promotes/edit.html.erb +9 -0
- data/app/views/trade/admin/trade_promotes/edit.js.erb +3 -0
- data/app/views/trade/admin/trade_promotes/index.html.erb +38 -0
- data/app/views/trade/admin/trade_promotes/new.html.erb +9 -0
- data/app/views/trade/admin/trade_promotes/new.js.erb +3 -0
- data/app/views/trade/admin/trade_promotes/show.html.erb +7 -0
- data/app/views/trade/admin/trade_promotes/show.js.erb +3 -0
- data/app/views/trade/admin/trade_promotes/update.js.erb +1 -0
- data/app/views/{buyers → trade/buyers}/_show.html.erb +0 -0
- data/app/views/{buyers → trade/buyers}/show.js.erb +0 -0
- data/app/views/{goods → trade/goods}/_choose.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_good.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_good_item.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_nav.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_search.html.erb +0 -0
- data/app/views/{goods → trade/goods}/index.html.erb +0 -0
- data/app/views/{goods → trade/goods}/index/_product.html.erb +0 -0
- data/app/views/{goods → trade/goods}/item.html.erb +0 -0
- data/app/views/{goods → trade/goods}/produce.html.erb +0 -0
- data/app/views/trade/goods/show.html.erb +2 -0
- data/app/views/{goods → trade/goods}/show/_basic.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_carousel.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_items.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_sales.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_side.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_breadcrumb.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_nav.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_nav_.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_nav_last.html.erb +0 -0
- data/app/views/trade/my/carts/_filter.html.erb +7 -0
- data/app/views/trade/my/carts/_form.html.erb +8 -0
- data/app/views/trade/my/carts/_show_table.html.erb +28 -0
- data/app/views/trade/my/carts/edit.html.erb +9 -0
- data/app/views/trade/my/carts/edit.js.erb +3 -0
- data/app/views/trade/my/carts/index.html.erb +47 -0
- data/app/views/trade/my/carts/new.html.erb +9 -0
- data/app/views/trade/my/carts/new.js.erb +3 -0
- data/app/views/trade/my/carts/show.html+phone.erb +46 -0
- data/app/views/{rails_trade_admin/promote_goods → trade/my/carts}/show.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/edit.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/index.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/order_items/new.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/show.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/_date_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/_edit.html.erb +2 -2
- data/app/views/trade/my/orders/_edit_payment_type.html.erb +12 -0
- data/app/views/{rails_trade_my → trade/my}/orders/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/destroy.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/edit.js.erb +0 -0
- data/app/views/trade/my/orders/edit_payment_type.js.erb +4 -0
- data/app/views/{rails_trade_my → trade/my}/orders/fail.html.erb +0 -0
- data/app/views/trade/my/orders/index.html+phone.erb +37 -0
- data/app/views/trade/my/orders/index.html.erb +36 -0
- data/app/views/{rails_trade_my → trade/my}/orders/index.json.jbuilder +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/new.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/refresh.js.erb +0 -0
- data/app/views/trade/my/orders/refund.json.jbuilder +12 -0
- data/app/views/trade/my/orders/show.html+phone.erb +3 -0
- data/app/views/{rails_trade_my → trade/my}/orders/show.html.erb +3 -3
- data/app/views/{rails_trade_my → trade/my}/orders/success.html.erb +0 -2
- data/app/views/{rails_trade_my → trade/my}/orders/update.js.erb +1 -1
- data/app/views/trade/my/orders/wait.html+wechat.erb +4 -0
- data/app/views/trade/my/orders/wxpay_pay.js.erb +16 -0
- data/app/views/trade/my/orders/wxpay_pay_err.js.erb +5 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_edit.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_index.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_item.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_new.html.erb +3 -3
- data/app/views/{rails_trade_my → trade/my}/payment_methods/create.js.erb +0 -0
- data/app/views/{rails_trade_my/addresses → trade/my/payment_methods}/destroy.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/edit.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/index.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/index.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/new.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/show.html.erb +0 -0
- data/app/views/{rails_trade_my/addresses → trade/my/payment_methods}/update.js.erb +0 -0
- data/app/views/trade/my/trade_items/_additions.html.erb +12 -0
- data/app/views/trade/my/trade_items/_cart_item.js.erb +2 -0
- data/app/views/trade/my/trade_items/_single_price.html.erb +6 -0
- data/app/views/trade/my/trade_items/_total_price.html.erb +8 -0
- data/app/views/trade/my/trade_items/_trade_items.html.erb +68 -0
- data/app/views/trade/my/trade_items/create.html.erb +1 -0
- data/app/views/{rails_trade_my/cart_items → trade/my/trade_items}/destroy.js.erb +0 -0
- data/app/views/trade/my/trade_items/index.json.jbuilder +0 -0
- data/app/views/trade/my/trade_items/update.js.erb +1 -0
- data/app/views/{rails_trade_my → trade/my}/users/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/users/edit.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/users/show.html.erb +0 -0
- data/app/views/trade/payments/_wxpay_result.html.erb +3 -0
- data/app/views/trade/payments/wxpay_result.js.erb +1 -0
- data/config/locales/en.enum.yml +47 -0
- data/config/locales/en.yml +22 -60
- data/config/locales/zh.attributes.yml +75 -0
- data/config/locales/zh.controller.yml +51 -0
- data/config/locales/zh.enum.yml +58 -0
- data/config/locales/zh.help.yml +7 -0
- data/config/routes.rb +45 -59
- data/lib/rails_trade.rb +9 -19
- data/lib/rails_trade/apple_pay.rb +32 -0
- data/lib/rails_trade/config.rb +6 -3
- data/lib/rails_trade/engine.rb +15 -19
- data/lib/rails_trade/version.rb +1 -1
- metadata +475 -422
- data/app/assets/config/rails_trade_manifest.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/index.js +0 -15
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/overdue.js +0 -15
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/edit.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/unverified.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_goods/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/edit.js +0 -2
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/new.js +0 -2
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/edit.js +0 -2
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/new.js +0 -4
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/create.js +0 -3
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/index.js +0 -65
- data/app/controllers/areas_controller.rb +0 -18
- data/app/controllers/buyers_controller.rb +0 -8
- data/app/controllers/payments_controller.rb +0 -50
- data/app/controllers/providers_controller.rb +0 -8
- data/app/controllers/the_trade_admin/addresses_controller.rb +0 -75
- data/app/controllers/the_trade_admin/areas_controller.rb +0 -50
- data/app/controllers/the_trade_admin/base_controller.rb +0 -5
- data/app/controllers/the_trade_admin/payments_controller.rb +0 -89
- data/app/controllers/the_trade_admin/promote_buyers_controller.rb +0 -39
- data/app/controllers/the_trade_admin/promote_charges_controller.rb +0 -62
- data/app/controllers/the_trade_admin/promote_goods_controller.rb +0 -50
- data/app/controllers/the_trade_admin/promotes_controller.rb +0 -105
- data/app/controllers/the_trade_admin/providers_controller.rb +0 -121
- data/app/controllers/the_trade_admin/serve_charges_controller.rb +0 -67
- data/app/controllers/the_trade_admin/serves_controller.rb +0 -107
- data/app/controllers/the_trade_my/addresses_controller.rb +0 -50
- data/app/controllers/the_trade_my/base_controller.rb +0 -13
- data/app/controllers/the_trade_my/buyers_controller.rb +0 -35
- data/app/controllers/the_trade_my/cart_items_controller.rb +0 -71
- data/app/controllers/the_trade_my/orders_controller.rb +0 -161
- data/app/controllers/the_trade_my/providers_controller.rb +0 -44
- data/app/models/rails_trade/address.rb +0 -14
- data/app/models/rails_trade/area.rb +0 -65
- data/app/models/rails_trade/cart_item.rb +0 -185
- data/app/models/rails_trade/cart_item_serve.rb +0 -16
- data/app/models/rails_trade/concerns/good_able.rb +0 -63
- data/app/models/rails_trade/concerns/order_able.rb +0 -48
- data/app/models/rails_trade/concerns/promote_fee.rb +0 -54
- data/app/models/rails_trade/concerns/serve_fee.rb +0 -41
- data/app/models/rails_trade/concerns/summary_service.rb +0 -67
- data/app/models/rails_trade/concerns/the_payment.rb +0 -88
- data/app/models/rails_trade/concerns/the_trade_buyer.rb +0 -50
- data/app/models/rails_trade/concerns/the_trade_user.rb +0 -23
- data/app/models/rails_trade/good_partner.rb +0 -8
- data/app/models/rails_trade/good_produce.rb +0 -14
- data/app/models/rails_trade/order_item.rb +0 -88
- data/app/models/rails_trade/order_promote.rb +0 -23
- data/app/models/rails_trade/order_serve.rb +0 -23
- data/app/models/rails_trade/order_shipment.rb +0 -10
- data/app/models/rails_trade/payment_interface/payment_interface_base.rb +0 -8
- data/app/models/rails_trade/payment_interface/the_alipay.rb +0 -49
- data/app/models/rails_trade/payment_interface/the_wxpay.rb +0 -56
- data/app/models/rails_trade/payments/alipay_payment.rb +0 -12
- data/app/models/rails_trade/payments/hand_payment.rb +0 -13
- data/app/models/rails_trade/payments/paypal_payment.rb +0 -8
- data/app/models/rails_trade/payments/stripe_payment.rb +0 -7
- data/app/models/rails_trade/produce.rb +0 -18
- data/app/models/rails_trade/promote_charges/single_promote_charge.rb +0 -7
- data/app/models/rails_trade/promote_charges/total_promote_charge.rb +0 -7
- data/app/models/rails_trade/promotes/amount_promote.rb +0 -4
- data/app/models/rails_trade/promotes/number_promote.rb +0 -4
- data/app/models/rails_trade/provider.rb +0 -25
- data/app/models/rails_trade/refunds/bank_refund.rb +0 -5
- data/app/models/rails_trade/refunds/hand_refund.rb +0 -5
- data/app/models/rails_trade/serve.rb +0 -44
- data/app/models/rails_trade/serve_charge.rb +0 -37
- data/app/models/rails_trade/serve_charges/single_serve_charge.rb +0 -7
- data/app/models/rails_trade/serve_charges/total_serve_charge.rb +0 -7
- data/app/models/rails_trade/serve_good.rb +0 -9
- data/app/models/rails_trade/serves/number_serve.rb +0 -4
- data/app/models/rails_trade/serves/quantity_serve.rb +0 -4
- data/app/models/rails_trade/shipment.rb +0 -8
- data/app/views/layouts/rails_trade_admin/base.html.erb +0 -25
- data/app/views/layouts/rails_trade_my/base.html.erb +0 -28
- data/app/views/rails_trade_admin/addresses/_address.html.erb +0 -24
- data/app/views/rails_trade_admin/addresses/_edit.html.erb +0 -13
- data/app/views/rails_trade_admin/addresses/_form.html.erb +0 -23
- data/app/views/rails_trade_admin/addresses/_new.html.erb +0 -13
- data/app/views/rails_trade_admin/addresses/create.js.erb +0 -2
- data/app/views/rails_trade_admin/addresses/destroy.js.erb +0 -1
- data/app/views/rails_trade_admin/addresses/edit.js.erb +0 -39
- data/app/views/rails_trade_admin/addresses/index.html.erb +0 -41
- data/app/views/rails_trade_admin/addresses/new.js.erb +0 -52
- data/app/views/rails_trade_admin/addresses/show.html.erb +0 -4
- data/app/views/rails_trade_admin/addresses/update.js.erb +0 -2
- data/app/views/rails_trade_admin/areas/_form.html.erb +0 -9
- data/app/views/rails_trade_admin/areas/edit.html.erb +0 -16
- data/app/views/rails_trade_admin/areas/index.html.erb +0 -43
- data/app/views/rails_trade_admin/areas/new.html.erb +0 -11
- data/app/views/rails_trade_admin/areas/show.html.erb +0 -1
- data/app/views/rails_trade_admin/base/_nav.html.erb +0 -24
- data/app/views/rails_trade_admin/base/_nav_bar.html.erb +0 -23
- data/app/views/rails_trade_admin/base/_nav_payment.html.erb +0 -25
- data/app/views/rails_trade_admin/goods/_form.html.erb +0 -7
- data/app/views/rails_trade_admin/orders/_filter.html.erb +0 -20
- data/app/views/rails_trade_admin/orders/_form.html.erb +0 -17
- data/app/views/rails_trade_admin/orders/_search_form.html.erb +0 -7
- data/app/views/rails_trade_admin/orders/index.html.erb +0 -61
- data/app/views/rails_trade_admin/orders/show.html.erb +0 -89
- data/app/views/rails_trade_admin/payment_methods/create.js.erb +0 -2
- data/app/views/rails_trade_admin/payment_orders/_new.html.erb +0 -24
- data/app/views/rails_trade_admin/payments/_item.html.erb +0 -49
- data/app/views/rails_trade_admin/payments/_search_form.html.erb +0 -15
- data/app/views/rails_trade_admin/payments/edit.html.erb +0 -15
- data/app/views/rails_trade_admin/payments/index.html.erb +0 -60
- data/app/views/rails_trade_admin/payments/new.html.erb +0 -17
- data/app/views/rails_trade_admin/promote_buyers/_form.html.erb +0 -6
- data/app/views/rails_trade_admin/promote_buyers/index.html.erb +0 -42
- data/app/views/rails_trade_admin/promote_charges/_edit.html.erb +0 -13
- data/app/views/rails_trade_admin/promote_charges/_form.html.erb +0 -6
- data/app/views/rails_trade_admin/promote_charges/_new.html.erb +0 -13
- data/app/views/rails_trade_admin/promote_charges/_search_form.html.erb +0 -9
- data/app/views/rails_trade_admin/promote_charges/edit.js.erb +0 -8
- data/app/views/rails_trade_admin/promote_charges/index.html.erb +0 -49
- data/app/views/rails_trade_admin/promote_charges/new.js.erb +0 -8
- data/app/views/rails_trade_admin/promote_goods/_form.html.erb +0 -4
- data/app/views/rails_trade_admin/promote_goods/_promote_good.json.jbuilder +0 -2
- data/app/views/rails_trade_admin/promote_goods/edit.html.erb +0 -14
- data/app/views/rails_trade_admin/promote_goods/index.html.erb +0 -37
- data/app/views/rails_trade_admin/promote_goods/index.json.jbuilder +0 -1
- data/app/views/rails_trade_admin/promote_goods/new.html.erb +0 -13
- data/app/views/rails_trade_admin/promote_goods/show.json.jbuilder +0 -1
- data/app/views/rails_trade_admin/promotes/_form.html.erb +0 -9
- data/app/views/rails_trade_admin/promotes/edit.html.erb +0 -9
- data/app/views/rails_trade_admin/promotes/index.html.erb +0 -65
- data/app/views/rails_trade_admin/promotes/new.html.erb +0 -9
- data/app/views/rails_trade_admin/promotes/show.html.erb +0 -4
- data/app/views/rails_trade_admin/providers/_form.html.erb +0 -6
- data/app/views/rails_trade_admin/providers/_product.html.erb +0 -12
- data/app/views/rails_trade_admin/providers/_side.html.erb +0 -8
- data/app/views/rails_trade_admin/providers/area.html.erb +0 -1
- data/app/views/rails_trade_admin/providers/channel.html.erb +0 -46
- data/app/views/rails_trade_admin/providers/edit.html.erb +0 -16
- data/app/views/rails_trade_admin/providers/index.html.erb +0 -27
- data/app/views/rails_trade_admin/providers/new.html.erb +0 -21
- data/app/views/rails_trade_admin/providers/posts.html.erb +0 -41
- data/app/views/rails_trade_admin/providers/products.html.erb +0 -23
- data/app/views/rails_trade_admin/providers/show.html.erb +0 -60
- data/app/views/rails_trade_admin/refunds/_search_form.html.erb +0 -13
- data/app/views/rails_trade_admin/serve_charges/_edit.html.erb +0 -13
- data/app/views/rails_trade_admin/serve_charges/_form.html.erb +0 -10
- data/app/views/rails_trade_admin/serve_charges/_new.html.erb +0 -13
- data/app/views/rails_trade_admin/serve_charges/_search_form.html.erb +0 -10
- data/app/views/rails_trade_admin/serve_charges/edit.js.erb +0 -7
- data/app/views/rails_trade_admin/serve_charges/index.html.erb +0 -56
- data/app/views/rails_trade_admin/serve_charges/new.js.erb +0 -8
- data/app/views/rails_trade_admin/serves/_form.html.erb +0 -9
- data/app/views/rails_trade_admin/serves/edit.html.erb +0 -9
- data/app/views/rails_trade_admin/serves/index.html.erb +0 -80
- data/app/views/rails_trade_admin/serves/new.html.erb +0 -9
- data/app/views/rails_trade_my/addresses/_edit.html.erb +0 -31
- data/app/views/rails_trade_my/addresses/_form.html.erb +0 -23
- data/app/views/rails_trade_my/addresses/_new.html.erb +0 -11
- data/app/views/rails_trade_my/addresses/create.js.erb +0 -2
- data/app/views/rails_trade_my/addresses/edit.js.erb +0 -39
- data/app/views/rails_trade_my/addresses/index.html.erb +0 -44
- data/app/views/rails_trade_my/addresses/new.js.erb +0 -39
- data/app/views/rails_trade_my/addresses/show.html.erb +0 -4
- data/app/views/rails_trade_my/base/_nav.html.erb +0 -22
- data/app/views/rails_trade_my/buyers/_form.html.erb +0 -5
- data/app/views/rails_trade_my/buyers/edit.html.erb +0 -2
- data/app/views/rails_trade_my/buyers/show.html.erb +0 -21
- data/app/views/rails_trade_my/cart_items/_additions.html.erb +0 -22
- data/app/views/rails_trade_my/cart_items/_single_price.html.erb +0 -6
- data/app/views/rails_trade_my/cart_items/_total_price.html.erb +0 -8
- data/app/views/rails_trade_my/cart_items/index.html.erb +0 -69
- data/app/views/rails_trade_my/cart_items/total.js.erb +0 -11
- data/app/views/rails_trade_my/cart_items/update.js.erb +0 -8
- data/app/views/rails_trade_my/my/index.html.erb +0 -17
- data/app/views/rails_trade_my/orders/_edit_payment_type.html.erb +0 -13
- data/app/views/rails_trade_my/orders/edit_payment_type.js.erb +0 -6
- data/app/views/rails_trade_my/orders/index.html.erb +0 -55
- data/app/views/rails_trade_my/orders/update_payment_type.js.erb +0 -3
- data/app/views/rails_trade_my/orders/wxpay_pay.js.erb +0 -16
- data/app/views/rails_trade_my/orders/wxpay_pay_err.js.erb +0 -5
- data/app/views/rails_trade_my/payment_methods/destroy.js.erb +0 -1
- data/app/views/rails_trade_my/payment_methods/update.js.erb +0 -2
- data/app/views/rails_trade_my/providers/_form.html.erb +0 -5
- data/app/views/rails_trade_my/providers/_provider.html.erb +0 -20
- data/app/views/rails_trade_my/providers/edit.html.erb +0 -2
- data/app/views/rails_trade_my/providers/index.html.erb +0 -12
- data/app/views/rails_trade_my/providers/new.html.erb +0 -10
- data/app/views/rails_trade_my/providers/show.html.erb +0 -13
- data/config/locales/zh.yml +0 -75
- data/db/migrate/20150514135720_create_providers.rb +0 -59
- data/db/migrate/20170601014520_create_payments.rb +0 -52
- data/db/migrate/20170602061859_create_payment_references.rb +0 -12
- data/db/migrate/20170702234123_create_orders.rb +0 -56
- data/db/migrate/20170714080032_create_payment_strategies.rb +0 -77
- data/db/migrate/20171115063702_create_promote_buyers.rb +0 -31
- data/db/schema.rb +0 -94
- data/lib/tasks/the_trade_tasks.rake +0 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
class GoodsController <
|
1
|
+
class Trade::Admin::GoodsController < Trade::Admin::BaseController
|
2
2
|
before_action :set_good, only: [:show, :produce]
|
3
3
|
|
4
4
|
def index
|
@@ -12,6 +12,12 @@ class GoodsController < ApplicationController
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
def search
|
16
|
+
@goods = params[:good_type].constantize.default_where('')
|
17
|
+
@buyers = RailsTrade.buyer_class.default_where('name-like': params[:q])
|
18
|
+
render json: { results: @buyers.as_json(only: [:id], methods: [:name_detail]) }
|
19
|
+
end
|
20
|
+
|
15
21
|
def item
|
16
22
|
@item = Item.includes(:goods).find params[:id]
|
17
23
|
@menus = List.joins(:items).where(items: {node_type: Item.node_types[:node_top]})
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::OrderPaymentsController < Trade::Admin::BaseController
|
2
2
|
before_action :set_order
|
3
3
|
before_action :set_payment_order, only: [:destroy]
|
4
4
|
after_action only: [:create] do
|
5
|
-
mark_audits(
|
5
|
+
mark_audits(instance: :@order, include: [:payment_orders])
|
6
6
|
end
|
7
7
|
|
8
8
|
def index
|
@@ -46,7 +46,10 @@ class RailsTradeAdmin::OrderPaymentsController < RailsTradeAdmin::BaseController
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def payment_order_params
|
49
|
-
params.fetch(:payment_order, {}).permit(
|
49
|
+
params.fetch(:payment_order, {}).permit(
|
50
|
+
:payment_id,
|
51
|
+
:check_amount
|
52
|
+
)
|
50
53
|
end
|
51
54
|
|
52
55
|
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::OrdersController < Trade::Admin::BaseController
|
2
2
|
before_action :set_order, only: [:show, :edit, :update, :refund, :destroy]
|
3
3
|
skip_before_action :verify_authenticity_token, only: [:refresh]
|
4
4
|
|
5
5
|
def index
|
6
|
-
|
7
|
-
q_params
|
8
|
-
|
6
|
+
q_params = {}
|
7
|
+
q_params.merge! default_params
|
8
|
+
q_params.merge! params.permit(:id, :uuid, :user_id, :buyer_type, :buyer_id, :payment_status, :payment_type)
|
9
9
|
|
10
|
-
@orders = Order.default_where(
|
10
|
+
@orders = Order.includes(:user).default_where(q_params).order(id: :desc).page(params[:page])
|
11
11
|
end
|
12
12
|
|
13
13
|
def payments
|
@@ -15,7 +15,7 @@ class RailsTradeAdmin::OrdersController < RailsTradeAdmin::BaseController
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def new
|
18
|
-
@order = Order.new(
|
18
|
+
@order = Order.new(buyer_id: params[:buyer_id])
|
19
19
|
if params[:cart_item_id]
|
20
20
|
@order.migrate_from_cart_item(params[:cart_item_id])
|
21
21
|
else
|
@@ -29,7 +29,7 @@ class RailsTradeAdmin::OrdersController < RailsTradeAdmin::BaseController
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def refresh
|
32
|
-
@order = Order.new(
|
32
|
+
@order = Order.new(buyer_id: params[:buyer_id])
|
33
33
|
@order.assign_attributes order_params
|
34
34
|
|
35
35
|
if params[:cart_item_id]
|
@@ -52,7 +52,7 @@ class RailsTradeAdmin::OrdersController < RailsTradeAdmin::BaseController
|
|
52
52
|
|
53
53
|
respond_to do |format|
|
54
54
|
if @order.save
|
55
|
-
format.html { redirect_to admin_order_url(@order)
|
55
|
+
format.html { redirect_to admin_order_url(@order) }
|
56
56
|
format.json { render json: @order, status: :created, location: @order }
|
57
57
|
else
|
58
58
|
format.html { render action: 'new' }
|
@@ -66,7 +66,7 @@ class RailsTradeAdmin::OrdersController < RailsTradeAdmin::BaseController
|
|
66
66
|
|
67
67
|
def update
|
68
68
|
if @order.update(order_params)
|
69
|
-
redirect_to @order
|
69
|
+
redirect_to @order
|
70
70
|
else
|
71
71
|
render :edit
|
72
72
|
end
|
@@ -83,7 +83,7 @@ class RailsTradeAdmin::OrdersController < RailsTradeAdmin::BaseController
|
|
83
83
|
|
84
84
|
def destroy
|
85
85
|
@order.destroy
|
86
|
-
redirect_to admin_orders_url(
|
86
|
+
redirect_to admin_orders_url(buyer_id: @order.buyer_id)
|
87
87
|
end
|
88
88
|
|
89
89
|
private
|
@@ -92,12 +92,19 @@ class RailsTradeAdmin::OrdersController < RailsTradeAdmin::BaseController
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def order_params
|
95
|
-
params.fetch(:order, {}).permit(
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
95
|
+
p = params.fetch(:order, {}).permit(
|
96
|
+
:buyer_type,
|
97
|
+
:buyer_id,
|
98
|
+
:quantity,
|
99
|
+
:payment_id,
|
100
|
+
:payment_type,
|
101
|
+
:address_id,
|
102
|
+
:invoice_address_id,
|
103
|
+
:amount,
|
104
|
+
trade_items_attributes: [:deliver_on, :advance_price, :comment],
|
105
|
+
trade_promotes_attributes: [:promote_id]
|
106
|
+
)
|
107
|
+
p.merge! default_form_params
|
101
108
|
end
|
102
109
|
|
103
110
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::PaymentMethodsController < Trade::Admin::BaseController
|
2
2
|
before_action :set_payment_method, only: [:show, :edit, :update, :verify, :merge_from, :destroy]
|
3
3
|
|
4
4
|
def index
|
@@ -30,7 +30,7 @@ class RailsTradeAdmin::PaymentMethodsController < RailsTradeAdmin::BaseControlle
|
|
30
30
|
|
31
31
|
respond_to do |format|
|
32
32
|
if @payment_method.save
|
33
|
-
format.html { redirect_to admin_payment_methods_url
|
33
|
+
format.html { redirect_to admin_payment_methods_url }
|
34
34
|
format.js
|
35
35
|
else
|
36
36
|
format.html { render :new }
|
@@ -51,7 +51,7 @@ class RailsTradeAdmin::PaymentMethodsController < RailsTradeAdmin::BaseControlle
|
|
51
51
|
|
52
52
|
def update
|
53
53
|
if @payment_method.update(payment_method_params)
|
54
|
-
redirect_to admin_payment_methods_url
|
54
|
+
redirect_to admin_payment_methods_url
|
55
55
|
else
|
56
56
|
render :edit
|
57
57
|
end
|
@@ -79,7 +79,7 @@ class RailsTradeAdmin::PaymentMethodsController < RailsTradeAdmin::BaseControlle
|
|
79
79
|
|
80
80
|
def destroy
|
81
81
|
@payment_method.destroy
|
82
|
-
redirect_to admin_payment_methods_url
|
82
|
+
redirect_to admin_payment_methods_url
|
83
83
|
end
|
84
84
|
|
85
85
|
private
|
@@ -105,7 +105,10 @@ class RailsTradeAdmin::PaymentMethodsController < RailsTradeAdmin::BaseControlle
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def payment_reference_params
|
108
|
-
params.fetch(:payment_reference, {}).permit(
|
108
|
+
params.fetch(:payment_reference, {}).permit(
|
109
|
+
:account_type,
|
110
|
+
:account_id
|
111
|
+
)
|
109
112
|
end
|
110
113
|
|
111
114
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::PaymentOrdersController < Trade::Admin::BaseController
|
2
2
|
before_action :set_payment
|
3
3
|
before_action :set_payment_order, only: [:update, :cancel]
|
4
4
|
after_action only: [:create] do
|
5
|
-
mark_audits(
|
5
|
+
mark_audits(instance: :@payment, include: [:payment_orders])
|
6
6
|
end
|
7
7
|
|
8
8
|
def new
|
@@ -14,9 +14,7 @@ class RailsTradeAdmin::PaymentOrdersController < RailsTradeAdmin::BaseController
|
|
14
14
|
@payment_order = @payment.payment_orders.build(payment_order_params)
|
15
15
|
|
16
16
|
if @payment_order.confirm!
|
17
|
-
|
18
|
-
format.js
|
19
|
-
end
|
17
|
+
render 'create'
|
20
18
|
else
|
21
19
|
render 'create_fail'
|
22
20
|
end
|
@@ -25,9 +23,7 @@ class RailsTradeAdmin::PaymentOrdersController < RailsTradeAdmin::BaseController
|
|
25
23
|
def update
|
26
24
|
@payment_order.assign_attributes payment_order_params
|
27
25
|
if @payment_order.confirm!
|
28
|
-
|
29
|
-
format.js
|
30
|
-
end
|
26
|
+
render 'update'
|
31
27
|
else
|
32
28
|
render 'create_fail'
|
33
29
|
end
|
@@ -35,9 +31,6 @@ class RailsTradeAdmin::PaymentOrdersController < RailsTradeAdmin::BaseController
|
|
35
31
|
|
36
32
|
def cancel
|
37
33
|
@payment_order.revert_confirm!
|
38
|
-
respond_to do |format|
|
39
|
-
format.js
|
40
|
-
end
|
41
34
|
end
|
42
35
|
|
43
36
|
private
|
@@ -50,7 +43,12 @@ class RailsTradeAdmin::PaymentOrdersController < RailsTradeAdmin::BaseController
|
|
50
43
|
end
|
51
44
|
|
52
45
|
def payment_order_params
|
53
|
-
params.fetch(:payment_order, {}).permit(
|
46
|
+
params.fetch(:payment_order, {}).permit(
|
47
|
+
:order_id,
|
48
|
+
:check_amount
|
49
|
+
).merge(
|
50
|
+
state: 'confirmed'
|
51
|
+
)
|
54
52
|
end
|
55
53
|
|
56
54
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::PaymentReferencesController < Trade::Admin::BaseController
|
2
2
|
before_action :set_payment_method
|
3
3
|
before_action :set_payment_reference, only: [:show, :edit, :update, :destroy]
|
4
4
|
|
@@ -20,7 +20,7 @@ class RailsTradeAdmin::PaymentReferencesController < RailsTradeAdmin::BaseContro
|
|
20
20
|
@payment_reference = @payment_method.payment_references.build(payment_reference_params)
|
21
21
|
|
22
22
|
if @payment_reference.save
|
23
|
-
redirect_to admin_payment_methods_url
|
23
|
+
redirect_to admin_payment_methods_url
|
24
24
|
else
|
25
25
|
render :new
|
26
26
|
end
|
@@ -28,7 +28,7 @@ class RailsTradeAdmin::PaymentReferencesController < RailsTradeAdmin::BaseContro
|
|
28
28
|
|
29
29
|
def update
|
30
30
|
if @payment_reference.update(payment_reference_params)
|
31
|
-
redirect_to @payment_reference
|
31
|
+
redirect_to @payment_reference
|
32
32
|
else
|
33
33
|
render :edit
|
34
34
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::PaymentStrategiesController < Trade::Admin::BaseController
|
2
2
|
before_action :set_payment_strategy, only: [:show, :edit, :update, :destroy]
|
3
3
|
|
4
4
|
def index
|
@@ -19,7 +19,7 @@ class RailsTradeAdmin::PaymentStrategiesController < RailsTradeAdmin::BaseContro
|
|
19
19
|
@payment_strategy = PaymentStrategy.new(payment_strategy_params)
|
20
20
|
|
21
21
|
if @payment_strategy.save
|
22
|
-
redirect_to admin_payment_strategies_url
|
22
|
+
redirect_to admin_payment_strategies_url
|
23
23
|
else
|
24
24
|
render :new
|
25
25
|
end
|
@@ -27,7 +27,7 @@ class RailsTradeAdmin::PaymentStrategiesController < RailsTradeAdmin::BaseContro
|
|
27
27
|
|
28
28
|
def update
|
29
29
|
if @payment_strategy.update(payment_strategy_params)
|
30
|
-
redirect_to admin_payment_strategies_url
|
30
|
+
redirect_to admin_payment_strategies_url
|
31
31
|
else
|
32
32
|
render :edit
|
33
33
|
end
|
@@ -35,7 +35,7 @@ class RailsTradeAdmin::PaymentStrategiesController < RailsTradeAdmin::BaseContro
|
|
35
35
|
|
36
36
|
def destroy
|
37
37
|
@payment_strategy.destroy
|
38
|
-
redirect_to admin_payment_strategies_url
|
38
|
+
redirect_to admin_payment_strategies_url
|
39
39
|
end
|
40
40
|
|
41
41
|
private
|
@@ -44,7 +44,11 @@ class RailsTradeAdmin::PaymentStrategiesController < RailsTradeAdmin::BaseContro
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def payment_strategy_params
|
47
|
-
params.fetch(:payment_strategy, {}).permit(
|
47
|
+
params.fetch(:payment_strategy, {}).permit(
|
48
|
+
:name,
|
49
|
+
:strategy,
|
50
|
+
:period
|
51
|
+
)
|
48
52
|
end
|
49
53
|
|
50
54
|
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
class Trade::Admin::PaymentsController < Trade::Admin::BaseController
|
2
|
+
before_action :set_payment, only: [:show, :edit, :update, :analyze, :adjust, :destroy]
|
3
|
+
|
4
|
+
def dashboard
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def index
|
9
|
+
q_params = {}
|
10
|
+
q_params.merge! default_params
|
11
|
+
q_params.merge! params.permit(:type, :state, :id, :buyer_identifier, :buyer_bank, :payment_uuid, :'buyer_name-like', :'payment_orders.state', :'orders.uuid')
|
12
|
+
@payments = Payment.default_where(q_params).permit_with(rails_role_user).order(id: :desc).page(params[:page])
|
13
|
+
end
|
14
|
+
|
15
|
+
def show
|
16
|
+
end
|
17
|
+
|
18
|
+
def new
|
19
|
+
@payment = Payment.new
|
20
|
+
if params[:order_id]
|
21
|
+
@order = Order.find params[:order_id]
|
22
|
+
@payment.total_amount = @order.amount
|
23
|
+
end
|
24
|
+
@payment.payment_uuid = UidHelper.nsec_uuid('PAY')
|
25
|
+
end
|
26
|
+
|
27
|
+
def create
|
28
|
+
if params[:order_id].present?
|
29
|
+
@order = Order.find params[:order_id]
|
30
|
+
@payment = @order.payments.build(payment_params.merge(creator_id: rails_role_user.id))
|
31
|
+
else
|
32
|
+
@payment = Payment.new(payment_params.merge(creator_id: rails_role_user.id))
|
33
|
+
end
|
34
|
+
|
35
|
+
if @payment.save
|
36
|
+
redirect_to admin_payments_url
|
37
|
+
else
|
38
|
+
render :new
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def edit
|
43
|
+
end
|
44
|
+
|
45
|
+
def update
|
46
|
+
if @payment.update(payment_params)
|
47
|
+
redirect_to admin_payments_url
|
48
|
+
else
|
49
|
+
render :edit
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def analyze
|
54
|
+
@payment.analyze_payment_method
|
55
|
+
|
56
|
+
respond_to do |format|
|
57
|
+
format.js
|
58
|
+
format.json
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def adjust
|
63
|
+
@payment.analyze_adjust_amount
|
64
|
+
respond_to do |format|
|
65
|
+
format.js
|
66
|
+
format.html { redirect_to admin_payments_url }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def destroy
|
71
|
+
@payment.destroy
|
72
|
+
redirect_to admin_payments_url
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
def set_payment
|
77
|
+
@payment = Payment.find(params[:id])
|
78
|
+
end
|
79
|
+
|
80
|
+
def payment_params
|
81
|
+
p = params.fetch(:payment, {}).permit(
|
82
|
+
:type,
|
83
|
+
:payment_uuid,
|
84
|
+
:total_amount,
|
85
|
+
:fee_amount,
|
86
|
+
:income_amount,
|
87
|
+
:notified_at,
|
88
|
+
:comment,
|
89
|
+
:buyer_name,
|
90
|
+
:buyer_identifier,
|
91
|
+
:buyer_bank
|
92
|
+
)
|
93
|
+
p.merge! default_form_params
|
94
|
+
p
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Admin::ProducesController < Admin::BaseController
|
1
|
+
class Trade::Admin::ProducesController < Trade::Admin::BaseController
|
2
2
|
before_action :set_produce, only: [:show, :edit, :update, :destroy]
|
3
3
|
|
4
4
|
def index
|
@@ -20,7 +20,7 @@ class Admin::ProducesController < Admin::BaseController
|
|
20
20
|
|
21
21
|
respond_to do |format|
|
22
22
|
if @produce.save
|
23
|
-
format.html { redirect_to @produce
|
23
|
+
format.html { redirect_to @produce }
|
24
24
|
format.json { render :show, status: :created, location: @produce }
|
25
25
|
else
|
26
26
|
format.html { render :new }
|
@@ -34,7 +34,7 @@ class Admin::ProducesController < Admin::BaseController
|
|
34
34
|
def update
|
35
35
|
respond_to do |format|
|
36
36
|
if @produce.update(produce_params)
|
37
|
-
format.html { redirect_to @produce
|
37
|
+
format.html { redirect_to @produce }
|
38
38
|
format.json { render :show, status: :ok, location: @produce }
|
39
39
|
else
|
40
40
|
format.html { render :edit }
|
@@ -48,7 +48,7 @@ class Admin::ProducesController < Admin::BaseController
|
|
48
48
|
def destroy
|
49
49
|
@produce.destroy
|
50
50
|
respond_to do |format|
|
51
|
-
format.html { redirect_to produces_url
|
51
|
+
format.html { redirect_to produces_url }
|
52
52
|
format.json { head :no_content }
|
53
53
|
end
|
54
54
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
class Trade::Admin::PromoteBuyersController < Trade::Admin::BaseController
|
2
|
+
before_action :set_promote_buyer, only: [:show, :destroy]
|
3
|
+
|
4
|
+
def index
|
5
|
+
q_params = {}
|
6
|
+
q_params.merge! params.permit(:promote_id, :buyer_type, :buyer_id)
|
7
|
+
@promote_buyers = PromoteBuyer.includes(:buyer, :promote).default_where(q_params).page(params[:page])
|
8
|
+
if params[:promote_good_id]
|
9
|
+
@promote_good = PromoteGood.find params[:promote_good_id]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
def new
|
17
|
+
@promote_buyer = PromoteBuyer.new(
|
18
|
+
buyer_type: params[:buyer_type],
|
19
|
+
buyer_id: params[:buyer_id],
|
20
|
+
promote_id: params[:promote_id],
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
@promote_buyer = PromoteBuyer.new(promote_buyer_params)
|
26
|
+
|
27
|
+
if @promote_buyer.save
|
28
|
+
redirect_to admin_promote_buyers_url(buyer_id: @promote_buyer.buyer_id)
|
29
|
+
else
|
30
|
+
render :new
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def destroy
|
35
|
+
@promote_buyer.destroy
|
36
|
+
redirect_to admin_promote_buyers_url(buyer_id: @promote_buyer.buyer_id)
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
def set_promote_buyer
|
41
|
+
@promote_buyer = PromoteBuyer.find(params[:id])
|
42
|
+
end
|
43
|
+
|
44
|
+
def promote_buyer_params
|
45
|
+
q = params.fetch(:promote_buyer, {}).permit(
|
46
|
+
:buyer_type,
|
47
|
+
:buyer_id,
|
48
|
+
:promote_good_id,
|
49
|
+
:status,
|
50
|
+
:effect_at,
|
51
|
+
:expire_at
|
52
|
+
)
|
53
|
+
q[:buyer_type] = 'User' if q[:buyer_type].blank?
|
54
|
+
q
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|