Module: Yoti::DynamicSharingService
- Defined in:
- lib/yoti/dynamic_share_service/share_url.rb,
lib/yoti/dynamic_share_service/dynamic_scenario.rb,
lib/yoti/dynamic_share_service/extension/extension.rb,
lib/yoti/dynamic_share_service/policy/wanted_anchor.rb,
lib/yoti/dynamic_share_service/policy/dynamic_policy.rb,
lib/yoti/dynamic_share_service/policy/wanted_attribute.rb,
lib/yoti/dynamic_share_service/policy/source_constraint.rb,
lib/yoti/dynamic_share_service/extension/transactional_flow_extension.rb,
lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb,
lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb
Defined Under Namespace
Classes: ApplicationNotFoundError, DynamicPolicy, DynamicPolicyBuilder, DynamicScenario, DynamicScenarioBuilder, Extension, ExtensionBuilder, InvalidDataError, LocationConstraintExtension, LocationConstraintExtensionBuilder, Share, SourceConstraint, SourceConstraintBuilder, ThirdPartyAttributeDefinition, ThirdPartyAttributeExtension, ThirdPartyAttributeExtensionBuilder, ThirdPartyAttributeExtensionContent, TransactionalFlowExtension, TransactionalFlowExtensionBuilder, UnknownHTTPError, WantedAnchor, WantedAnchorBuilder, WantedAttribute, WantedAttributeBuilder
Class Method Summary collapse
- .create_share_url(scenario) ⇒ Object
-
.create_share_url_endpoint ⇒ Object
deprecated
Deprecated.
no longer used - will be removed in 2.0.0
- .create_share_url_parse_response(response) ⇒ Object
-
.create_share_url_query ⇒ Object
deprecated
Deprecated.
no longer used - will be removed in 2.0.0
Class Method Details
.create_share_url(scenario) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/yoti/dynamic_share_service/share_url.rb', line 16 def self.create_share_url(scenario) yoti_request = Yoti::Request .builder .with_http_method('POST') .with_base_url(Yoti.configuration.api_endpoint) .with_endpoint("qrcodes/apps/#{Yoti.configuration.client_sdk_id}") .with_query_param('appId', Yoti.configuration.client_sdk_id) .with_payload(scenario) .build begin create_share_url_parse_response yoti_request.execute rescue Yoti::RequestError => e raise if e.response.nil? case e.response.code when '400' raise InvalidDataError when '404' raise ApplicationNotFoundError else raise UnknownHTTPError, e.response.code end end end |
.create_share_url_endpoint ⇒ Object
no longer used - will be removed in 2.0.0
71 72 73 |
# File 'lib/yoti/dynamic_share_service/share_url.rb', line 71 def self.create_share_url_endpoint "/qrcodes/apps/#{Yoti.configuration.client_sdk_id}" end |
.create_share_url_parse_response(response) ⇒ Object
42 43 44 |
# File 'lib/yoti/dynamic_share_service/share_url.rb', line 42 def self.create_share_url_parse_response(response) Share.new JSON.parse response.body end |
.create_share_url_query ⇒ Object
no longer used - will be removed in 2.0.0
66 67 68 |
# File 'lib/yoti/dynamic_share_service/share_url.rb', line 66 def self.create_share_url_query "?nonce=#{SecureRandom.uuid}×tamp=#{Time.now.to_i}" end |