Skip to content

Commit 7218495

Browse files
author
Felipe Fiebig
authored
Merge pull request #55 from TransbankDevelopers/fix/fix-production-configuration
Fix production configuration
2 parents cd78ca9 + f092ef8 commit 7218495

File tree

16 files changed

+49
-25
lines changed

16 files changed

+49
-25
lines changed

lib/transbank/sdk/oneclick/mall/base.rb lib/transbank/sdk/oneclick/base.rb

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def configure_mall_for_testing
5151
@commerce_code = DEFAULT_ONECLICK_MALL_COMMERCE_CODE
5252
self.integration_type = :TEST
5353
end
54+
55+
def configure_mall_deferred_for_testing
56+
@api_key = DEFAULT_API_KEY
57+
@commerce_code = DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE
58+
self.integration_type = :TEST
59+
end
5460
end
5561
end
5662
end

lib/transbank/sdk/oneclick/mall/mall_inscription.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def delete(tbk_user:, user_name:, options: nil)
6060

6161
def default_integration_params
6262
{
63-
api_key: Oneclick::Base::DEFAULT_API_KEY,
64-
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_COMMERCE_CODE,
63+
api_key: Oneclick::Base.api_key,
64+
commerce_code: Oneclick::Base.commerce_code,
6565
integration_type: Oneclick::Base::integration_type,
6666
base_url: Oneclick::Base::current_integration_type_url
6767
}

lib/transbank/sdk/oneclick/mall/mall_transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def refund(buy_order:, child_commerce_code:, child_buy_order:, amount:,
8484

8585
def default_integration_params
8686
{
87-
api_key: Oneclick::Base::DEFAULT_API_KEY,
88-
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_COMMERCE_CODE,
87+
api_key: Oneclick::Base.api_key,
88+
commerce_code: Oneclick::Base.commerce_code,
8989
integration_type: Oneclick::Base::integration_type,
9090
base_url: Oneclick::Base::current_integration_type_url
9191
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require 'transbank/sdk/oneclick/mall/errors/oneclick_mall_errors'
22
require 'transbank/sdk/oneclick/mall/responses/oneclick_mall_responses'
3-
require 'transbank/sdk/oneclick/mall/base'
43
require 'transbank/sdk/oneclick/mall/mall_inscription'
54
require 'transbank/sdk/oneclick/mall/mall_transaction'

lib/transbank/sdk/oneclick/mall_deferred/mall_deferred_inscription.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class MallDeferredInscription < Transbank::Webpay::Oneclick::MallInscription
77
class << self
88
def default_integration_params
99
{
10-
api_key: Oneclick::Base::DEFAULT_API_KEY,
11-
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE,
10+
api_key: Oneclick::Base.api_key,
11+
commerce_code: Oneclick::Base.commerce_code,
1212
integration_type: Oneclick::Base::integration_type,
1313
base_url: Oneclick::Base::current_integration_type_url
1414
}

lib/transbank/sdk/oneclick/mall_deferred/mall_deferred_transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def capture(child_commerce_code:, child_buy_order:, authorization_code:, amount:
2929

3030
def default_integration_params
3131
{
32-
api_key: Oneclick::Base::DEFAULT_API_KEY,
33-
commerce_code: Oneclick::Base::DEFAULT_ONECLICK_MALL_DEFERRED_COMMERCE_CODE,
32+
api_key: Oneclick::Base.api_key,
33+
commerce_code: Oneclick::Base.commerce_code,
3434
integration_type: Oneclick::Base::integration_type,
3535
base_url: Oneclick::Base::current_integration_type_url
3636
}
+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
require 'transbank/sdk/oneclick/base'
12
require 'transbank/sdk/oneclick/errors/oneclick_error'
23
require 'transbank/sdk/oneclick/inscription/inscription'
34
require 'transbank/sdk/oneclick/mall/oneclick_mall'
45
require 'transbank/sdk/oneclick/mall_deferred/mall_deferred_transaction'
56
require 'transbank/sdk/oneclick/mall_deferred/mall_deferred_inscription'
7+
8+
module Transbank
9+
module Webpay
10+
module Oneclick; end
11+
end
12+
end

lib/transbank/sdk/patpass/patpass_by_webpay/transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def status(token:, options: nil)
6464

6565
def default_integration_params
6666
{
67-
api_key: PatpassByWebpay::Base::DEFAULT_API_KEY,
68-
commerce_code: PatpassByWebpay::Base::DEFAULT_COMMERCE_CODE,
67+
api_key: PatpassByWebpay::Base.api_key,
68+
commerce_code: PatpassByWebpay::Base.commerce_code,
6969
base_url: PatpassByWebpay::Base::current_integration_type_url
7070
}
7171
end

lib/transbank/sdk/patpass/patpass_comercio/inscription.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def status(token: ,options: nil)
6666

6767
def default_integration_params
6868
{
69-
api_key: Patpass::PatpassComercio::Base::DEFAULT_API_KEY,
70-
commerce_code: Patpass::PatpassComercio::Base::DEFAULT_COMMERCE_CODE,
69+
api_key: Patpass::PatpassComercio::Base.api_key,
70+
commerce_code: Patpass::PatpassComercio::Base.commerce_code,
7171
integration_type: Patpass::PatpassComercio::Base::integration_type,
7272
base_url: Patpass::PatpassComercio::Base::current_integration_type_url
7373
}

lib/transbank/sdk/transaccion_completa/mall/mall_transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def refund(token:, child_buy_order:, child_commerce_code:, amount:, options:nil)
116116

117117
def default_integration_params
118118
{
119-
api_key: TransaccionCompleta::Base::DEFAULT_API_KEY,
120-
commerce_code: TransaccionCompleta::Base::DEFAULT_MALL_COMMERCE_CODE,
119+
api_key: TransaccionCompleta::Base.api_key,
120+
commerce_code: TransaccionCompleta::Base.commerce_code,
121121
integration_type: TransaccionCompleta::Base::integration_type,
122122
base_url: TransaccionCompleta::Base::current_integration_type_url
123123
}

lib/transbank/sdk/transaccion_completa/transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def refund(token:, amount:, options:nil)
103103

104104
def default_integration_params
105105
{
106-
api_key: TransaccionCompleta::Base::DEFAULT_API_KEY,
107-
commerce_code: TransaccionCompleta::Base::DEFAULT_COMMERCE_CODE,
106+
api_key: TransaccionCompleta::Base.api_key,
107+
commerce_code: TransaccionCompleta::Base.commerce_code,
108108
integration_type: TransaccionCompleta::Base::integration_type,
109109
base_url: TransaccionCompleta::Base::current_integration_type_url
110110
}

lib/transbank/sdk/webpay/webpay_plus/base.rb

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ def configure_mall_for_testing
5555
@commerce_code = DEFAULT_MALL_COMMERCE_CODE
5656
self.integration_type = :TEST
5757
end
58+
59+
def configure_deferred_for_testing
60+
@api_key = DEFAULT_API_KEY
61+
@commerce_code = DEFAULT_DEFERRED_COMMERCE_CODE
62+
self.integration_type = :TEST
63+
end
64+
65+
def configure_mall_deferred_for_testing
66+
@api_key = DEFAULT_API_KEY
67+
@commerce_code = DEFAULT_MALL_DEFERRED_COMMERCE_CODE
68+
self.integration_type = :TEST
69+
end
5870
end
5971
end
6072
end

lib/transbank/sdk/webpay/webpay_plus/deferred/deferred_transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def capture(token:, buy_order:, authorization_code:, capture_amount:, options: n
9494

9595
def default_integration_params
9696
{
97-
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
98-
commerce_code: WebpayPlus::Base::DEFAULT_DEFERRED_COMMERCE_CODE,
97+
api_key: WebpayPlus::Base.api_key,
98+
commerce_code: WebpayPlus::Base::commerce_code,
9999
integration_type: WebpayPlus::Base::integration_type,
100100
base_url: WebpayPlus::Base::current_integration_type_url
101101
}

lib/transbank/sdk/webpay/webpay_plus/mall/mall_transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def status(token:, options: nil)
7575

7676
def default_integration_params
7777
{
78-
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
79-
commerce_code: WebpayPlus::Base::DEFAULT_MALL_COMMERCE_CODE,
78+
api_key: WebpayPlus::Base.api_key,
79+
commerce_code: WebpayPlus::Base.commerce_code,
8080
integration_type: WebpayPlus::Base::integration_type,
8181
base_url: WebpayPlus::Base::current_integration_type_url
8282
}

lib/transbank/sdk/webpay/webpay_plus/mall_deferred/mall_deferred_transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def capture(token:, child_commerce_code:, buy_order:, authorization_code:, captu
9696

9797
def default_integration_params
9898
{
99-
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
100-
commerce_code: WebpayPlus::Base::DEFAULT_MALL_DEFERRED_COMMERCE_CODE,
99+
api_key: WebpayPlus::Base.api_key,
100+
commerce_code: WebpayPlus::Base.commerce_code,
101101
integration_type: WebpayPlus::Base::integration_type,
102102
base_url: WebpayPlus::Base::current_integration_type_url
103103
}

lib/transbank/sdk/webpay/webpay_plus/transaction.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def status(token:, options: nil)
7575

7676
def default_integration_params
7777
{
78-
api_key: WebpayPlus::Base::DEFAULT_API_KEY,
79-
commerce_code: WebpayPlus::Base::DEFAULT_COMMERCE_CODE,
78+
api_key: WebpayPlus::Base.api_key,
79+
commerce_code: WebpayPlus::Base.commerce_code,
8080
integration_type: WebpayPlus::Base::integration_type,
8181
base_url: WebpayPlus::Base::current_integration_type_url
8282
}

0 commit comments

Comments
 (0)