Skip to content

Technical Plugin BTCPayments

Daniel Neto edited this page Oct 29, 2026 · 1 revision

Technical: BTCPayments plugin

Creates and reconciles Bitcoin invoices through the AVideo BTC marketplace.

Audience: developers, advanced administrators and AI-assisted diagnosis. Plugin catalog.

Source baseline

  • Review date: 2026-10-29. Method: static source analysis; runtime/provider behavior was not exercised.
  • Code ownership: AVideo Streamer repository.
  • Reported version: 1.1.
  • Source revision: 7d48f2dfc0289236718a3f9fba7c5ffecff4a37f.
  • Entry class file: BTCPayments.php.

Confirm the installed plugin version independently of the Streamer version. Configuration defaults below are not a dump of this installation's saved settings.

Behavior and operational checks

The plugin calls the marketplace bridge rather than a BTCPay instance directly. Polling and webhook delivery can trigger invoice reconciliation. Confirm invoice status, credited amount and access fulfillment separately; a confirming invoice is not a completed purchase.

Dependencies

Plugin Required by declaration Source reason
API Required Uses the API plugin object data for invoice/webhook processing
YPTWallet Optional Credits confirmed BTC payments to the user wallet balance

Literal runtime plugin references: API, PayPerView, PayPerViewLive, YPTWallet. These calls do not mean every referenced plugin is mandatory.

Hook integration

Override Implementation
getTags() BTCPayments.php:22
updateScript() BTCPayments.php:57
getPluginMenu() BTCPayments.php:89
profileTabName($users_id) BTCPayments.php:497
profileTabContent($users_id) BTCPayments.php:504
getHeadCode() BTCPayments.php:880

Configuration assignments

These are direct assignments inside getEmptyDataObject(), not evaluated effective defaults. Stored plugins.object_data, globals, structured values and conditional branches may alter runtime behavior. Private/default credential values are omitted.

Field Literal default or expression type Literal source label/help Evidence
siteWallet "" — source
siteWalletTest "tb1qdv8zs8c9ukr636gcmznz2pa8y5zxg7u8ghufkq" — source
BTCMarketPlaceKey Private setting; value omitted — source
useTestNet true — source

Files and request surface

This inventory distinguishes implementation files from an API specification. Includes, templates, callbacks and CLI workers are not interchangeable HTTP endpoints. Request-field names below are direct source references, not a complete schema or permission declaration.

File Source role Direct request fields observed
BTCPayments.php plugin entry class —
Objects/Btc_invoices.php class/helper implementation —
Objects/Btc_payments.php class/helper implementation —
View/Btc_invoices/add.json.php JSON entry point; inspect caller and guard amount_btc, amount_currency, created_php_time, currency, id, invoice_identification, json, modified_php_time, status, users_id
View/Btc_invoices/delete.json.php JSON entry point; inspect caller and guard id
View/Btc_invoices/index.php PHP page/include/worker; inspect caller —
View/Btc_invoices/index_body.php PHP page/include/worker; inspect caller —
View/Btc_invoices/list.json.php JSON entry point; inspect caller and guard draw
View/Btc_payments/add.json.php JSON entry point; inspect caller and guard amount_received_btc, btc_invoices_id, confirmations, created_php_time, id, json, modified_php_time, store, transaction_identification
View/Btc_payments/delete.json.php JSON entry point; inspect caller and guard id
View/Btc_payments/index.php PHP page/include/worker; inspect caller —
View/Btc_payments/index_body.php PHP page/include/worker; inspect caller —
View/Btc_payments/list.json.php JSON entry point; inspect caller and guard draw
View/editor.php PHP page/include/worker; inspect caller —
View/payments.php PHP page/include/worker; inspect caller plans_id, value
View/profileTabContent.php PHP page/include/worker; inspect caller —
checkout.php PHP page/include/worker; inspect caller invoice
checkoutStatus.json.php JSON entry point; inspect caller and guard invoice
install/install.sql schema/migration SQL —
invoice.php PHP page/include/worker; inspect caller value
payment-complete.php PHP page/include/worker; inspect caller invoice, order
receiveKeys.json.php JSON entry point; inspect caller and guard —
script.js browser/worker JavaScript; verify loader —
webhook.php PHP page/include/worker; inspect caller invoiceId

Data and migrations

Tables named in available CREATE TABLE statements: btc_invoices, btc_payments. Apply installation/update behavior through the owning plugin; this reference is not a script for running historical migrations manually.

Main-file named symbols

Visibility and implementation semantics must be checked in source. Nonempty string defaults are represented as . This is a symbol reference, not a stable public API promise.

Function or method Source
getPluginDependencies() 15
getTags() 22
getDescription() 32
getName() 42
getUUID() 47
getPluginVersion() 52
updateScript() 57
getEmptyDataObject() 63
getPluginMenu() 89
getMarketplaceURL($page) 104
getBitcoinNetwork(string $address): string 115
isValidAddress(string $address): bool 132
createBTCPayInvoice($amount, $users_id, $walletSplits = [], $metadata = array(), $redirectUrl = null, $throwOnError = false) 173
setUpPayment($total_cost = '<string>', $users_id, $metadata = array(), $redirectUrl = null) 290
processVerifiedInvoice($invoice, $notifyUser = true) 377
profileTabName($users_id) 497
profileTabContent($users_id) 504
getCheckoutPageURL($invoiceId) 515
startCheckout($usersId, array $request) 527
findOpenCheckout($usersId, $hash) 640
getInvoiceData($row) 679
fetchVerifiedInvoice($invoiceId) 695
reconcileInvoice($row, $notifyUser = false) 719
getBitcoinPaymentMethod(array $invoice) 731
getPublicInvoiceStatus($row) 744
checkIfIsAllGood() 864
getHeadCode() 880

Supporting PHP declarations

These symbols are grouped by source file; inspect the class declaration and visibility before calling them.

Objects/Btc_invoices.php

Declared classes: Btc_invoices.

Named symbol Source
getSearchFieldsNames() 11
getTableName() 16
getAllInvoice() 21
getAllUsers() 31
setId($id) 42
setInvoice_identification($invoice_identification) 46
setUsers_id($users_id) 50
setAmount_currency($amount_currency) 54
setAmount_btc($amount_btc) 58
setCurrency($currency) 62
setStatus($status) 66
setCreated_php_time($created_php_time) 70
setModified_php_time($modified_php_time) 74
setJson($json) 78
getId() 86
getInvoice_identification() 90
getUsers_id() 94
getAmount_currency() 98
getAmount_btc() 102
getCurrency() 106
getStatus() 110
getCreated_php_time() 114
getModified_php_time() 118
getJson() 122
getFromInvoice_identification($invoice_identification) 127
getIdOr0($invoice_identification) 146
getAllFromUser($users_id) 154
getRecentFromUser($users_id, $limit = 10) 170
getTotalFromUser($users_id) 182
save($notifySocket = false) 198

Objects/Btc_payments.php

Declared classes: Btc_payments.

Named symbol Source
getSearchFieldsNames() 11
getTableName() 16
getAllBtc_invoices() 21
getAllTransaction() 31
setId($id) 42
setBtc_invoices_id($btc_invoices_id) 46
setTransaction_identification($transaction_identification) 50
setAmount_received_btc($amount_received_btc) 54
setConfirmations($confirmations) 58
setCreated_php_time($created_php_time) 62
setModified_php_time($modified_php_time) 66
setJson($json) 70
setStore($store) 78
getId() 83
getBtc_invoices_id() 87
getTransaction_identification() 91
getAmount_received_btc() 95
getConfirmations() 99
getCreated_php_time() 103
getModified_php_time() 107
getJson() 111
getStore() 115
getFromInvoice_identification($btc_invoices_id) 120
getIdOr0($btc_invoices_id) 139

Diagnostics and validation

  1. Check the installed/enabled version and the dependencies/settings above.
  2. Identify the actual failing page, request, callback or worker and correlate its timestamp with the AVideo log.
  3. Follow the linked method and caller. Check business-state changes and output artifacts as well as HTTP status.
  4. Reproduce the relevant workflow in a test environment. External provider, Encoder, live-server, storage, payment and authenticated flows require their real integrations.

Related test filenames (name matches only; not executed by generation):

Shared diagnostic workflow. This page is not a security audit or a claim of end-to-end validation.

Clone this wiki locally