Giter Club home page Giter Club logo

prestashop-plugin's Introduction

BTCPay Server - Prestashop Plugin

BTCPay Server

Accept Bitcoin payments within PrestaShop

Maintained GitHub Workflow Status GitHub License PRs are welcome GitHub contributors

GitHub release (latest SemVer) GitHub all releases

"This is lies, my trust in you is broken, I will make you obsolete" ๐Ÿ’š

Report a bug ยท Request a feature ยท FAQ


๐Ÿ”ง Requirements

Please ensure that you meet the following requirements before installing this plugin.

Tested successfully

  • Prestashop version 8.0 and 8.0.1
  • BTCPay server version 1.7.0 up to 1.7.3.0

Multistore

As of right now the module is not compatible with Prestashop's multistore feature.

๐Ÿ“— Documentation

Please check out our official website, complete documentation and FAQ for more details.

If you have trouble using BTCPay Server, consider joining communities listed on the official website to get help from other contributors. Only create a GitHub issue for technical issues you can't resolve through other channels or feature requests you've validated with other members of the community.

๐Ÿš€ Quick Start Guide

To get up and running with our plugin quickly, see the PrestaShop Guide on our documentation website.

๐Ÿง‘โ€๐Ÿ’ป Versioning

We use SemVer for versioning. For the versions available, see the releases within this repository.

๐Ÿค Contributing

BTCPay Server is built and maintained entirely by volunteer contributors around the internet. We welcome and appreciate new contributions.

Contributors looking to help out, before opening a pull request, please join our community chat or start a GitHub discussion to get early feedback, discuss the best ways to tackle the problem, and ensure there is no work duplication.

๐Ÿช PrestaShop Support

PrestaShop support can be found through its official channels.

  • Documentation - contains answers to commonly asked questions and provides instructions for almost everything. Including setup, management, etc.
  • Support Forums - the official Prestashop forum is a good place to find further answers and ask Prestashop related questions.

๐Ÿ“ License

BTCPay Server software, logo and designs are provided under MIT License.

prestashop-plugin's People

Contributors

bitcoinmitchell avatar dependabot[bot] avatar elahurd avatar gasteve avatar ionux avatar jaafit avatar jameswalpole avatar joshuaestes avatar kleetus avatar ndeet avatar nolaan avatar olinkl avatar philosodad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

sandu-c ndeet pitz36

prestashop-plugin's Issues

Add error handling on order/view when API 404 invoice-not-found

Is your feature request related to a problem? Please describe.
Due to a migration between BTCPay servers (with 1rst server lost, incl data), plugin can't fech the old invoices data.
Leading to a fatal error

An exception has been thrown during the rendering of a template ("Error during GET to https://btcpay.website.com/api/v1/stores/DHKa8TTypXFb9Xau9YU19aBiiFwFPYMMQXno6Lx13y6W/invoices/LAhsGNNLu7gFqFDvhp6S4E/payment-methods. Got response (404): {"code":"invoice-not-found","message":"The invoice was not found"}").
[Twig\Error\RuntimeError 0]

Describe the solution you'd like
Error handling, showing invoice as not found instead of raising uncaught 404 API call.

Wrong default parameter with new installation

Describe the bug
When I installed the BTCpay module, out of the box, I was having issue, where the code apparently tried to submit array into bool argument when creating the Configuration object.

To Reproduce
Steps to reproduce the behavior:

  1. Have a new PrestaShop 8.1.3
  2. Add BTCPay module
  3. Click configure
  4. See Error

Expected behavior
Configuration tab shows normally.

Screenshots
image

Your BTCPay Environment (please complete the following information):

  • BTCPay Server Version 1.12.4 (irrelevant for this issue)
  • Deployment Method: Presta - Docker, BTCPay - Start9
  • Browser Firefox

Logs (if applicable)
See image

Setup Parameters
Default

Additional context
It can be fixed by replacing a line in constants:
public const CONFIGURATION_SHARE_METADATA = 'BTCPAY_SHARE_METADATA';
with:
public const CONFIGURATION_SHARE_METADATA = false;

Legacy controller admin_btcpay_configure on prestashop 1.7.4 does not work

Describe the bug
Module does not invoke legacy controller admin_btcpay_cofigure because (I think) redirectAdmin calling symphony controllers does not work in prestashop 1.7.4. When you open configuration of the module, you get page not found.

The problem is in my opinion in controllers/admin/AdminConfigureBTCPayController.php (legacy controller), in:

Steps to reproduce the behavior:Tools::redirectAdmin($this->context->link->getAdminLink('BTCPay', true, array(
'route' => 'admin_btcpay_configure'
)));

I think there are two possible problems in this code:

  • I think modules do not route to symphony controllers in this version, because in prestashop guide developers say symphony controllers is implemented in modules from prestashop version 1.7.5.
  • Tools::redirectAdmin has different parameters in every version of prestashop, and I think the invocation in the module is from 1.7.5 or 1.7.7.

I do not know if there is another way to invoque redirectAdmin compatible with 1.7.4 and the module. I have been months trying to fix this module for my installation, because I can not upgrade PHP and prestashop in this machine (we have a lot of modifications and overloads and for upgrading our system we would have to rewrite a lot of code).

To Reproduce

  1. Upload module on prestashop 1.7.4 control panel.
  2. Click on 'Configure module'
  3. See 'page not found' error.

Expected behavior
The module configuration form to be loaded.

Your BTCPay Environment (please complete the following information):

  • BTCPay Server Version 1.3.6.0.
  • Deployment Method: Manual
  • Browser firefox, brave, chrome, falkon, ...

Additional context
I had to adapt module for php 7.0 for my installation, erasing php function return types in declarations, but this do not afect this issue, because code loads and problem is whith prestashop routes.

Thanks in advance.

Edu.

Error 504

BTCPay PrestaShop plugin is a bridge between your server (payment processor) and your e-commerce store. No matter if you're using a self-hosted or third-party solution from step 2, the pairing process is identical.

  1. In the BTCPay server url-field, enter the full URL of your host (including the https) โ€“ https://btcpay.mydomain.com
  2. Select the default transaction speed (this will change how much BTCPay recommends as transaction fee)
  3. Select the relevant order mode for your store (order is created before or after payment)
  4. Go to your BTCPay server, select a store, open its settings and select "Access Tokens".
  5. Click on "Create a new token", select your store and then approve. 5.1. You will see: "Server initiated pairing code: XXXX".
  6. Enter your pairing code.
  7. Press save. Prestashop will now attempt to make a connection with your BTCPayServer.
  8. A message will be shown if the connection was successful.
  9. It's recommended to do a test purchase.

Point 4 to 6 I don't know how to do. In the module version 1.0.1 (5.0) not to be the same use.
Can I do the point 4 and 5 but the 6 I don't know where I have to put the pairing code?

I do the installation but when my PrestaShop try to connect doesn't work revert a 504 error.

Error

Hi i have a problem with Plugin Prestashop:
```
This value should not be empty.
This value should not be empty.
This plugin expects all passed permissions to be given. Remove the new API key and try again.

Plugin [Release v5.1.5](https://github.com/btcpayserver/prestashop-plugin/releases/tag/v5.1.5)
Prestashop Version 1.7.8.6

Upgrade module for Prestashop lastest (1.7.8.3)

Is your feature request related to a problem? Please describe.
Trying to use the module with prestashop v1.7.8.3, it doesn't create the order anymore.
Got "There is no order that we can process" error after payment validation.

Describe the solution you'd like
Fix module order creation

Feature request: Add option to protect order status

Is your feature request related to a problem? Please describe.
Under certain circumstances it could happen that a merchant manually changed the order status to processing or completed and in this case they might want no automatic change of order status anymore.

Describe the solution you'd like
Add an option (or consider making it by default) that the statuses of processing or complete are protected and webhook events are unable to change the order status. We should still add some note to the order notes in this case.

Additional context
Taken from: btcpayserver/woocommerce-greenfield-plugin#31

Fatal error: Uncaught Error: Class 'btcpaypaymentModuleFrontController' not found

PrestaShop 1.7.7.0

Fatal error: Uncaught Error: Class 'btcpaypaymentModuleFrontController' not found in /var/www/prestashop/classes/controller/Controller.php:233 Stack trace: #0
/var/www/prestashop/classes/Dispatcher.php(510): ControllerCore::getController('btcpaypaymentMo...') #1 /var/www/prestashop/index.php(28): DispatcherCore->dispatch() #2
{main} thrown in /var/www/prestashop/classes/controller/Controller.php on line 233

Add multistore support

Is your feature request related to a problem? Please describe.
Currently the module does not support Prestashop's multistore feature. This means that once you've connected the module to a BTCPay Server, that server (and selected store) will always be used.

Describe the solution you'd like
Configuration related to the module should be stored in a multistore compatible way.

Sketch/Image/Wireframe/Mockup
A nice detailed write-up about how to develop multistore modules can be found here: How to develop MultiStore compatible module in Prestashop.

Critical error : Could not load order - Order after payment

Describe the bug
With order after payment option, I have a lot of critical errors.
Seems like a lot of orders failed to load after payment failure.

To Reproduce
Steps to reproduce the behavior:

  1. Setup "Order after payment"
  2. Fail to pay the invoice on time
  3. Get redirected to redirect url
  4. See error

Expected behavior
Get redirected to main webpage / catch the error instead raising major failure.

Your BTCPay Environment (please complete the following information):

  • BTCPay Server Version : BTCPay Server v1.5.1.0 (Altcoins)
  • Deployment Method: Docker

Logs (if applicable)
image

Cannot select BTCPayserver in Payment Preferences

Hello guys!

Prestashop 1.7.8.7
BTCPay Server - Prestashop module (v5.2.0)
PHP 7.4
BTCPayServer 1.7.1

Installation went smoothly. API set, shop and user configured. The problem is that I cannot enable BTCPayServer for any currency.
On the image below you can see that I can select Bank Transfer for any of the shop currency but in the same time you can see there is no selector for BTCPayServer. Tried to install/uninstall it. All other payment modules appears to be OK.

image

Create prestashop order after invoice paid

Is your feature request related to a problem? Please describe.
Cryptocurrency payment gateway have a high rate of failure. A lot of people just give out, leaving unpaid order on prestashop dashboard.
On medium shop, it's 10/15 orders cancelled per day due to crypto payment failure.

Describe the solution you'd like
Create order after invoice paid webhook (need fallback mechanism)
or implement kind of order deletion / hiding process when payment failed.

Idea: Extend sanity checks

We already sanity check the PHP version and BTCPay Server version, but it might be smart to extend these checks even further.

Possible checks:

  • Ensure that no relevant core classes are overwritten
  • Ensure all expected PHP extensions are available to us
  • Ensure that we have internet access
  • Ensure a proper domain is configured
  • Ensure HTTPS is configured (and potentially enforced)
    • HTTPS is required for the frontend controllers, so this is technically a must.

This could help decrease the amount of issue people have by showing them upfront what is wrong with their PrestaShop installation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.