Skip to content

Commit

Permalink
Merge pull request #55 from TransbankDevelopers/fix/fix-production-co…
Browse files Browse the repository at this point in the history
…nfiguration

Fix production configuration
  • Loading branch information
Felipe Fiebig authored Dec 3, 2020
2 parents cd78ca9 + f092ef8 commit 7218495
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def configure_mall_for_testing
@commerce_code = DEFAULT_ONECLICK_MALL_COMMERCE_CODE
self.integration_type = :TEST
end

def configure_mall_deferred_for_testing
@api_key = DEFAULT_API_KEY
@commerce_code = DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE
self.integration_type = :TEST
end
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/transbank/sdk/oneclick/mall/mall_inscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def delete(tbk_user:, user_name:, options: nil)

def default_integration_params
{
api_key: Oneclick::Base::DEFAULT_API_KEY,
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_COMMERCE_CODE,
api_key: Oneclick::Base.api_key,
commerce_code: Oneclick::Base.commerce_code,
integration_type: Oneclick::Base::integration_type,
base_url: Oneclick::Base::current_integration_type_url
}
Expand Down
4 changes: 2 additions & 2 deletions lib/transbank/sdk/oneclick/mall/mall_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def refund(buy_order:, child_commerce_code:, child_buy_order:, amount:,

def default_integration_params
{
api_key: Oneclick::Base::DEFAULT_API_KEY,
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_COMMERCE_CODE,
api_key: Oneclick::Base.api_key,
commerce_code: Oneclick::Base.commerce_code,
integration_type: Oneclick::Base::integration_type,
base_url: Oneclick::Base::current_integration_type_url
}
Expand Down
1 change: 0 additions & 1 deletion lib/transbank/sdk/oneclick/mall/oneclick_mall.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'transbank/sdk/oneclick/mall/errors/oneclick_mall_errors'
require 'transbank/sdk/oneclick/mall/responses/oneclick_mall_responses'
require 'transbank/sdk/oneclick/mall/base'
require 'transbank/sdk/oneclick/mall/mall_inscription'
require 'transbank/sdk/oneclick/mall/mall_transaction'
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class MallDeferredInscription < Transbank::Webpay::Oneclick::MallInscription
class << self
def default_integration_params
{
api_key: Oneclick::Base::DEFAULT_API_KEY,
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE,
api_key: Oneclick::Base.api_key,
commerce_code: Oneclick::Base.commerce_code,
integration_type: Oneclick::Base::integration_type,
base_url: Oneclick::Base::current_integration_type_url
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def capture(child_commerce_code:, child_buy_order:, authorization_code:, amount:

def default_integration_params
{
api_key: Oneclick::Base::DEFAULT_API_KEY,
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE,
api_key: Oneclick::Base.api_key,
commerce_code: Oneclick::Base.commerce_code,
integration_type: Oneclick::Base::integration_type,
base_url: Oneclick::Base::current_integration_type_url
}
Expand Down
7 changes: 7 additions & 0 deletions lib/transbank/sdk/oneclick/oneclick.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
require 'transbank/sdk/oneclick/base'
require 'transbank/sdk/oneclick/errors/oneclick_error'
require 'transbank/sdk/oneclick/inscription/inscription'
require 'transbank/sdk/oneclick/mall/oneclick_mall'
require 'transbank/sdk/oneclick/mall_deferred/mall_deferred_transaction'
require 'transbank/sdk/oneclick/mall_deferred/mall_deferred_inscription'

module Transbank
module Webpay
module Oneclick; end
end
end
4 changes: 2 additions & 2 deletions lib/transbank/sdk/patpass/patpass_by_webpay/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def status(token:, options: nil)

def default_integration_params
{
api_key: PatpassByWebpay::Base::DEFAULT_API_KEY,
commerce_code: PatpassByWebpay::Base::DEFAULT_COMMERCE_CODE,
api_key: PatpassByWebpay::Base.api_key,
commerce_code: PatpassByWebpay::Base.commerce_code,
base_url: PatpassByWebpay::Base::current_integration_type_url
}
end
Expand Down
4 changes: 2 additions & 2 deletions lib/transbank/sdk/patpass/patpass_comercio/inscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def status(token: ,options: nil)

def default_integration_params
{
api_key: Patpass::PatpassComercio::Base::DEFAULT_API_KEY,
commerce_code: Patpass::PatpassComercio::Base::DEFAULT_COMMERCE_CODE,
api_key: Patpass::PatpassComercio::Base.api_key,
commerce_code: Patpass::PatpassComercio::Base.commerce_code,
integration_type: Patpass::PatpassComercio::Base::integration_type,
base_url: Patpass::PatpassComercio::Base::current_integration_type_url
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def refund(token:, child_buy_order:, child_commerce_code:, amount:, options:nil)

def default_integration_params
{
api_key: TransaccionCompleta::Base::DEFAULT_API_KEY,
commerce_code: TransaccionCompleta::Base::DEFAULT_MALL_COMMERCE_CODE,
api_key: TransaccionCompleta::Base.api_key,
commerce_code: TransaccionCompleta::Base.commerce_code,
integration_type: TransaccionCompleta::Base::integration_type,
base_url: TransaccionCompleta::Base::current_integration_type_url
}
Expand Down
4 changes: 2 additions & 2 deletions lib/transbank/sdk/transaccion_completa/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def refund(token:, amount:, options:nil)

def default_integration_params
{
api_key: TransaccionCompleta::Base::DEFAULT_API_KEY,
commerce_code: TransaccionCompleta::Base::DEFAULT_COMMERCE_CODE,
api_key: TransaccionCompleta::Base.api_key,
commerce_code: TransaccionCompleta::Base.commerce_code,
integration_type: TransaccionCompleta::Base::integration_type,
base_url: TransaccionCompleta::Base::current_integration_type_url
}
Expand Down
12 changes: 12 additions & 0 deletions lib/transbank/sdk/webpay/webpay_plus/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ def configure_mall_for_testing
@commerce_code = DEFAULT_MALL_COMMERCE_CODE
self.integration_type = :TEST
end

def configure_deferred_for_testing
@api_key = DEFAULT_API_KEY
@commerce_code = DEFAULT_DEFERRED_COMMERCE_CODE
self.integration_type = :TEST
end

def configure_mall_deferred_for_testing
@api_key = DEFAULT_API_KEY
@commerce_code = DEFAULT_MALL_DEFERRED_COMMERCE_CODE
self.integration_type = :TEST
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def capture(token:, buy_order:, authorization_code:, capture_amount:, options: n

def default_integration_params
{
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
commerce_code: WebpayPlus::Base::DEFAULT_DEFERRED_COMMERCE_CODE,
api_key: WebpayPlus::Base.api_key,
commerce_code: WebpayPlus::Base::commerce_code,
integration_type: WebpayPlus::Base::integration_type,
base_url: WebpayPlus::Base::current_integration_type_url
}
Expand Down
4 changes: 2 additions & 2 deletions lib/transbank/sdk/webpay/webpay_plus/mall/mall_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def status(token:, options: nil)

def default_integration_params
{
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
commerce_code: WebpayPlus::Base::DEFAULT_MALL_COMMERCE_CODE,
api_key: WebpayPlus::Base.api_key,
commerce_code: WebpayPlus::Base.commerce_code,
integration_type: WebpayPlus::Base::integration_type,
base_url: WebpayPlus::Base::current_integration_type_url
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def capture(token:, child_commerce_code:, buy_order:, authorization_code:, captu

def default_integration_params
{
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
commerce_code: WebpayPlus::Base::DEFAULT_MALL_DEFERRED_COMMERCE_CODE,
api_key: WebpayPlus::Base.api_key,
commerce_code: WebpayPlus::Base.commerce_code,
integration_type: WebpayPlus::Base::integration_type,
base_url: WebpayPlus::Base::current_integration_type_url
}
Expand Down
4 changes: 2 additions & 2 deletions lib/transbank/sdk/webpay/webpay_plus/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def status(token:, options: nil)

def default_integration_params
{
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
commerce_code: WebpayPlus::Base::DEFAULT_COMMERCE_CODE,
api_key: WebpayPlus::Base.api_key,
commerce_code: WebpayPlus::Base.commerce_code,
integration_type: WebpayPlus::Base::integration_type,
base_url: WebpayPlus::Base::current_integration_type_url
}
Expand Down

0 comments on commit 7218495

Please sign in to comment.