Class: VisaAcceptanceMergedSpec::TokenizedCardApi
- Defined in:
- lib/visa_acceptance_merged_spec/apis/tokenized_card_api.rb
Overview
TokenizedCardApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#delete_tokenized_card(tokenized_card_id, profile_id: nil) ⇒ ApiResponse
| | | | | --- | --- | --- | | The Network Token will attempt to be deleted from the card association and if successful the corresponding TMS Network Token will be deleted.
-
#get_tokenized_card(tokenized_card_id, profile_id: nil) ⇒ ApiResponse
| | | | | --- | --- | --- | |Tokenized Cards
A Tokenized Card represents a network token. -
#post_tokenized_card(body, profile_id: nil) ⇒ ApiResponse
| | | | | --- | --- | --- | |Tokenized cards
A Tokenized card represents a network token.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from VisaAcceptanceMergedSpec::BaseApi
Instance Method Details
#delete_tokenized_card(tokenized_card_id, profile_id: nil) ⇒ ApiResponse
| | | | | --- | --- | --- | | The Network Token will attempt to be deleted from the card association and if successful the corresponding TMS Network Token will be deleted. tokenized card. containing user specific TMS configuration.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/visa_acceptance_merged_spec/apis/tokenized_card_api.rb', line 114 def delete_tokenized_card(tokenized_card_id, profile_id: nil) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/tms/v2/tokenized-cards/{tokenizedCardId}', Server::DEFAULT) .template_param(new_parameter(tokenized_card_id, key: 'tokenizedCardId') .is_required(true) .should_encode(true)) .header_param(new_parameter(profile_id, key: 'profile-id')) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('BearerAuth', 'Accept'))) .response(new_response_handler .is_response_void(true) .is_api_response(true) .local_error('403', 'Forbidden: e.g. The profile might not have permission to'\ ' perform the operation.', DeleteTokenizedCardException1Exception) .local_error('404', 'Token Not Found. The Id may not exist or was entered'\ ' incorrectly.', DeleteTokenizedCardException21Exception) .local_error('409', 'Conflict. The token is linked to a Payment Instrument.', DeleteTokenizedCardException31Exception) .local_error('410', 'Token Not Available. The token has been deleted.', DeleteTokenizedCardException41Exception) .local_error('424', 'Failed Dependency: e.g. The profile represented by the'\ ' profile-id may not exist or the profile-id was entered'\ ' incorrectly.', DeleteTokenizedCardException21Exception) .local_error('500', 'Unexpected error.', DeleteTokenizedCardException61Exception)) .execute end |
#get_tokenized_card(tokenized_card_id, profile_id: nil) ⇒ ApiResponse
| | | |
| --- | --- | --- |
|Tokenized Cards
A Tokenized Card represents a network token.
Network tokens perform better than regular card numbers and they are not
necessarily invalidated when a cardholder loses their card, or it expires.
tokenized card.
containing user specific TMS configuration.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/visa_acceptance_merged_spec/apis/tokenized_card_api.rb', line 67 def get_tokenized_card(tokenized_card_id, profile_id: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/tms/v2/tokenized-cards/{tokenizedCardId}', Server::DEFAULT) .template_param(new_parameter(tokenized_card_id, key: 'tokenizedCardId') .is_required(true) .should_encode(true)) .header_param(new_parameter(profile_id, key: 'profile-id')) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('BearerAuth', 'Accept'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetTokenizedCardResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request: e.g. A required header value could be missing.', GetTokenizedCardException1Exception) .local_error('403', 'Forbidden: e.g. The profile might not have permission to'\ ' perform the operation.', GetTokenizedCardException21Exception) .local_error('404', 'Token Not Found. The Id may not exist or was entered'\ ' incorrectly.', GetTokenizedCardException31Exception) .local_error('424', 'Failed Dependency: e.g. The profile represented by the'\ ' profile-id may not exist or the profile-id was entered'\ ' incorrectly.', GetTokenizedCardException31Exception) .local_error('500', 'Unexpected error.', GetTokenizedCardException51Exception)) .execute end |
#post_tokenized_card(body, profile_id: nil) ⇒ ApiResponse
| | | |
| --- | --- | --- |
|Tokenized cards
A Tokenized card represents a network token.
Network tokens perform better than regular card numbers and they are not
necessarily invalidated when a cardholder loses their card, or it expires.
description here
containing user specific TMS configuration.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/visa_acceptance_merged_spec/apis/tokenized_card_api.rb', line 19 def post_tokenized_card(body, profile_id: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/tms/v2/tokenized-cards', Server::DEFAULT) .header_param(new_parameter('application/json;charset=utf-8', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter(profile_id, key: 'profile-id')) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(And.new('BearerAuth', 'Accept'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PostTokenizedCardResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request: e.g. A required header value could be missing.', PostTokenizedCardException1Exception) .local_error('403', 'Forbidden: e.g. The profile might not have permission to'\ ' perform the operation.', PostTokenizedCardException21Exception) .local_error('409', 'Conflict. The token is linked to a Payment Instrument.', PostTokenizedCardException31Exception) .local_error('424', 'Failed Dependency: e.g. The profile represented by the'\ ' profile-id may not exist or the profile-id was entered'\ ' incorrectly.', PostTokenizedCardException41Exception) .local_error('500', 'Unexpected error.', PostTokenizedCardException51Exception)) .execute end |