Class: PaymentGateway::ForAll::Card

Inherits:
Base
  • Object
show all
Defined in:
lib/payment_gateway/for_all/card.rb

Instance Method Summary collapse

Constructor Details

#initialize(card_data) ⇒ Card

"type": 1,
"cardholderName": "JOHN SMITH",
"cardNumber": "4024007126652816",
"expirationDate": "0119",
"securityCode": "123"



12
13
14
# File 'lib/payment_gateway/for_all/card.rb', line 12

def initialize(card_data)
  @card_data = card_data
end

Instance Method Details

#get_nonceObject



16
17
18
# File 'lib/payment_gateway/for_all/card.rb', line 16

def get_nonce
  request(:post, endpoint_nonce, body: build_card_body)
end

#get_tokenObject



20
21
22
23
# File 'lib/payment_gateway/for_all/card.rb', line 20

def get_token
  response = get_nonce
  request(:post, endpoint_token, body: build_get_token_body(response[:cardNonce]))
end