Class: Bakong::OpenApi::Resources::Deeplinks
- Defined in:
- lib/bakong/open_api/resources/deeplinks.rb
Overview
‘POST /v1/generate_deeplink_by_qr` — turn a KHQR string into a short link the user’s wallet app can open directly.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#generate(qr:, source_info: nil) ⇒ Hash
{ short_link: “https://…” }.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Bakong::OpenApi::Resources::Base
Instance Method Details
#generate(qr:, source_info: nil) ⇒ Hash
Returns { short_link: “https://…” }.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/bakong/open_api/resources/deeplinks.rb', line 20 def generate(qr:, source_info: nil) if source_info && !source_info.complete? raise MissingFieldsError.new( "source_info requires app_icon_url, app_name, and app_deep_link_callback", error_code: 5 ) end body = { qr: qr } body[:source_info] = source_info.to_payload if source_info submit("/v1/generate_deeplink_by_qr", body) end |