From 1ff61c938092a45368d91c89d146eb247df4351b Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 10 Jul 2023 13:49:39 +0200 Subject: [PATCH] (bug) unable to confirm payment of store for admin --- CHANGELOG.md | 2 ++ app/controllers/api/checkout_controller.rb | 2 +- app/services/checkout/payment_service.rb | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 829972a4a..a10534d92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab-manager +- Fix a bug: unable to confirm payment of store for admin + ## v6.0.9 2023 July 07 - Fix a bug: unable to show project step image in markdown file diff --git a/app/controllers/api/checkout_controller.rb b/app/controllers/api/checkout_controller.rb index 54f9c876a..d54e3edbb 100644 --- a/app/controllers/api/checkout_controller.rb +++ b/app/controllers/api/checkout_controller.rb @@ -31,7 +31,7 @@ class API::CheckoutController < API::APIController def confirm_payment authorize @current_order, policy_class: CheckoutPolicy - res = Checkout::PaymentService.new.confirm_payment(@current_order, current_user, params[:coupon_code], params[:payment_id]) + res = Checkout::PaymentService.new.confirm_payment(@current_order, params[:coupon_code], params[:payment_id]) render json: res rescue StandardError => e render json: e, status: :unprocessable_entity diff --git a/app/services/checkout/payment_service.rb b/app/services/checkout/payment_service.rb index 96a5df497..fbfef70e4 100644 --- a/app/services/checkout/payment_service.rb +++ b/app/services/checkout/payment_service.rb @@ -29,9 +29,7 @@ class Checkout::PaymentService end end - def confirm_payment(order, operator, coupon_code, payment_id = '') - return unless operator.member? - + def confirm_payment(order, coupon_code, payment_id = '') if Stripe::Helper.enabled? Payments::StripeService.new.confirm_payment(order, coupon_code, payment_id) elsif PayZen::Helper.enabled?