-
Notifications
You must be signed in to change notification settings - Fork 52
/
test_card_token.rb
39 lines (35 loc) · 1.07 KB
/
test_card_token.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# typed: true
# frozen_string_literal: true
require_relative '../lib/mercadopago'
require 'minitest/autorun'
class CardToken < Minitest::Test
def test_method_get_id
sdk = Mercadopago::SDK.new('APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966')
card_token_object = {
card_number: '5031433215406351',
expiration_year: 2025,
expiration_month: 11,
security_code: '123',
cardholder: {
name: 'APRO'
}
}
result_card_token = sdk.card_token.create(card_token_object)
result = sdk.card_token.get(result_card_token[:response]['id'])
assert_equal 200, result[:status]
end
def test_method_post
sdk = Mercadopago::SDK.new('APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966')
card_token_object = {
card_number: '5031433215406351',
expiration_year: 2025,
expiration_month: 11,
security_code: '123',
cardholder: {
name: 'APRO'
}
}
result = sdk.card_token.create(card_token_object)
assert_equal 201, result[:status]
end
end