diff --git a/lib/paygate/profile.rb b/lib/paygate/profile.rb index 303238c..6bb05e2 100644 --- a/lib/paygate/profile.rb +++ b/lib/paygate/profile.rb @@ -19,7 +19,8 @@ def purchase(currency, amount) params = { profile_no: profile_no, mid: member.mid, goodcurrency: currency, - unitprice: amount }.delete_if { |_, v| v.blank? } + unitprice: amount } + params.compact! # Make request uri = URI(PURCHASE_URL) diff --git a/lib/paygate/transaction.rb b/lib/paygate/transaction.rb index 0e9fee8..e956b16 100644 --- a/lib/paygate/transaction.rb +++ b/lib/paygate/transaction.rb @@ -26,7 +26,7 @@ def refund(options = {}) params.merge!(options.slice(:amount)) params[:amount] ||= FULL_AMOUNT_IDENTIFIER params[:mb_serial_no] = options[:order_id] - params.delete_if { |_, v| v.blank? } + params.compact! # Make request uri = URI(self.class.refund_api_url)