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,36 @@
|
|
1
|
+
module Trade
|
2
|
+
module Ordering::Refund
|
3
|
+
|
4
|
+
def apply_for_refund(payment_id = nil)
|
5
|
+
if ['unpaid', 'refunding', 'refunded'].include? self.payment_status
|
6
|
+
return
|
7
|
+
end
|
8
|
+
|
9
|
+
if payment_id
|
10
|
+
payments = self.payments.where(id: payment_id)
|
11
|
+
else
|
12
|
+
payments = self.payments
|
13
|
+
end
|
14
|
+
|
15
|
+
payments.each do |payment|
|
16
|
+
refund = self.refunds.build(payment_id: payment.id)
|
17
|
+
refund.type = payment.type.sub(/Payment/, '') + 'Refund'
|
18
|
+
refund.total_amount = payment.total_amount
|
19
|
+
refund.currency = payment.currency
|
20
|
+
self.received_amount -= payment.total_amount
|
21
|
+
end
|
22
|
+
|
23
|
+
self.payment_status = 'refunding'
|
24
|
+
|
25
|
+
self.class.transaction do
|
26
|
+
self.confirm_refund!
|
27
|
+
self.save!
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def confirm_refund!
|
32
|
+
self.trade_items.each(&:confirm_refund!)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Trade
|
2
|
+
module PaymentType::Alipay
|
3
|
+
|
4
|
+
def alipay_prepay
|
5
|
+
Alipay2::Service.trade_app_pay_params(
|
6
|
+
subject: self.subject,
|
7
|
+
out_trade_no: self.uuid,
|
8
|
+
total_amount: self.remaining_amount.to_s
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
def alipay_prepay_url(return_url: url_helpers.wait_my_order_url(self.id), notify_url: url_helpers.alipay_notify_payments_url)
|
13
|
+
Alipay2::Service.trade_page_pay(
|
14
|
+
{ subject: subject, out_trade_no: uuid, total_amount: amount.to_s },
|
15
|
+
{ return_url: return_url, notify_url: notify_url }
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def alipay_result
|
20
|
+
return self if self.payment_status == 'all_paid'
|
21
|
+
|
22
|
+
result = Alipay2::Service.trade_query out_trade_no: self.uuid
|
23
|
+
result = JSON.parse(result)
|
24
|
+
result = result['alipay_trade_query_response']
|
25
|
+
|
26
|
+
if result['trade_status'] == 'TRADE_SUCCESS'
|
27
|
+
self.change_to_paid! type: 'AlipayPayment', payment_uuid: result['trade_no'], params: result
|
28
|
+
else
|
29
|
+
errors.add :base, result['msg']
|
30
|
+
logger.error "Alipay: #{self.errors.full_messages.join(', ')}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Trade
|
2
|
+
module PaymentType::ApplePay
|
3
|
+
|
4
|
+
def apple_pay_result(receipt_data)
|
5
|
+
return self if self.payment_status == 'all_paid'
|
6
|
+
|
7
|
+
result = ApplePay.query receipt_data
|
8
|
+
|
9
|
+
result['product_id'] == self.uuid
|
10
|
+
result['amount'] = self.amount
|
11
|
+
|
12
|
+
if result['trade_status'] == 'TRADE_SUCCESS'
|
13
|
+
self.change_to_paid! type: 'ApplePayment', payment_uuid: result['transaction_id'], params: result
|
14
|
+
else
|
15
|
+
errors.add :base, result['msg']
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
module Trade
|
2
|
+
module PaymentType::Paypal
|
3
|
+
|
4
|
+
def paypal_prepay
|
5
|
+
paypal_payment = PayPal::SDK::REST::DataTypes::Payment.new(paypal_params)
|
6
|
+
|
7
|
+
result = paypal_payment.create
|
8
|
+
if result
|
9
|
+
self.update(payment_id: paypal_payment.id)
|
10
|
+
else
|
11
|
+
self.errors.add :payment_id, paypal_payment.error.inspect
|
12
|
+
end
|
13
|
+
paypal_payment.links.find{ |v| v.rel == 'approval_url' }.href
|
14
|
+
end
|
15
|
+
|
16
|
+
def paypal_execute(params)
|
17
|
+
return unless self.payment_id
|
18
|
+
paypal_payment = PayPal::SDK::REST::DataTypes::Payment.find(self.payment_id)
|
19
|
+
paypal_payment.execute(payer_id: params[:PayerID])
|
20
|
+
|
21
|
+
paypal_record(paypal_payment)
|
22
|
+
end
|
23
|
+
|
24
|
+
def paypal_result
|
25
|
+
return self if self.payment_status == 'all_paid'
|
26
|
+
|
27
|
+
return unless self.payment_id
|
28
|
+
paypal_payment ||= PayPal::SDK::REST::DataTypes::Payment.find(self.payment_id)
|
29
|
+
trans = paypal_payment.transactions[0]
|
30
|
+
|
31
|
+
if paypal_payment.state == 'approved'
|
32
|
+
self.change_to_paid! type: 'PaypalPayment', payment_uuid: trans.related_resources[0].sale.id, params: trans
|
33
|
+
else
|
34
|
+
errors.add :base, paypal_payment.error.inspect
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def paypal_params
|
39
|
+
{
|
40
|
+
intent: 'sale',
|
41
|
+
payer: {
|
42
|
+
payment_method: 'paypal'
|
43
|
+
},
|
44
|
+
redirect_urls: {
|
45
|
+
return_url: url_helpers.paypal_execute_my_order_url(self.id),
|
46
|
+
cancel_url: url_helpers.cancel_my_order_url(self.id)
|
47
|
+
},
|
48
|
+
transactions: {
|
49
|
+
item_list: {
|
50
|
+
items: paypal_items_params
|
51
|
+
},
|
52
|
+
amount: {
|
53
|
+
total: self.unreceived_amount,
|
54
|
+
currency: self.currency.upcase
|
55
|
+
},
|
56
|
+
description: ''
|
57
|
+
}
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
def paypal_items_params
|
62
|
+
items = order_items.map do |item|
|
63
|
+
{
|
64
|
+
name: item.good.name,
|
65
|
+
sku: item.good.sku,
|
66
|
+
price: item.good.price.to_money.exchange_to(self.currency).to_s,
|
67
|
+
currency: self.currency.upcase,
|
68
|
+
quantity: item.number
|
69
|
+
}
|
70
|
+
end
|
71
|
+
serves = order_serves.map do |item|
|
72
|
+
{
|
73
|
+
name: item.serve.name,
|
74
|
+
sku: item.serve.id,
|
75
|
+
price: item.price.to_money.exchange_to(self.currency).to_s,
|
76
|
+
currency: self.currency.upcase,
|
77
|
+
quantity: 1
|
78
|
+
}
|
79
|
+
end
|
80
|
+
items + serves
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Trade
|
2
|
+
module PaymentType::Stripe
|
3
|
+
|
4
|
+
def stripe_charge(params = {})
|
5
|
+
if params[:token]
|
6
|
+
TheStripe.stripe_customer(buyer: self.buyer, token: params[:token])
|
7
|
+
end
|
8
|
+
|
9
|
+
if params[:payment_method_id]
|
10
|
+
stripe_payment_method = buyer.payment_methods.where(type: 'StripeMethod', id: params[:payment_method_id]).first
|
11
|
+
else
|
12
|
+
stripe_payment_method = buyer.payment_methods.where(type: 'StripeMethod').first
|
13
|
+
end
|
14
|
+
|
15
|
+
unless stripe_payment_method
|
16
|
+
self.errors.add :base, 'Please add credit card at first.'
|
17
|
+
return self
|
18
|
+
end
|
19
|
+
return self if self.amount <= 0
|
20
|
+
|
21
|
+
begin
|
22
|
+
charge = Stripe::Charge.create(amount: self.amount_money.cents, currency: self.currency, customer: stripe_payment_method.account_num)
|
23
|
+
self.update payment_type: 'stripe', payment_id: charge.id
|
24
|
+
self.stripe_record(charge)
|
25
|
+
rescue Stripe::StripeError, Stripe::CardError => ex
|
26
|
+
self.errors.add :base, ex.message
|
27
|
+
end
|
28
|
+
self
|
29
|
+
end
|
30
|
+
|
31
|
+
def stripe_result
|
32
|
+
return self if self.payment_status == 'all_paid'
|
33
|
+
|
34
|
+
if self.payment_id.present?
|
35
|
+
charge = Stripe::Charge.retrieve(self.payment_id)
|
36
|
+
|
37
|
+
if charge.paid && !charge.refunded
|
38
|
+
self.change_to_paid! type: 'StripePayment', payment_uuid: charge.id, params: charge
|
39
|
+
else
|
40
|
+
errors.add :uuid, 'error'
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# execute payment
|
47
|
+
# required:
|
48
|
+
# token
|
49
|
+
def self.stripe_customer(buyer:, **params)
|
50
|
+
payment_method = buyer.payment_methods.build(type: 'StripeMethod')
|
51
|
+
payment_method.token = params[:token]
|
52
|
+
payment_method.detective_save
|
53
|
+
payment_method
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Trade
|
2
|
+
module PaymentType::SvfCard
|
3
|
+
|
4
|
+
def card_pay
|
5
|
+
if payment_status == 'all_paid'
|
6
|
+
return { success: false, message: '已经支付过了,不要重复支付' }
|
7
|
+
end
|
8
|
+
|
9
|
+
self.class.transaction do
|
10
|
+
params = {
|
11
|
+
total_amount: self.remaining_amount,
|
12
|
+
adjust_amount: self.amount,
|
13
|
+
user_id: self.user_id
|
14
|
+
}
|
15
|
+
|
16
|
+
payment = self.change_to_paid!(type: 'CardPayment', payment_uuid: UidHelper.nsec_uuid, params: params)
|
17
|
+
{ success: true, payment: payment }
|
18
|
+
end
|
19
|
+
rescue ActiveRecord::RecordInvalid => e
|
20
|
+
return { success: false, message: e.message }
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module Trade
|
2
|
+
module PaymentType::Wxpay
|
3
|
+
|
4
|
+
def wxpay_prepay(app:, notify_url: url_helpers.wxpay_notify_payments_url)
|
5
|
+
options = {
|
6
|
+
mchid: app.mch_id,
|
7
|
+
serial_no: app.serial_no,
|
8
|
+
key: app.apiclient_key
|
9
|
+
}
|
10
|
+
params = {}
|
11
|
+
params.merge! wxpay_common_params(app: app, notify_url: notify_url)
|
12
|
+
params.merge! payer: { openid: user.oauth_users.find_by(app_id: app.appid)&.uid }
|
13
|
+
logger.debug " \e[35m=====> wxpay params: #{params} \e[0m"
|
14
|
+
|
15
|
+
::WxPay::Api.invoke_unifiedorder params, options
|
16
|
+
end
|
17
|
+
|
18
|
+
def h5_order(app:, notify_url: url_helpers.wxpay_notify_payments_url, payer_client_ip: '127.0.0.1')
|
19
|
+
options = {
|
20
|
+
mchid: app.mch_id,
|
21
|
+
serial_no: app.serial_no,
|
22
|
+
key: app.apiclient_key
|
23
|
+
}
|
24
|
+
params = {}
|
25
|
+
params.merge! wxpay_common_params(app: app, notify_url: notify_url)
|
26
|
+
params.merge! scene_info: { payer_client_ip: payer_client_ip, h5_info: { type: 'Wap' } }
|
27
|
+
|
28
|
+
logger.debug " \e[35m=====> wxpay params: #{params} \e[0m"
|
29
|
+
|
30
|
+
::WxPay::Api.h5_order params, options
|
31
|
+
end
|
32
|
+
|
33
|
+
def native_order(app:, notify_url: url_helpers.wxpay_notify_payments_url)
|
34
|
+
options = {
|
35
|
+
mchid: app.mch_id,
|
36
|
+
serial_no: app.serial_no,
|
37
|
+
key: app.apiclient_key
|
38
|
+
}
|
39
|
+
params = {}
|
40
|
+
params.merge! wxpay_common_params(app: app, notify_url: notify_url)
|
41
|
+
|
42
|
+
logger.debug " \e[35m=====> wxpay params: #{params} \e[0m"
|
43
|
+
|
44
|
+
::WxPay::Api.native_order params, options
|
45
|
+
end
|
46
|
+
|
47
|
+
def wxpay_common_params(app:, notify_url:)
|
48
|
+
{
|
49
|
+
appid: app.appid,
|
50
|
+
mchid: app.mch_id,
|
51
|
+
description: "订单编号: #{self.uuid}",
|
52
|
+
out_trade_no: self.uuid,
|
53
|
+
notify_url: notify_url,
|
54
|
+
amount: {
|
55
|
+
total: (self.remaining_amount * 100).to_i,
|
56
|
+
currency: 'CNY'
|
57
|
+
}
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
def wxpay_order(app:, **opts)
|
62
|
+
prepay = wxpay_prepay(app: app, **opts)
|
63
|
+
options = {
|
64
|
+
appid: app.appid,
|
65
|
+
mchid: app.mch_id
|
66
|
+
}
|
67
|
+
|
68
|
+
if prepay['prepay_id']
|
69
|
+
params = {
|
70
|
+
prepayid: prepay['prepay_id']
|
71
|
+
}
|
72
|
+
WxPay::Api.generate_js_pay_req params, options
|
73
|
+
else
|
74
|
+
{}
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def wxpay_result(app:)
|
79
|
+
#return self if self.payment_status == 'all_paid'
|
80
|
+
options = {
|
81
|
+
mchid: app.mch_id,
|
82
|
+
serial_no: app.serial_no
|
83
|
+
}
|
84
|
+
params = {
|
85
|
+
mchid: app.mch_id,
|
86
|
+
out_trade_no: self.uuid,
|
87
|
+
}
|
88
|
+
|
89
|
+
begin
|
90
|
+
result = WxPay::Api.order_query params, options
|
91
|
+
rescue #todo only net errr
|
92
|
+
result = { 'err_code_des' => 'network error' }
|
93
|
+
end
|
94
|
+
logger.debug " \e[35m=====> wxpay result: #{result} <=====\e[0m"
|
95
|
+
|
96
|
+
if result['trade_state'] == 'SUCCESS'
|
97
|
+
self.change_to_paid! type: 'Trade::WxpayPayment', payment_uuid: result['transaction_id'], params: result
|
98
|
+
else
|
99
|
+
self.errors.add :base, result['trade_state_desc'] || result['err_code_des']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
end
|