Class: HighLevel::Resources::Payments
- Defined in:
- lib/high_level/resources/payments.rb
Instance Method Summary collapse
-
#create_config(body:, location_id: nil, **_opts) ⇒ Object
Create new provider config.
-
#create_coupon(body:, **_opts) ⇒ Object
Create Coupon.
-
#create_integration(body:, location_id: nil, **_opts) ⇒ Object
Create new integration.
-
#create_integration_provider(body:, **_opts) ⇒ Object
Create White-label Integration Provider.
-
#create_order_fulfillment(order_id:, body:, **_opts) ⇒ Object
Create order fulfillment.
-
#custom_provider_marketplace_app_update_capabilities(body:, **_opts) ⇒ Object
Custom-provider marketplace app update capabilities.
-
#delete_coupon(body:, **_opts) ⇒ Object
Delete Coupon.
-
#delete_integration(location_id: nil, **_opts) ⇒ Object
Deleting an existing integration.
-
#disconnect_config(body:, location_id: nil, **_opts) ⇒ Object
Disconnect existing provider config.
-
#fetch_config(location_id: nil, **_opts) ⇒ Object
Fetch given provider config.
-
#get_coupon(alt_id: nil, alt_type: nil, id: nil, code: nil, **_opts) ⇒ Object
Fetch Coupon.
-
#get_order_by_id(order_id:, location_id: nil, alt_id: nil, **_opts) ⇒ Object
Get Order by ID.
-
#get_subscription_by_id(subscription_id:, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
Get Subscription by ID.
-
#get_transaction_by_id(transaction_id:, location_id: nil, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
Get Transaction by ID.
-
#list_coupons(alt_id: nil, alt_type: nil, limit: nil, offset: nil, status: nil, search: nil, **_opts) ⇒ Object
List Coupons.
-
#list_integration_providers(alt_id: nil, alt_type: nil, limit: nil, offset: nil, **_opts) ⇒ Object
List White-label Integration Providers.
-
#list_order_fulfillment(order_id:, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
List fulfillment.
-
#list_order_notes(order_id:, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
List Order Notes.
-
#list_orders(location_id: nil, alt_id: nil, status: nil, payment_status: nil, payment_mode: nil, start_at: nil, end_at: nil, search: nil, contact_id: nil, funnel_product_ids: nil, source_id: nil, limit: nil, offset: nil, **_opts) ⇒ Object
List Orders.
-
#list_subscriptions(alt_id: nil, alt_type: nil, entity_id: nil, payment_mode: nil, start_at: nil, end_at: nil, entity_source_type: nil, search: nil, contact_id: nil, id: nil, limit: nil, offset: nil, get_payments_collected_count: nil, **_opts) ⇒ Object
List Subscriptions.
-
#list_transactions(location_id: nil, alt_id: nil, alt_type: nil, payment_mode: nil, start_at: nil, end_at: nil, entity_source_type: nil, entity_source_sub_type: nil, search: nil, subscription_id: nil, entity_id: nil, contact_id: nil, limit: nil, offset: nil, **_opts) ⇒ Object
List Transactions.
-
#record_order_payment(order_id:, body:, **_opts) ⇒ Object
Record Order Payment.
-
#update_coupon(body:, **_opts) ⇒ Object
Update Coupon.
Methods inherited from Base
Constructor Details
This class inherits a constructor from HighLevel::Resources::Base
Instance Method Details
#create_config(body:, location_id: nil, **_opts) ⇒ Object
Create new provider config
API to create a new payment config for given location
253 254 255 256 257 258 259 260 261 |
# File 'lib/high_level/resources/payments.rb', line 253 def create_config(body:, location_id: nil, **_opts) request( method: :post, path: "/payments/custom-provider/connect", security: ["Location-Access"], params: { "locationId" => location_id }.compact, body: body ) end |
#create_coupon(body:, **_opts) ⇒ Object
Create Coupon
The “Create Coupon” API allows you to create a new promotional coupon with customizable parameters such as discount amount, validity period, usage limits, and applicable products. Use this endpoint to set up promotional offers and special discounts for your customers.
180 181 182 183 184 185 186 187 |
# File 'lib/high_level/resources/payments.rb', line 180 def create_coupon(body:, **_opts) request( method: :post, path: "/payments/coupon", security: ["Location-Access"], body: body ) end |
#create_integration(body:, location_id: nil, **_opts) ⇒ Object
Create new integration
API to create a new association for an app and location
216 217 218 219 220 221 222 223 224 |
# File 'lib/high_level/resources/payments.rb', line 216 def create_integration(body:, location_id: nil, **_opts) request( method: :post, path: "/payments/custom-provider/provider", security: ["Location-Access"], params: { "locationId" => location_id }.compact, body: body ) end |
#create_integration_provider(body:, **_opts) ⇒ Object
Create White-label Integration Provider
The “Create White-label Integration Provider” API allows adding a new payment provider integration to the system which is built on top of Authorize.net or NMI. Use this endpoint to create a integration provider with the specified details. Ensure that the required information is provided in the request payload. This endpoint can be only invoked using marketplace-app token
24 25 26 27 28 29 30 31 |
# File 'lib/high_level/resources/payments.rb', line 24 def create_integration_provider(body:, **_opts) request( method: :post, path: "/payments/integrations/provider/whitelabel", security: ["Location-Access"], body: body ) end |
#create_order_fulfillment(order_id:, body:, **_opts) ⇒ Object
Create order fulfillment
The “Order Fulfillment” API facilitates the process of fulfilling an order.
84 85 86 87 88 89 90 91 |
# File 'lib/high_level/resources/payments.rb', line 84 def create_order_fulfillment(order_id:, body:, **_opts) request( method: :post, path: "/payments/orders/#{order_id}/fulfillments", security: ["Location-Access"], body: body ) end |
#custom_provider_marketplace_app_update_capabilities(body:, **_opts) ⇒ Object
Custom-provider marketplace app update capabilities
Toggle capabilities for the marketplace app tied to the OAuth client
279 280 281 282 283 284 285 286 |
# File 'lib/high_level/resources/payments.rb', line 279 def custom_provider_marketplace_app_update_capabilities(body:, **_opts) request( method: :put, path: "/payments/custom-provider/capabilities", security: ["Location-Access"], body: body ) end |
#delete_coupon(body:, **_opts) ⇒ Object
Delete Coupon
The “Delete Coupon” API allows you to permanently remove a coupon from your system using its unique identifier. Use this endpoint to discontinue promotional offers or clean up unused coupons. Note that this action cannot be undone.
204 205 206 207 208 209 210 211 |
# File 'lib/high_level/resources/payments.rb', line 204 def delete_coupon(body:, **_opts) request( method: :delete, path: "/payments/coupon", security: ["Location-Access"], body: body ) end |
#delete_integration(location_id: nil, **_opts) ⇒ Object
Deleting an existing integration
API to delete an association for an app and location
229 230 231 232 233 234 235 236 |
# File 'lib/high_level/resources/payments.rb', line 229 def delete_integration(location_id: nil, **_opts) request( method: :delete, path: "/payments/custom-provider/provider", security: ["Location-Access"], params: { "locationId" => location_id }.compact ) end |
#disconnect_config(body:, location_id: nil, **_opts) ⇒ Object
Disconnect existing provider config
API to disconnect an existing payment config for given location
266 267 268 269 270 271 272 273 274 |
# File 'lib/high_level/resources/payments.rb', line 266 def disconnect_config(body:, location_id: nil, **_opts) request( method: :post, path: "/payments/custom-provider/disconnect", security: ["Location-Access"], params: { "locationId" => location_id }.compact, body: body ) end |
#fetch_config(location_id: nil, **_opts) ⇒ Object
Fetch given provider config
API for fetching an existing payment config for given location
241 242 243 244 245 246 247 248 |
# File 'lib/high_level/resources/payments.rb', line 241 def fetch_config(location_id: nil, **_opts) request( method: :get, path: "/payments/custom-provider/connect", security: ["Location-Access"], params: { "locationId" => location_id }.compact ) end |
#get_coupon(alt_id: nil, alt_type: nil, id: nil, code: nil, **_opts) ⇒ Object
Fetch Coupon
The “Get Coupon Details” API enables you to retrieve comprehensive information about a specific coupon using either its unique identifier or promotional code. Use this endpoint to view coupon parameters, usage statistics, validity periods, and other promotional details.
168 169 170 171 172 173 174 175 |
# File 'lib/high_level/resources/payments.rb', line 168 def get_coupon(alt_id: nil, alt_type: nil, id: nil, code: nil, **_opts) request( method: :get, path: "/payments/coupon", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type, "id" => id, "code" => code }.compact ) end |
#get_order_by_id(order_id:, location_id: nil, alt_id: nil, **_opts) ⇒ Object
Get Order by ID
The “Get Order by ID” API allows to retrieve information for a specific order using its unique identifier. Use this endpoint to fetch details for a single order based on the provided order ID.
48 49 50 51 52 53 54 55 |
# File 'lib/high_level/resources/payments.rb', line 48 def get_order_by_id(order_id:, location_id: nil, alt_id: nil, **_opts) request( method: :get, path: "/payments/orders/#{order_id}", security: ["Location-Access"], params: { "locationId" => location_id, "altId" => alt_id }.compact ) end |
#get_subscription_by_id(subscription_id:, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
Get Subscription by ID
The “Get Subscription by ID” API allows to retrieve information for a specific subscription using its unique identifier. Use this endpoint to fetch details for a single subscription based on the provided subscription ID.
144 145 146 147 148 149 150 151 |
# File 'lib/high_level/resources/payments.rb', line 144 def get_subscription_by_id(subscription_id:, alt_id: nil, alt_type: nil, **_opts) request( method: :get, path: "/payments/subscriptions/#{subscription_id}", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type }.compact ) end |
#get_transaction_by_id(transaction_id:, location_id: nil, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
Get Transaction by ID
The “Get Transaction by ID” API allows to retrieve information for a specific transaction using its unique identifier. Use this endpoint to fetch details for a single transaction based on the provided transaction ID.
120 121 122 123 124 125 126 127 |
# File 'lib/high_level/resources/payments.rb', line 120 def get_transaction_by_id(transaction_id:, location_id: nil, alt_id: nil, alt_type: nil, **_opts) request( method: :get, path: "/payments/transactions/#{transaction_id}", security: ["Location-Access"], params: { "locationId" => location_id, "altId" => alt_id, "altType" => alt_type }.compact ) end |
#list_coupons(alt_id: nil, alt_type: nil, limit: nil, offset: nil, status: nil, search: nil, **_opts) ⇒ Object
List Coupons
The “List Coupons” API allows you to retrieve a list of all coupons available in your location. Use this endpoint to view all promotional offers and special discounts for your customers.
156 157 158 159 160 161 162 163 |
# File 'lib/high_level/resources/payments.rb', line 156 def list_coupons(alt_id: nil, alt_type: nil, limit: nil, offset: nil, status: nil, search: nil, **_opts) request( method: :get, path: "/payments/coupon/list", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type, "limit" => limit, "offset" => offset, "status" => status, "search" => search }.compact ) end |
#list_integration_providers(alt_id: nil, alt_type: nil, limit: nil, offset: nil, **_opts) ⇒ Object
List White-label Integration Providers
The “List White-label Integration Providers” API allows to retrieve a paginated list of integration providers. Customize your results by filtering whitelabel integration providers(which are built directly on top of Authorize.net or NMI) based on name or paginate through the list using the provided query parameters. This endpoint provides a straightforward way to explore and retrieve integration provider information.
12 13 14 15 16 17 18 19 |
# File 'lib/high_level/resources/payments.rb', line 12 def list_integration_providers(alt_id: nil, alt_type: nil, limit: nil, offset: nil, **_opts) request( method: :get, path: "/payments/integrations/provider/whitelabel", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type, "limit" => limit, "offset" => offset }.compact ) end |
#list_order_fulfillment(order_id:, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
List fulfillment
List all fulfillment history of an order
72 73 74 75 76 77 78 79 |
# File 'lib/high_level/resources/payments.rb', line 72 def list_order_fulfillment(order_id:, alt_id: nil, alt_type: nil, **_opts) request( method: :get, path: "/payments/orders/#{order_id}/fulfillments", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type }.compact ) end |
#list_order_notes(order_id:, alt_id: nil, alt_type: nil, **_opts) ⇒ Object
List Order Notes
List all notes of an order
96 97 98 99 100 101 102 103 |
# File 'lib/high_level/resources/payments.rb', line 96 def list_order_notes(order_id:, alt_id: nil, alt_type: nil, **_opts) request( method: :get, path: "/payments/orders/#{order_id}/notes", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type }.compact ) end |
#list_orders(location_id: nil, alt_id: nil, status: nil, payment_status: nil, payment_mode: nil, start_at: nil, end_at: nil, search: nil, contact_id: nil, funnel_product_ids: nil, source_id: nil, limit: nil, offset: nil, **_opts) ⇒ Object
List Orders
The “List Orders” API allows to retrieve a paginated list of orders. Customize your results by filtering orders based on name, alt type, order status, payment mode, date range, type of source, contact, funnel products or paginate through the list using the provided query parameters. This endpoint provides a straightforward way to explore and retrieve order information.
36 37 38 39 40 41 42 43 |
# File 'lib/high_level/resources/payments.rb', line 36 def list_orders(location_id: nil, alt_id: nil, status: nil, payment_status: nil, payment_mode: nil, start_at: nil, end_at: nil, search: nil, contact_id: nil, funnel_product_ids: nil, source_id: nil, limit: nil, offset: nil, **_opts) request( method: :get, path: "/payments/orders", security: ["Location-Access"], params: { "locationId" => location_id, "altId" => alt_id, "status" => status, "paymentStatus" => payment_status, "paymentMode" => payment_mode, "startAt" => start_at, "endAt" => end_at, "search" => search, "contactId" => contact_id, "funnelProductIds" => funnel_product_ids, "sourceId" => source_id, "limit" => limit, "offset" => offset }.compact ) end |
#list_subscriptions(alt_id: nil, alt_type: nil, entity_id: nil, payment_mode: nil, start_at: nil, end_at: nil, entity_source_type: nil, search: nil, contact_id: nil, id: nil, limit: nil, offset: nil, get_payments_collected_count: nil, **_opts) ⇒ Object
List Subscriptions
The “List Subscriptions” API allows to retrieve a paginated list of subscriptions. Customize your results by filtering subscriptions based on name, alt type, subscription status, payment mode, date range, type of source, contact, subscription id, entity id, contact or paginate through the list using the provided query parameters. This endpoint provides a straightforward way to explore and retrieve subscription information.
132 133 134 135 136 137 138 139 |
# File 'lib/high_level/resources/payments.rb', line 132 def list_subscriptions(alt_id: nil, alt_type: nil, entity_id: nil, payment_mode: nil, start_at: nil, end_at: nil, entity_source_type: nil, search: nil, contact_id: nil, id: nil, limit: nil, offset: nil, get_payments_collected_count: nil, **_opts) request( method: :get, path: "/payments/subscriptions", security: ["Location-Access"], params: { "altId" => alt_id, "altType" => alt_type, "entityId" => entity_id, "paymentMode" => payment_mode, "startAt" => start_at, "endAt" => end_at, "entitySourceType" => entity_source_type, "search" => search, "contactId" => contact_id, "id" => id, "limit" => limit, "offset" => offset, "getPaymentsCollectedCount" => get_payments_collected_count }.compact ) end |
#list_transactions(location_id: nil, alt_id: nil, alt_type: nil, payment_mode: nil, start_at: nil, end_at: nil, entity_source_type: nil, entity_source_sub_type: nil, search: nil, subscription_id: nil, entity_id: nil, contact_id: nil, limit: nil, offset: nil, **_opts) ⇒ Object
List Transactions
The “List Transactions” API allows to retrieve a paginated list of transactions. Customize your results by filtering transactions based on name, alt type, transaction status, payment mode, date range, type of source, contact, subscription id, entity id or paginate through the list using the provided query parameters. This endpoint provides a straightforward way to explore and retrieve transaction information.
108 109 110 111 112 113 114 115 |
# File 'lib/high_level/resources/payments.rb', line 108 def list_transactions(location_id: nil, alt_id: nil, alt_type: nil, payment_mode: nil, start_at: nil, end_at: nil, entity_source_type: nil, entity_source_sub_type: nil, search: nil, subscription_id: nil, entity_id: nil, contact_id: nil, limit: nil, offset: nil, **_opts) request( method: :get, path: "/payments/transactions", security: ["Location-Access"], params: { "locationId" => location_id, "altId" => alt_id, "altType" => alt_type, "paymentMode" => payment_mode, "startAt" => start_at, "endAt" => end_at, "entitySourceType" => entity_source_type, "entitySourceSubType" => entity_source_sub_type, "search" => search, "subscriptionId" => subscription_id, "entityId" => entity_id, "contactId" => contact_id, "limit" => limit, "offset" => offset }.compact ) end |
#record_order_payment(order_id:, body:, **_opts) ⇒ Object
Record Order Payment
The “Record Order Payment” API allows to record a payment for an order. Use this endpoint to record payment for an order and update the order status to “Paid”.
60 61 62 63 64 65 66 67 |
# File 'lib/high_level/resources/payments.rb', line 60 def record_order_payment(order_id:, body:, **_opts) request( method: :post, path: "/payments/orders/#{order_id}/record-payment", security: ["Location-Access"], body: body ) end |
#update_coupon(body:, **_opts) ⇒ Object
Update Coupon
The “Update Coupon” API enables you to modify existing coupon details such as discount values, validity periods, usage limits, and other promotional parameters. Use this endpoint to adjust or extend promotional offers for your customers.
192 193 194 195 196 197 198 199 |
# File 'lib/high_level/resources/payments.rb', line 192 def update_coupon(body:, **_opts) request( method: :put, path: "/payments/coupon", security: ["Location-Access"], body: body ) end |