From 58b06bc25b50c2eb7391da624d3d21f6345c6adc Mon Sep 17 00:00:00 2001 From: Michael Elfassy Date: Thu, 11 Oct 2018 21:32:00 -0400 Subject: [PATCH] remove credential2 and access key rom citrus --- Gemfile.lock | 2 +- lib/offsite_payments/integrations/citrus.rb | 5 ++--- test/unit/integrations/citrus/citrus_helper_test.rb | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9c6ed1551..eaa06d982 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -173,4 +173,4 @@ DEPENDENCIES thor BUNDLED WITH - 1.16.2 + 1.16.5 diff --git a/lib/offsite_payments/integrations/citrus.rb b/lib/offsite_payments/integrations/citrus.rb index 302472160..25db97bb6 100644 --- a/lib/offsite_payments/integrations/citrus.rb +++ b/lib/offsite_payments/integrations/citrus.rb @@ -21,8 +21,6 @@ def self.checksum(secret_key, payload_items ) class Helper < OffsitePayments::Helper mapping :order, 'merchantTxnId' mapping :amount, 'orderAmount' - mapping :account, 'merchantAccessKey' - mapping :credential2, 'secret_key' mapping :credential3, 'pmt_url' mapping :currency, 'currency' @@ -55,6 +53,7 @@ def initialize(order, account, options = {}) super add_field 'paymentMode', 'NET_BANKING' add_field 'reqtime', (Time.now.to_i * 1000).to_s + @secret_key = options[:credential2] end def form_fields @@ -63,7 +62,7 @@ def form_fields def generate_checksum checksum_fields = @fields["pmt_url"] + @fields["orderAmount"].to_s + @fields["merchantTxnId"] + @fields["currency"] - Citrus.checksum(@fields["secret_key"], checksum_fields ) + Citrus.checksum(@secret_key, checksum_fields ) end end diff --git a/test/unit/integrations/citrus/citrus_helper_test.rb b/test/unit/integrations/citrus/citrus_helper_test.rb index 1e51788b1..d5d851403 100644 --- a/test/unit/integrations/citrus/citrus_helper_test.rb +++ b/test/unit/integrations/citrus/citrus_helper_test.rb @@ -10,8 +10,6 @@ def setup def test_basic_helper_fields assert_equal '10', @helper.fields['orderAmount'] assert_equal 'ORD123', @helper.fields['merchantTxnId'] - assert_equal 'G0JW45KCS3630NX335YX', @helper.fields['merchantAccessKey'] - assert_equal '2c71a4ea7d2b88e151e60d9da38b2d4552568ba9', @helper.fields['secret_key'] assert_equal 'USD', @helper.fields['currency'] assert_equal 'gqwnliur74', @helper.fields['pmt_url'] assert_equal 'NET_BANKING', @helper.fields['paymentMode'] @@ -42,7 +40,7 @@ def test_address_mapping def test_unknown_address_mapping @helper.billing_address :farm => 'CA' - assert_equal 8, @helper.fields.size + assert_equal 6, @helper.fields.size end def test_form_fields