Skip to content

Commit add5888

Browse files
committed
Remove Hash#slice for Ruby 2.4 support
1 parent fc89d57 commit add5888

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/stripe_mock/data.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,7 @@ def self.mock_payment_intent(params = {})
11691169
def self.mock_payment_method(params = {})
11701170
payment_method_id = params[:id] || 'pm_1ExEuFL2DI6wht39WNJgbybl'
11711171

1172+
type = params[:type].to_sym
11721173
data = {
11731174
card: {
11741175
brand: 'visa',
@@ -1200,7 +1201,7 @@ def self.mock_payment_method(params = {})
12001201
fingerprint: 'FD81kbVPe7M05BMj',
12011202
last4: '3000'
12021203
}
1203-
}.slice(params[:type].to_sym)
1204+
}
12041205

12051206
{
12061207
id: payment_method_id,
@@ -1223,7 +1224,7 @@ def self.mock_payment_method(params = {})
12231224
metadata: {
12241225
order_id: '123456789'
12251226
}
1226-
}.merge(data).merge(params)
1227+
}.merge(type => data[type]).merge(params)
12271228
end
12281229

12291230
def self.mock_setup_intent(params = {})

0 commit comments

Comments
 (0)