Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0964f344bd | ||
|
|
95c6cd53d9 | ||
|
|
1421168374 | ||
|
|
600a054314 | ||
|
|
bc934a0745 | ||
|
|
c5cd74e03f | ||
|
|
9e2475f415 | ||
|
|
488aea8771 | ||
|
|
0f31982616 | ||
|
|
c32776ba60 | ||
|
|
43636e52e3 |
|
Before Width: | Height: | Size: 107 KiB |
@ -1,87 +0,0 @@
|
||||
<html xmlns="http://www.w3.org/1999/html">
|
||||
<body>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">BTCPay Gateway</h2>
|
||||
<h3 class="oe_slogan">This is the module to connect Odoo 16.0 and Btcpay</h3>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BTCPayServer_org.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
This module allow you to create an easily way to accept Bitcoins
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Configure Payment Provider</h2>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
<ul>
|
||||
<li>Install BTCPay Module -> Website -> eCommerce -> Payment Acquirers -> BTCPay</li>
|
||||
<li>Put your facace. Best option is 'merchant'.</li>
|
||||
<li>Put the location as test or live url. Test example url: https://testnet.demo.btcpayserver.org</li>
|
||||
<li>Put the Confirmation URL where BTCpay will return after payment.</li>
|
||||
<li>Put your "Pairing Code" if you want that system get the "Token", after that "Pairing Code" will be deleted and the "Token" will appear in the corresponding field. You must safe the changes in order that this happens. NOTE: if you want to get new "Token" throw new "Pairing Code", please remove the "Token" field. Keep in mind that "Token" field must be in blank if you want to get throw the API.</li>
|
||||
<li>Put your "Token" if you have it and don't want to use Pairing Code to get it. Remember, if you want to get throw API please don't write anything here.</li>
|
||||
<li>If you have a Private Key you can write here otherwise system will get when you safe the Payment Provider </li>
|
||||
<li>Remember to Publish On Website</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BTCPayPaymentSettings.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">How it looks like?</h2>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BTCPayLooksLike.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
<ul>
|
||||
In payment webpage where payment methods appear, you will find new payment method called BTCPay.
|
||||
If you click on it you will be redirect to the server that you indicate in location field.
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Transaction BTCPay Details</h2>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
<ul>
|
||||
In transaction object, you will find more technical information about this method of payment:
|
||||
<li>Transaction Id: cryptocurrency transaction hash for the executed payout.</li>
|
||||
<li>Invoice Id: the id of the invoice for which you want to fetch an event token</li>
|
||||
<li>Transaction Status: That indicates state of transaction</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BtcpayTxDetails.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,14 +1,14 @@
|
||||
# payment_btcpay
|
||||
# BTCPay Server payment gateway for Odoo 16.0
|
||||
# BTCPay Server payment gateway for Odoo 16
|
||||
|
||||
## This is the module to connect Odoo 16.0 and BTCPay
|
||||
## This is the module to connect Odoo 16 and BTCPay Server
|
||||
This module allows you to accept bitcoin (and other cryptocurrency) payments in your Odoo e-commerce store.
|
||||

|
||||

|
||||
|
||||
## Install the module
|
||||
* Clone our [repository](https://github.com/btcpayserver/odoo) or download the .zip from the [releases page](https://github.com/btcpayserver/odoo/releases
|
||||
* Place the `payment_btcpay` directory in your Odoo addons directory
|
||||
* Install dependencies by running `pip install -r requirements.txt` (from inside the `payment_btcpay` directory)
|
||||
* Clone our [repository](https://github.com/btcpayserver/odoo) or download the .zip from the [releases page](https://github.com/btcpayserver/odoo/releases)
|
||||
* Make sure you are on branch `16.0` or downloaded a release tagged with version v16.x
|
||||
* Place the `payment_btcpayserver` directory in your Odoo addons directory
|
||||
* Install dependencies by running `pip install -r requirements.txt` (from inside the `payment_btcpayserver` directory)
|
||||
* Restart Odoo
|
||||
* Go to Apps -> Update Apps List
|
||||
* Remove the "Apps" filter and search for "btcpay"
|
||||
@ -21,7 +21,6 @@ This module allows you to accept bitcoin (and other cryptocurrency) payments in
|
||||
In the BTCPay settings form, tab "Credentials":
|
||||
* Set field "State" to enabled
|
||||
* Set field "BTCPay Server URL" as test or live URL including https://. Example URL: https://testnet.demo.btcpayserver.org
|
||||
* Set field "Confirmation URL" where the customer will return after payment
|
||||
* Get a pairing code from your BTCPay Server store: Settings -> Access Tokens
|
||||
* Click on "Create Token" button
|
||||
* Label: enter e.g. "My odoo store"
|
||||
@ -37,13 +36,13 @@ On the tab "Configuration":
|
||||
* Set field "Payment Journal" to "Bank", you can click the dropdown and click on the suggestion "Bank"
|
||||
* Now you can **save** the settings
|
||||
|
||||

|
||||

|
||||
|
||||
## How does the payment page look?
|
||||
|
||||
During the checkout the customers will have the option to select the payment method "Pay with Bitcoin / Lightning Network". After selecting they will be redirected to the BTCPay checkout page as shown below.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Transaction BTCPay Details
|
||||
@ -52,4 +51,8 @@ In transaction object, you will find more technical information about this metho
|
||||
* Invoice Id: the id of the invoice for which you want to fetch an event token
|
||||
* Transaction Status: That indicates state of transaction
|
||||
|
||||

|
||||

|
||||
|
||||
## Troubleshooting
|
||||
### The order and transaction status does not get updated to "paid"
|
||||
If the BTCPay connection generally works, like redirect to BTCPay checkout page (QR-code) then check your odoo logs and make sure PDF generation generally works. If there are errors mentioning wkhtmltopdf then you need to install `wkhtmltopdf` on your server.
|
||||
@ -7,8 +7,8 @@ from odoo.addons.payment import setup_provider, reset_payment_provider
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
setup_provider(cr, registry, 'btcpay')
|
||||
setup_provider(cr, registry, 'btcpayserver')
|
||||
|
||||
|
||||
def uninstall_hook(cr, registry):
|
||||
reset_payment_provider(cr, registry, 'btcpay')
|
||||
reset_payment_provider(cr, registry, 'btcpayserver')
|
||||
@ -1,7 +1,7 @@
|
||||
#******************************************************************************
|
||||
# PAYMENT BTCPAY FOR ODOO
|
||||
# PAYMENT BTCPAY SERVER FOR ODOO
|
||||
#
|
||||
# Copyright (C) 2023 Susanna Fort <susannafm@gmail.com>
|
||||
# Copyright (C) 2023 Susanna Fort <susannafm@gmail.com>, ndeet
|
||||
#
|
||||
#******************************************************************************
|
||||
#
|
||||
@ -20,23 +20,25 @@
|
||||
#******************************************************************************
|
||||
|
||||
{
|
||||
'name': 'Payment Provider: BTCPay',
|
||||
'name': 'Payment Provider: BTCPay Server',
|
||||
'summary': 'This module integrates BTCPAY - pay with Bitcoin - with Odoo v16.0',
|
||||
'author': 'Vandekul',
|
||||
'author': 'BTCPay Server team and contributors',
|
||||
'website': 'https://github.com/btcpayserver/odoo',
|
||||
'category': 'Accounting/Payment Providers',
|
||||
'version': '16.0.0',
|
||||
'version': '16.0.2.0',
|
||||
'license': 'GPL-3',
|
||||
'currency': 'USD',
|
||||
'application': False,
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'depends': ['base', 'account', 'payment'],
|
||||
'data': [
|
||||
'views/payment_btcpay_templates.xml',
|
||||
'views/payment_btcpayserver_templates.xml',
|
||||
'views/payment_provider_views.xml',
|
||||
'views/payment_transaction_views.xml',
|
||||
'data/payment_provider_data.xml',
|
||||
],
|
||||
'images': ['static/description/BTCPay-Odoo-16-featured.png'],
|
||||
'external_dependencies': {
|
||||
'python': ['btcpay-python']
|
||||
},
|
||||
@ -42,31 +42,34 @@ _logger = logging.getLogger(__name__)
|
||||
class BTCPayController(http.Controller):
|
||||
_checkout_url = '/btcpay/checkout'
|
||||
_notify_url = '/payment/btcpay/ipn'
|
||||
_return_url = '/payment/btcpay/return'
|
||||
|
||||
@http.route(_checkout_url, type='http', auth='public', csrf=False, website=True)
|
||||
def checkout(self, **data):
|
||||
|
||||
_logger.info("CHECKOUT: notification received from BTCPay with data:\n%s", pprint.pformat(data))
|
||||
tx_sudo = request.env['payment.transaction'].sudo()._get_tx_from_notification_data('btcpay', data)
|
||||
tx_sudo = request.env['payment.transaction'].sudo()._get_tx_from_notification_data('btcpayserver', data)
|
||||
provider = tx_sudo.provider_id
|
||||
notificationURL = str(data.get('notify_url')).replace("http://", "https://")
|
||||
notification_url = str(data.get('notify_url')).replace("http://", "https://")
|
||||
base_url = request.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||
redirect_url = urls.url_join(base_url, self._return_url)
|
||||
client = BTCPayClient(host=provider.btcpay_location, pem=provider.btcpay_privateKey, tokens={provider.btcpay_facade: provider.btcpay_token})
|
||||
invoice = client.create_invoice(
|
||||
{"price": data.get('amount'),
|
||||
"currency": data.get('currency_id'),
|
||||
"orderId": data.get('reference'),
|
||||
"token": provider.btcpay_token,
|
||||
"redirectURL": provider.btcpay_confirmationURL,
|
||||
"notificationURL": notificationURL,
|
||||
"redirectURL": redirect_url,
|
||||
"notificationURL": notification_url,
|
||||
"extendedNotifications": True,
|
||||
"buyer": {"email": data.get('email'),
|
||||
"buyer": {"email": data.get('email') or 'noemailavailable@example.com',
|
||||
"name": data.get('name'),
|
||||
"address1": data.get('street'),
|
||||
"locality": data.get('city'),
|
||||
"postalCode": data.get('zip'),
|
||||
"country": data.get('country'),
|
||||
"notify": False}})
|
||||
_logger.info('Invoice %s \n NOTIFY URL: %s', invoice, notificationURL)
|
||||
_logger.info('Invoice %s \n NOTIFY URL: %s', invoice, notification_url)
|
||||
return werkzeug.utils.redirect(invoice['url'])
|
||||
|
||||
@http.route(_notify_url, type='json', auth='public', csrf=False)
|
||||
@ -79,7 +82,7 @@ class BTCPayController(http.Controller):
|
||||
notification_data = {"reference": data['data']['orderId'],
|
||||
"invoiceID": data['data']['id']}
|
||||
# Check the origin and integrity of the notification
|
||||
tx_sudo = request.env['payment.transaction'].sudo()._get_tx_from_notification_data('btcpay', notification_data)
|
||||
tx_sudo = request.env['payment.transaction'].sudo()._get_tx_from_notification_data('btcpayserver', notification_data)
|
||||
provider = tx_sudo.provider_id
|
||||
client = BTCPayClient(host=provider.btcpay_location, pem=provider.btcpay_privateKey,
|
||||
tokens={provider.btcpay_facade: provider.btcpay_token})
|
||||
@ -93,7 +96,17 @@ class BTCPayController(http.Controller):
|
||||
"txid": fetched_invoice['url']}
|
||||
|
||||
# Handle the notification data
|
||||
tx_sudo._handle_notification_data('btcpay', notification_data)
|
||||
tx_sudo._handle_notification_data('btcpayserver', notification_data)
|
||||
except ValidationError: # Acknowledge the notification to avoid getting spammed
|
||||
_logger.exception("Unable to handle the notification data; skipping to acknowledge")
|
||||
return ''
|
||||
|
||||
@http.route(_return_url, type='http', auth="public", methods=['GET'], crsf=False, save_session=False)
|
||||
def btcpay_return_from_redirect(self, **data):
|
||||
""" BTCPay return
|
||||
|
||||
We could process and check the invoice status here but there is no need to as the status get's updated via
|
||||
IPN anyway, so just show the user the order confirmation / payment status page.
|
||||
"""
|
||||
_logger.info("BTCPay: user returned to shop after payment")
|
||||
return request.redirect('/payment/status')
|
||||
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="payment_provider_btcpay" model="payment.provider">
|
||||
<record id="payment_provider_btcpayserver" model="payment.provider">
|
||||
<field name="name">BTCPay payments</field>
|
||||
<field name="display_as">Pay with Bitcoin / Lightning Network</field>
|
||||
<field name="code">btcpay</field>
|
||||
<field name="image_128" type="base64" file="payment_btcpay/static/description/icon.png"/>
|
||||
<field name="module_id" ref="base.module_payment_btcpay"/>
|
||||
<field name="code">btcpayserver</field>
|
||||
<field name="image_128" type="base64" file="payment_btcpayserver/static/description/icon.png"/>
|
||||
<field name="module_id" ref="base.module_payment_btcpayserver"/>
|
||||
<field name="redirect_form_view_id" ref="redirect_form"/>
|
||||
</record>
|
||||
|
||||
@ -11,10 +11,9 @@ class PaymentProvider(models.Model):
|
||||
_inherit = 'payment.provider'
|
||||
|
||||
code = fields.Selection(
|
||||
selection_add=[('btcpay', "BTCPay")], ondelete={'btcpay': 'set default'})
|
||||
selection_add=[('btcpayserver', "BTCPay")], ondelete={'btcpayserver': 'set default'})
|
||||
|
||||
btcpay_location = fields.Char(string='BTCPay Server URL', size=64, help='URL where your BTCPay Server instance is reachable (where you log into your BTCPay Server).', default='https://testnet.demo.btcpayserver.org')
|
||||
btcpay_confirmationURL = fields.Char(string='Confirmation URL', help='Confirmation URL to return after BTCPay payment', default='http://yourdomain/shop/confirmation')
|
||||
btcpay_pairingCode = fields.Char(string='Pairing Code', help='Create paring Code in your BTCPay server and put here')
|
||||
|
||||
btcpay_token = fields.Char(string='Token', help='Access Token to BTCPay. Leave empty, will be autogenerated during pairing.')
|
||||
@ -22,14 +21,14 @@ class PaymentProvider(models.Model):
|
||||
btcpay_facade = fields.Char(string='Facade', help='Token facade type: merchant/pos/payroll. Keep merchant', default='merchant')
|
||||
|
||||
def create(self, values_list):
|
||||
if self.code == 'btcpay':
|
||||
if self.code == 'btcpayserver':
|
||||
values_list['btcpay_privateKey'] = crypto.generate_privakey()
|
||||
|
||||
return super(PaymentProvider, self).create(values_list)
|
||||
|
||||
@api.onchange('btcpay_pairingCode')
|
||||
def _onchange_pairingCode(self):
|
||||
if not self.btcpay_token and self.code == 'btcpay' and not self.btcpay_pairingCode == '':
|
||||
if not self.btcpay_token and self.code == 'btcpayserver' and not self.btcpay_pairingCode == '':
|
||||
#_logger.info("ONCHANGE PAIRING CODE***SELF: %s %s %s", self.btcpay_location, self.btcpay_privateKey, self.btcpay_pairingCode)
|
||||
self.btcpay_privateKey = crypto.generate_privkey()
|
||||
client = BTCPayClient(host=self.btcpay_location, pem=self.btcpay_privateKey)
|
||||
@ -38,14 +37,14 @@ class PaymentProvider(models.Model):
|
||||
|
||||
@api.onchange('btcpay_token')
|
||||
def _onchange_token(self):
|
||||
if self.code == 'btcpay':
|
||||
if self.code == 'btcpayserver':
|
||||
self.btcpay_pairingCode = ''
|
||||
#_logger.info("ONCHANGE TOKEN")
|
||||
|
||||
|
||||
@api.onchange('btcpay_location')
|
||||
def _onchange_location(self):
|
||||
if self.code == 'btcpay':
|
||||
if self.code == 'btcpayserver':
|
||||
self.btcpay_token = ''
|
||||
#_logger.info("ONCHANGE LOCATION ***SELF: %s %s %s", self.btcpay_location, self.btcpay_privateKey, self.btcpay_pairingCode)
|
||||
self.btcpay_privateKey = ''
|
||||
@ -32,7 +32,7 @@ class PaymentTransaction(models.Model):
|
||||
|
||||
res = super()._get_specific_rendering_values(processing_values)
|
||||
|
||||
if self.provider_code != 'btcpay':
|
||||
if self.provider_code != 'btcpayserver':
|
||||
return res
|
||||
|
||||
base_url = self.provider_id.get_base_url()
|
||||
@ -68,11 +68,11 @@ class PaymentTransaction(models.Model):
|
||||
"""
|
||||
tx = super()._get_tx_from_notification_data(provider_code, notification_data)
|
||||
_logger.info('GET TX FROM NOTIFICATION Notification_data %s', pprint.pformat(notification_data))
|
||||
if provider_code != 'btcpay' or len(tx) == 1:
|
||||
if provider_code != 'btcpayserver' or len(tx) == 1:
|
||||
return tx
|
||||
|
||||
reference = notification_data.get('reference')
|
||||
tx = self.search([('reference', '=', reference), ('provider_code', '=', 'btcpay')])
|
||||
tx = self.search([('reference', '=', reference), ('provider_code', '=', 'btcpayserver')])
|
||||
if not tx:
|
||||
raise ValidationError(
|
||||
"BTCPay: " + _("No transaction found matching reference %s.", reference)
|
||||
@ -102,7 +102,7 @@ class PaymentTransaction(models.Model):
|
||||
:raise: ValidationError if inconsistent data were received
|
||||
"""
|
||||
super()._process_notification_data(notification_data)
|
||||
if self.provider_code != 'btcpay':
|
||||
if self.provider_code != 'btcpayserver':
|
||||
return
|
||||
|
||||
_logger.info("_process_notification_data %s", pprint.pformat(notification_data))
|
||||
@ -115,15 +115,15 @@ class PaymentTransaction(models.Model):
|
||||
self.btcpay_txid = notification_data.get('txid')
|
||||
self.btcpay_status = notification_data.get('status')
|
||||
|
||||
if self.btcpay_status in ['paid']:
|
||||
if self.btcpay_status in ['paid','processing']:
|
||||
self._set_pending(state_message=notification_data.get('pending_reason'))
|
||||
elif self.btcpay_status in ['confirmed']:
|
||||
elif self.btcpay_status in ['confirmed', 'complete']:
|
||||
self._set_done()
|
||||
confirmed_orders = self._check_amount_and_confirm_order()
|
||||
confirmed_orders._send_order_confirmation_mail()
|
||||
elif self.btcpay_status in ['new']:
|
||||
self.btcpay_invoiceId = notification_data.get('invoiceID')
|
||||
elif self.btcpay_status in ['cancel']:
|
||||
elif self.btcpay_status in ['cancel','cancelled']:
|
||||
self._set_canceled()
|
||||
elif self.btcpay_status in ['invalid']:
|
||||
_logger.info(
|
||||
|
After Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
194
payment_btcpayserver/static/description/index.html
Normal file
@ -0,0 +1,194 @@
|
||||
<html xmlns="http://www.w3.org/1999/html">
|
||||
<body>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">BTCPay Server Gateway</h2>
|
||||
<h3 class="oe_slogan">This module allows you to accept Bitcoin / Lightning Network (and other cryptocurrency) payments in your Odoo e-commerce store.</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BTCPay-Odoo-16-featured.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_row oe_spaced">
|
||||
<p class="oe_mt32">
|
||||
BTCPay Server for Odoo is a revolutionary, self-hosted, open-source payment gateway to accept Bitcoin payments. Our seamless integration with Odoo allows you to connect your self-hosted BTCPay Server and start accepting Bitcoin payments in just a few simple steps.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Features</h2>
|
||||
<div class="oe_span12">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
<li><strong>Zero fees</strong>: Enjoy a payment gateway with no fees. Yes, really!</li>
|
||||
<li><strong>Fully automated system</strong>: BTCPay takes care of payments, invoice management and refunds automatically.</li>
|
||||
<li><strong>Display Bitcoin QR code at checkout</strong>: Enhance customer experience with an easy and secure payment option.</li>
|
||||
<li><strong>No middlemen or KYC</strong>:
|
||||
<ul>
|
||||
<li>Direct, P2P payments (going directly to your wallet)</li>
|
||||
<li>Say goodbye to intermediaries and tedious paperwork</li>
|
||||
<li>Transaction information is only shared between you and your customer</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Self-hosted infrastructure</strong>: Maintain full control over your payment gateway.</li>
|
||||
<li><strong>Direct wallet payments</strong>: Be your own bank with a self-custodial service.</li>
|
||||
<li><strong>Lightning Network</strong> integrated out of the box – instant, fast and low cost payments and payouts</li>
|
||||
<li><strong>Reporting and accounting</strong> – CSV exports</li>
|
||||
<li><strong>Advanced invoice managemen</strong>t and refunding integrated in the WooCommerce UI</li>
|
||||
<li><strong>Real-time exchange price tracking</strong> for correct payment amounts</li>
|
||||
<li><strong>Versatile plugin system</strong>:
|
||||
<ul>
|
||||
<li>Extend functionality according to your needs</li>
|
||||
<li>Accept payments in altcoins through various plugins</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Elegant checkout design</strong>: Compatible with all Bitcoin wallets and enhanced with your store’s logo and branding for a unique UX.</li>
|
||||
<li><strong>Point-of-sale</strong> integration – Accept payments in your physical shops</li>
|
||||
<li><strong>Multilingual ready</strong>: Serve a global audience right out of the box.</li>
|
||||
<li><strong>Top-notch privacy and security</strong>: Protect your and your customers’ data.</li>
|
||||
<li><strong>Community-driven support</strong>: Get responsive assistance from our dedicated community (<a href="http://chat.btcpayserver.org" rel="nofollow ugc">Mattermost</a> or <a href="https://t.me/btcpayserver" rel="nofollow ugc">Telegram</a>).</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Requirements</h2>
|
||||
<div class="oe_span12">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
<li>Odoo 16 running</li>
|
||||
<li>eCommerce module enabled</li>
|
||||
<li>You have a BTCPay Server version 1.10.0 or later, either <a href="https://docs.btcpayserver.org/Deployment/">self-hosted</a> or <a href="https://docs.btcpayserver.org/Deployment/ThirdPartyHosting/">hosted by a third-party</a></li>
|
||||
<li><a href="https://docs.btcpayserver.org/RegisterAccount/" class="">You've a registered account on the instance</a></li>
|
||||
<li><a href="https://docs.btcpayserver.org/CreateStore/" class="">You've a BTCPay store on the instance</a></li>
|
||||
<li><a href="https://docs.btcpayserver.org/WalletSetup/" class="">You've a wallet connected to your store</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Install the module</h2>
|
||||
<div class="oe_span12">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
<li>Clone our [repository](https://github.com/btcpayserver/odoo) or download the .zip from the [releases page](https://github.com/btcpayserver/odoo/releases)
|
||||
<li>Make sure you are on branch `16.0` or downloaded a release tagged with version v16.x
|
||||
<li>Place the `payment_btcpayserver` directory in your Odoo addons directory
|
||||
<li>Install dependencies by running `pip install -r requirements.txt` (from inside the `payment_btcpayserver` directory)
|
||||
<li>Restart Odoo
|
||||
<li>Go to Apps -> Update Apps List
|
||||
<li>Remove the "Apps" filter and search for "btcpay"
|
||||
<li>Click **Activate** button
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Configure BTCPay as payment provider</h2>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
<li>Go to <strong>Website</strong> -> <strong>Configuration</strong> -> <strong>Payment Providers</strong></li>
|
||||
<li>Search for BTCPay and click on button <strong>Activate</strong></li>
|
||||
</ul>
|
||||
|
||||
<p>In the BTCPay settings form, tab "Credentials":</p>
|
||||
<ul>
|
||||
<li>Set field "State" to enabled</li>
|
||||
<li>Set field "BTCPay Server URL" as test or live URL including https://. Example URL: <a href="https://testnet.demo.btcpayserver.org">https://testnet.demo.btcpayserver.org</a></li>
|
||||
<li>Get a pairing code from your BTCPay Server store: Settings -> Access Tokens
|
||||
<ul>
|
||||
<li>Click on "Create Token" button</li>
|
||||
<li>Label: enter e.g. "My odoo store"</li>
|
||||
<li>Public Key: leave empty</li>
|
||||
<li>Click on "Request Pairing" button, on next page click "Approve" button</li>
|
||||
<li>At the top copy the code next to "Server initiated pairing code", e.g. "hg7z8wN"</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Back in Odoo, paste the code into "Pairing Code" field</li>
|
||||
<li>Hit Tab key on your keyboard (or click on another field) and the pairing process will start automatically</li>
|
||||
<li>When the pairing is successful the "Token" and "Private Key" field will be filled automatically</li>
|
||||
<li>Field Facade, keep default 'merchant'.</li>
|
||||
</ul>
|
||||
|
||||
<p>On the tab "Configuration":</p>
|
||||
<ul>
|
||||
<li>Make sure field "Payment Journal" is set to "Bank", otherwise you can click the dropdown and click on the suggestion "Bank"</li>
|
||||
<li>Now you can <strong>save</strong> the settings</li>
|
||||
</ul>
|
||||
|
||||
<p>Check the payment method is enabled:</p>
|
||||
<ul>
|
||||
<li>Go to <strong>Website</strong> -> <strong>Configuration</strong> -> <strong>Payment Methods</strong></li>
|
||||
<li>Make sure "Pay with Bitcoin / Lightning Network" is active</li>
|
||||
</ul>
|
||||
|
||||
<p>Congrats, all done. Do some testing to be sure all works.</p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BTCPayPaymentSettings.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">How it looks like?</h2>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BTCPayLooksLike.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
In payment webpage where payment methods appear, you will find new payment method called BTCPay.
|
||||
If you click on it you will be redirect to the server that you indicate in location field.
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan">Transaction BTCPay Details</h2>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
In transaction object, you will find more technical information about this method of payment:
|
||||
<li>Transaction Id: cryptocurrency transaction hash for the executed payout.</li>
|
||||
<li>Invoice Id: the id of the invoice for which you want to fetch an event token</li>
|
||||
<li>Transaction Status: That indicates state of transaction</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img src="BtcpayTxDetails.png" class="oe_picture oe_screenshot">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -7,12 +7,11 @@
|
||||
<field name="inherit_id" ref="payment.payment_provider_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="provider_credentials" position='inside'>
|
||||
<group attrs="{'invisible': [('code', '!=', 'btcpay')]}">
|
||||
<group attrs="{'invisible': [('code', '!=', 'btcpayserver')]}">
|
||||
<field name="btcpay_location"/>
|
||||
<field name="btcpay_confirmationURL"/>
|
||||
<field name="btcpay_pairingCode"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('code', '!=', 'btcpay')]}">
|
||||
<group attrs="{'invisible': [('code', '!=', 'btcpayserver')]}">
|
||||
<field name="btcpay_token"/>
|
||||
<field name="btcpay_privateKey"/>
|
||||
<field name="btcpay_facade"/>
|
||||