Skip to content

Commit

Permalink
Merge pull request #304 from activemerchant/remove_credential2_from_c…
Browse files Browse the repository at this point in the history
…itrus

remove credential2 from citrus
  • Loading branch information
elfassy authored Oct 12, 2018
2 parents c99d590 + 58b06bc commit 9819ce9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ DEPENDENCIES
thor

BUNDLED WITH
1.16.2
1.16.5
5 changes: 2 additions & 3 deletions lib/offsite_payments/integrations/citrus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 1 addition & 3 deletions test/unit/integrations/citrus/citrus_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9819ce9

Please sign in to comment.