diff --git a/app/controllers/settings/membership_actions_controller.rb b/app/controllers/settings/membership_actions_controller.rb index a41f7ad2..ea8d903b 100755 --- a/app/controllers/settings/membership_actions_controller.rb +++ b/app/controllers/settings/membership_actions_controller.rb @@ -72,6 +72,6 @@ class Settings::MembershipActionsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def settings_membership_action_params - params.require(:membership_action).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by) + params.require(:membership_action).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by,:additional_parameters) end end diff --git a/app/controllers/settings/payment_method_settings_controller.rb b/app/controllers/settings/payment_method_settings_controller.rb index 2fccfd67..46ad82d4 100755 --- a/app/controllers/settings/payment_method_settings_controller.rb +++ b/app/controllers/settings/payment_method_settings_controller.rb @@ -41,6 +41,7 @@ class Settings::PaymentMethodSettingsController < ApplicationController # PATCH/PUT /settings/payment_method_settings/1 # PATCH/PUT /settings/payment_method_settings/1.json def update + puts settings_payment_method_setting_params respond_to do |format| if @settings_payment_method_setting.update(settings_payment_method_setting_params) format.html { redirect_to settings_payment_method_setting_path(@settings_payment_method_setting), notice: 'Payment method setting was successfully updated.' } diff --git a/app/models/payment_method_setting.rb b/app/models/payment_method_setting.rb index 4f1de785..a57e8a4d 100755 --- a/app/models/payment_method_setting.rb +++ b/app/models/payment_method_setting.rb @@ -1,4 +1,4 @@ class PaymentMethodSetting < ApplicationRecord # validations - validates_presence_of :payment_method #, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id + validates_presence_of :payment_method , :gateway_communication_type #, :gateway_url, :auth_token, :merchant_account_id end diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 43923134..4168f874 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -235,7 +235,7 @@ class SalePayment < ApplicationRecord customer_data = Customer.find_by_customer_id(sale_data.customer_id) if !membership_actions_data.nil? - url = paypar_url.to_s + membership_actions_data.gateway_url.to_s + url = "paypar_url.to_s" + membership_actions_data.gateway_url.to_s merchant_uid = membership_actions_data.merchant_account_id auth_token = membership_actions_data.auth_token @@ -261,7 +261,7 @@ class SalePayment < ApplicationRecord auth_token:auth_token}.to_json end - + puts params # Control for Paypar Cloud begin response = HTTParty.post(url, diff --git a/app/views/settings/payment_method_settings/_form.html.erb b/app/views/settings/payment_method_settings/_form.html.erb index bb5ae59a..96624821 100755 --- a/app/views/settings/payment_method_settings/_form.html.erb +++ b/app/views/settings/payment_method_settings/_form.html.erb @@ -9,15 +9,25 @@
<%= f.input :payment_method %> <%= f.input :is_active %> - <%= f.input :gateway_communication_type %> - <%= f.input :gateway_url %> - <%= f.input :auth_token %> - <%= f.input :merchant_account_id %> - <%= f.input :additional_parameters %> + + <%= f.input :gateway_communication_type,:class=>'gateway_type', collection: [ "Api", "Default", "Device"] %> + <%= f.input :gateway_url ,:class=>'gateway_type', :required => true %> + <%= f.input :auth_token ,:class=>'auth_token', :required => true %> + <%= f.input :merchant_account_id ,:class=>'merchant_id', :required => true%> + <%= f.input :additional_parameters, as: :text %> +
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> + <%= f.submit "Submit",:class => 'btn btn-primary submitBtn btn-lg waves-effect' %>
<% end %> @@ -50,4 +60,19 @@ - + \ No newline at end of file