What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello everyone. We have already created a custom payment module at the project level. Is it possibl

U01HX2U4NLQ
U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello everyone.

We have already created a custom payment module at the project level. Is it possible to offer the custom payment module via composer library (under vendor folder)? If yes, do we need to specify any dependency particularly in composer.json? and to consider the custom payment module with all the payment functionalities, do we need to follow any specific procedure?

Comments

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet
  • Do you mean you want to create a repo with your module and use it as a library?

  • Or you want to offer your module via SprykerEco namespace?

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UR1QYK8MC Thanks for your quick response.

    We wanted to offer our payment module as a separate extension to various merchants via composer installation. And I hope we can offer the module without the SprykerEco namespace and I would also like to know whether is there any advantage in providing the module under the SprykerEco namespace?

  • If you want to offer your payment module as a stand alone extension nothing specific should be done. Ofc you’ll need to specify all dependencies you module uses in composer.json.

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UR1QYK8MC Thank you for your reply. In composer.json, do we need to specifically mention anything in the "autoload" section?

    Say for example:

    "autoload": {
    "psr-4": {
    "SprykerEco\": "src/SprykerEco/"
    }
    },

  • This section is for composer autoloader for classmap generation. See here https://getcomposer.org/doc/04-schema.md#autoload

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UR1QYK8MC I have tried the composer installation. But, facing the issue during checkout. Also, the payment not displayed in the checkout based on CheckoutPageDependencyProvider.

    Spryker Kernel Exception
    Can not resolve TestController for your bundle "Test"
    You can fix this by adding the missing Controller to your bundle.

    Further, I suspect we need to register the module name like spryker-eco, spryker-shop. If, yes then please tell me the way to add and resolve it.

  • Hey @U01HX2U4NLQ please take a look at

    $config[KernelConstants::CORE_NAMESPACES]
    

    this configuration. You’ll need to add your own namespace to this.

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UR1QYK8MC Thanks you so much.
    Now the controller working properly. But the payment not displayed on the checkout page. Could you please share your feedback to debug?

  • Did add your payment to the payment_method.csv import file? It should imported and set to active

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UR1QYK8MC Yes, it's already on active status.

  • Then problem might be in payment.twig

  • Do you use b2c demoshop?

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yes, I am using b2c demoshop only.

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    I have added the module name in KernelConstants::DEPENDENCY_INJECTOR_YVES but the file was not called.

    Also, I injected the handler and subforms in Pyz CheckoutPageDependencyProvider but it's not working.

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UR1QYK8MC Thanks you so much. I have now fixed the issues by updating the namespace. πŸ™‚