Files
sx-fc/lib/tasks/payment.rake
Thein Lin Kyaw 9f3cd7591f prawn text
2020-07-10 10:22:30 +06:30

23 lines
672 B
Ruby

namespace :payment do
task :create => :environment do
payment_method_settings = PaymentMethodSetting.where(payment_method: 'PAYMAL')
payment_method_settings.each do |payment|
MembershipAction.create(
{ membership_type: "create_payment",
is_active: 1,
gateway_url: "/api/create_payment",
merchant_account_id: payment.merchant_account_id,
auth_token: payment.auth_token,
shop_code: payment.shop_code
}
)
end
payment_method_settings.update_all({
gateway_url: nil,
merchant_account_id: nil,
auth_token: nil })
# payment_method_settings.delete_all
end
end