Git Product home page Git Product logo

shopware-6's Introduction

Wallee Payment for Shopware 6

The Wallee Payment plugin wraps around the Wallee API. This library facilitates your interaction with various services such as transactions. Please note that this plugin is for versions 6.5 and 6.6. For the 6.4 plugin please visit our Shopware 6.4 plugin.

Requirements

  • Shopware 6.5.x or Shopware 6.6.x. See table below.
  • PHP minimum version supported by the each shop version.

Supported versions


Shopware 6 version Plugin major version Supported until
Shopware 6.6.x 6.x Further notice
Shopware 6.5.x 5.x October 2024

Installation

You can use Composer or install manually

Composer

The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

composer require wallee/shopware-6
php bin/console plugin:refresh
php bin/console plugin:install --activate --clearCache WalleePayment

Update via composer

composer update wallee/shopware-6
php bin/console plugin:refresh
php bin/console plugin:install --activate --clearCache WalleePayment

Manual Installation

Alternatively you can download the package in its entirety. The Releases page lists all stable versions.

Uncompress the zip file you download, and include the autoloader in your project:

# unzip to ShopwareInstallDir/custom/plugins/WalleePayment
composer require wallee/sdk 4.2.0
php bin/console plugin:refresh
php bin/console plugin:install --activate --clearCache WalleePayment

Usage

The library needs to be configured with your account's space id, user id, and application key which are available in your Wallee account dashboard.

Logs and debugging

To view the logs please run the command below:

cd shopware/install/dir
tail -f var/log/wallee_payment*.log

Documentation

Documentation

License

Please see the license file for more information.

shopware-6's People

Contributors

alberto-wallee avatar alejandrososa avatar andrewrowanwallee avatar edgaraswallee avatar sauliususoniswallee avatar theodorspringwallee avatar victoralbala avatar vttn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

shopware-6's Issues

OrderNotFoundException does not exist in Shopware 6.5

We get the following error because your plugin is trying to load a Shopware Core class that does not exist anymore.
You should use \Shopware\Core\Checkout\Cart\CartException::orderNotFound instead. Please fix this as soon as possible.

Non existing class is e.g. used here:

throw new OrderNotFoundException($orderId);

See that in 6.4 this class was marked for removal in 6.5
https://github.com/shopware/shopware/blob/09f3075a9810dddde900207d9a05fd7a7be9f41c/src/Core/Checkout/Cart/Exception/OrderNotFoundException.php#L10

Error:
request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load class "OrderNotFoundException" from namespace "Shopware\Core\Checkout\Cart\Exception". Did you forget a "use" statement for another namespace?" at /sw6/vendor/store.shopware.com/cwbwalleepayment6/src/Core/Api/WebHooks/Controller/WebHookController.php line 359 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\ClassNotFoundError(code: 0): Attempted to load class \"OrderNotFoundException\" from namespace \"Shopware\\Core\\Checkout\\Cart\\Exception\".\nDid you forget a \"use\" statement for another namespace? at /sw6/vendor/store.shopware.com/cwbwalleepayment6/src/Core/Api/WebHooks/Controller/WebHookController.php:359)"} []

Billing address information is false in checkout

Shopware Version:
6.5.7.4
Wallee Plugin version:
5.0.7

Reproduce:

  1. Create Shopware Customer account in frontend
  2. Choose a billing address that is different from the shipping address
  3. Checkout with wallee credit card payment
  4. in the checkout screen it detects the billing address and shipping address as equal even though they are different
  5. The billing address is effectively hidden this way and the customer gets wrong information

This issues should be fixed with the following PR: #16

Cart is lost after payement failed with custom products

When the payement fails with an order that contain custom products, these custom product are not retrieved and shopware goes back to the home page with a message 'lineItem' is missing.

The issue is that in the method \CwbWalleePayment6\Core\Storefront\Checkout\Controller\CheckoutController::addCustomProducts

This :

$request->request = new RequestDataBag([
	'lineItems' => [
		'quantity'     => $orderItem->getQuantity(),
		'id'           => $product->getProductId(),
		'type'         => CustomProductsLineItemTypes::LINE_ITEM_TYPE_PRODUCT,
		'referencedId' => $product->getReferencedId(),
		'stackable'    => $orderItem->getStackable(),
		'removable'    => $orderItem->getRemovable(),
	],
]);

Should be replaced by this :

$request->request->add(
    [
        'lineItems' =>
            [
                $product->getProductId() =>
                    [
                        'quantity' => $orderItem->getQuantity(),
                        'id'           => $product->getProductId(),
                        'type'         => CustomProductsLineItemTypes::LINE_ITEM_TYPE_PRODUCT,
                        'referencedId' => $product->getReferencedId(),
                        'stackable'    => $orderItem->getStackable(),
                        'removable'    => $orderItem->getRemovable(),
                        ]
            ]
    ]
);

CountryStateEntity: Attempted to call an undefined method named "swaggerFormats"

Hi

There is an issue on the current version of the shopware 6 plugin.
Transactions can be created, because the TransactionService uses a method getCountryState on the customer address.

It expects a string value, but shopware returns an object.
https://github.com/shopware/shopware/blob/6e64e0f299b00b904f1d2dfecba0e0cfdff7869f/src/Core/Checkout/Customer/Aggregate/CustomerAddress/CustomerAddressEntity.php#L15

Screenshot 2024-01-26 at 14 04 58

This bug prevents the checkout page to load.

Screenshot 2024-01-26 at 12 02 53

I'm not sure what value of the object was used before, this issue is quite critical.

non-string product option breaks payment process

When the cart contains a cart item that has a custom option value which is NOT of type string (i.e int) a fatal error will arise, causing the payment process to fail.

request.CRITICAL: Uncaught PHP Exception TypeError: "WalleePayment\Core\Util\Payload\AbstractPayload::fixLength(): Argument #1 ($string) must be of type string, int given, called in [...]/vendor/wallee/shopware-6/src/Core/Util/Payload/TransactionPayload.php on line 402

The code expects all values to be of type string which is not necessarily the case.

Casting the value to string is safe and fixes the problem.

Headless: Successful payment - ordered not marked as paid?

I am not sure if this maybe requires webhooks, but I don't think it should. If I use a headless setup, then the order is not marked as successfully paid after the payment process has finished.

I guess your plugin bypasses the finalize payment URL by shopware and goes directly to the success URL?

The same for failed payments, those are not marked as canceled or similar either. However, that might be due to #6

or does this not work without webhooks at all? The transaction in wallee is marked as successful.

v5.0.1: composer.json is missing wallee/sdk dependency

Hi there,

the version 5.0.1 of the module currently does not require the wallee/sdk package (while 5.0.0 does). This makes v5.0.1 of the plugin non-functional.

{
    "errors": [
        {
            "code": "0",
            "status": "500",
            "title": "Internal Server Error",
            "detail": "Attempted to load class \u0022TransactionState\u0022 from namespace \u0022Wallee\\Sdk\\Model\u0022.\nDid you forget a \u0022use\u0022 statement for another namespace?"
        }
    ]
}

Looks like this requirement was simply forgotten? Manually composer requireing the wallee/sdk packages fixes the problem.

saleschannel product comparison has payment config in wallee

A product comparison channel does not have payment options when creating it, when installing wallee it creates payment options for product comparison channels.
the plugin should check for type of saleschannel and not create a configuration for saleschannels of type product comparison.

placing order fails because the module assumes there are deliveries while there are none

When placing an order a fatal error is thrown

Error:
Call to a member function getId() on null

  at vendor/wallee/shopware-6/src/Core/Api/Transaction/Service/TransactionService.php:313
  at WalleePayment\Core\Api\Transaction\Service\TransactionService->holdDelivery('018a659d017673f0a0b72e0673b48e80', object(Context))
     (vendor/wallee/shopware-6/src/Core/Api/Transaction/Service/TransactionService.php:172)
  at WalleePayment\Core\Api\Transaction\Service\TransactionService->create(object(AsyncPaymentTransactionStruct), object(SalesChannelContext))
     (vendor/wallee/shopware-6/src/Core/Checkout/PaymentHandler/WalleePaymentHandler.php:86)
  at WalleePayment\Core\Checkout\PaymentHandler\WalleePaymentHandler->pay(object(AsyncPaymentTransactionStruct), object(RequestDataBag), object(SalesChannelContext))
     (vendor/shopware/core/Checkout/Payment/Cart/PaymentTransactionChainProcessor.php:130)
  at Shopware\Core\Checkout\Payment\Cart\PaymentTransactionChainProcessor->process('018a659d017673f0a0b72e0673b48e80', object(RequestDataBag), object(SalesChannelContext), '/checkout/finish?orderId=018a659d017673f0a0b72e0673b48e80&changedPayment=1', '/account/order/edit/018a659d017673f0a0b72e0673b48e80')
     (vendor/shopware/core/Checkout/Payment/PaymentService.php:90)
  at Shopware\Core\Checkout\Payment\PaymentService->handlePaymentByOrder('018a659d017673f0a0b72e0673b48e80', object(RequestDataBag), object(SalesChannelContext), '/checkout/finish?orderId=018a659d017673f0a0b72e0673b48e80&changedPayment=1', '/account/order/edit/018a659d017673f0a0b72e0673b48e80')
     (vendor/shopware/core/Checkout/Payment/SalesChannel/HandlePaymentMethodRoute.php:46)
  at Shopware\Core\Checkout\Payment\SalesChannel\HandlePaymentMethodRoute->load(object(Request), object(SalesChannelContext))
     (vendor/shopware/storefront/Controller/AccountOrderController.php:281)
  at Shopware\Storefront\Controller\AccountOrderController->updateOrder('018a659d017673f0a0b72e0673b48e80', object(Request), object(SalesChannelContext))
     (vendor/symfony/http-kernel/HttpKernel.php:182)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true)
     (vendor/shopware/core/HttpKernel.php:143)
  at Shopware\Core\HttpKernel->doHandle(object(Request), 1, true)
     (vendor/shopware/core/HttpKernel.php:65)
  at Shopware\Core\HttpKernel->handle(object(Request))
     (public/index.php:85)                

This is caused by the plugin trying to hold the delivery of an order while - when placing an order - there most probably is none yet.

This leads to the error when trying to get the id of the latest delivery in an empty collection.

Checking for existance fixes the problem.

Used shopware version: v6.5.5.1
Used module version: 5.0.2

Headless: Failed payment fails as access to recreate cart route requires storefront

The current implementation for the failed behavior uses a storefront route/controller to recreate a cart, which is not possible with a headless installation.

Some options:

  • Improve the route to be available without storefront by e.g. assembling the sales channel contest / cart fully from the order.
    • see also the shopware finalize payment route, that should already work like that.
  • why is it even necessary to recreate the cart? normally shopware just reuses the order to pay. sure it is a nice option but it should be optionally and it should behave like Shopware default normally, then it shouldn't be an issue - just redirect to the correct failed URL / finalize URL instead.

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.