btcpayserver / xenforo

MIT License
5 stars 4 forks source link

BTCPay Server Payment Provider – Accept Bitcoin payments in XenForo 2

BTCPay XenForo Banner

Maintained GitHub License GitHub contributors

GitHub release (latest SemVer) GitHub all releases

Requirements

Notes

Installation

  1. Download the add-on from the releases page
  2. Install the add-on via control panel or manually

Configuration

Payment Profile

  1. Go to XenForo Admin Panel (/admin.php)
  2. Click on [Setup] -> [Payment Profiles]
  3. Click on [Add Payment Profile]
  4. Choose "BTCPay Server" in the "Provider" dropdown
  5. Click on "Proceed..."
  6. In the field "Host", enter the full URL of your host (including the https) – https://btcpay.mydomain.com

Create API Key

  1. Go to your BTCPay Server
  2. Click on [Account] -> Manage Account on the bottom left
  3. Go to the tab "API Keys"
  4. Click [Generate Key]
  5. Check the following permissions:
    • Create an invoice (btcpay.store.cancreateinvoice)
    • View your stores (btcpay.store.canviewstoresettings)
  6. Below the permissions click on [Select specific stores] and select the store created already (this ensures the API key is restricted to this single store)
  7. Click on [Generate API Key]
  8. Copy the generated API Key to your BTCPay Server payment profile settings form

Setup Webhook

  1. Go to your BTCPay Server
  2. Click on [Settings]
  3. Go to the tab "Webhooks"
  4. Click [Create Webhook]
  5. Enter the following URL, replacing "https://mydomain.com" with your forum URL, in the "Payload URL" field: https://mydomain.com/payment_callback.php?_xfProvider=btcPayServer
  6. Below "Which events would you like to trigger this webhook?" choose "Send me specific events" and select "An invoice has been settled"
  7. Click on the eye icon near the "Secret" field and copy the secret to your BTCPay Server payment profile settings form
  8. Click on [Add Webhook]

Note: When testing a webhook, it may produce a 403 error - this is normal.

Payment Profile (continued)

  1. Go to your BTCPay Server
  2. Click on [Settings]
  3. Copy the "Store ID" to your BTCPay Server payment profile settings form
  4. Click on [Save]

Usage

You can use this integration wherever payment goes through XenForo payment profiles.

In most cases, a newly created payment profile requires activation in certain contexts. Let's look at an example of activating a newly created profile for user upgrades:

  1. Go to XenForo Admin Panel (/admin.php)
  2. Click on [Setup] -> [Users] -> [Users customization]-> [User upgrades]
  3. Click on the user upgrade you want to activate the payment profile for
  4. Select the payment profile you created in the "Payment profile" select box
  5. Click on [Save]