Class: PaymentGateway::ForAll::Card
- Defined in:
- lib/payment_gateway/for_all/card.rb
Instance Method Summary collapse
- #get_nonce ⇒ Object
- #get_token ⇒ Object
-
#initialize(card_data) ⇒ Card
constructor
{ “type”: 1, “cardholderName”: “JOHN SMITH”, “cardNumber”: “4024007126652816”, “expirationDate”: “0119”, “securityCode”: “123” }.
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_nonce ⇒ Object
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_token ⇒ Object
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 |