Class: JeraPayment::Parsers::Iugu::CreditCardParser

Inherits:
Object
  • Object
show all
Defined in:
lib/jera_payment/parsers/iugu/credit_card_parser.rb

Class Method Summary collapse

Class Method Details

.parse_payment_method(resource, credit_card_token_id) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/jera_payment/parsers/iugu/credit_card_parser.rb', line 20

def self.parse_payment_method(resource, credit_card_token_id)
  {
    token: credit_card_token_id,
    description: resource.description,
    set_as_default: true
  }
end

.parse_payment_token(resource) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jera_payment/parsers/iugu/credit_card_parser.rb', line 5

def self.parse_payment_token(resource)
  {
    account_id: resource&.customer&.&.present? ? resource&.customer&.&. : JeraPayment.,
    method: 'credit_card',
    test: resource.test,
    data: {
      number: resource.number,
      verification_value: resource.cvv,
      first_name: resource.first_name,
      last_name: resource.last_name,
      month: resource.month,
      year: resource.year
    }
  }
end