Module: SpeedLightning::CheckoutLinkMethods
Instance Method Summary collapse
- #create_checkout_link(amount:, success_url:, currency: "SATS", metadata: { client: "ruby" }, is_phone_enabled: false, is_email_enabled: false, is_billing_address_enabled: false, is_shipping_address_enabled: false, livemode: false) ⇒ Object
- #retrieve_checkout_link(id) ⇒ Object
Methods included from Retryable
Instance Method Details
#create_checkout_link(amount:, success_url:, currency: "SATS", metadata: { client: "ruby" }, is_phone_enabled: false, is_email_enabled: false, is_billing_address_enabled: false, is_shipping_address_enabled: false, livemode: false) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/speed_lightning/checkout_link_methods.rb', line 8 def create_checkout_link( amount:, success_url:, currency: "SATS", metadata: { client: "ruby" }, is_phone_enabled: false, is_email_enabled: false, is_billing_address_enabled: false, is_shipping_address_enabled: false, livemode: false ) with_retry do body_hash = { amount: amount, success_url: success_url, currency: currency, metadata: , customer_collections_status: { is_email_enabled: is_email_enabled, is_phone_enabled: is_phone_enabled, is_billing_address_enabled: is_billing_address_enabled, is_shipping_address_enabled: is_shipping_address_enabled }, livemode: livemode } endpoint = "checkout-links" response = make_request(endpoint, :post, body_hash) CheckoutLink.new(response) end end |
#retrieve_checkout_link(id) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/speed_lightning/checkout_link_methods.rb', line 39 def retrieve_checkout_link(id) with_retry do endpoint = "checkout-links/" + id response = make_request(endpoint, :get) CheckoutLink.new(response) end end |