Skip to content

Commit

Permalink
Merge pull request #8 from PAYONE-GmbH/release-1.0.0
Browse files Browse the repository at this point in the history
SW6-18: Release 1.0.0 RC1 Preparation
  • Loading branch information
hreinberger authored Jan 20, 2020
2 parents 746be0d + 172c3bb commit 0966fba
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 53 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) shopware AG
Copyright (c) PAYONE GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,54 @@
# PayonePayment
PAYONE Payment for Shopware 6
=============================

## How to change field styling
[![CI Status](https://github.com/PAYONE-GmbH/shopware-6/workflows/CI/badge.svg?branch=master)](https://github.com/PAYONE-GmbH/shopware-6/actions)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PAYONE-GmbH/shopware-6/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PAYONE-GmbH/shopware-6/?branch=master)
[![LICENSE](https://img.shields.io/github/license/PAYONE-GmbH/shopware-6.svg)](LICENSE)

Some payment methods like credit cards have custom field styling for the iframe-based input fields. You can change the field styling by creating a new plugin depending on this plugin via composer.
This plugin enables merchants to accept payments in a simple and convenient way.
We offer state-of-the art integration of the most used payment methods directly
into your checkout.

In the new plugin you can then define an overriding javascript plugin like this (example uses `custom/plugins/MyPlugin/src/Resources/storefront/my-payone-payment/my-payone-payment.credit-card.plugin.js`):
## Open for Feedback

```js
import PayonePaymentCreditCard from '../../../../../PayonePayment/src/Resources/storefront/credit-card/payone-payment.credit-card';
This plugin is a complete rewrite of our Shopware 5 plugin and we'd love to hear your
feedback on it! Drop us a message at [email protected] or open an issue if
you've found a bug.

export default class MyPayonePaymentCreditCard extends PayonePaymentCreditCard
{
getFieldStyle() {
const style = super.getFieldStyle();
## Super Bonus for Early Adopters

style.push('height: 300px');
We'd especially love to hear from you if you plan on going live using the plugin
so we can assist and show some appreciation to the first adopters. :crown:

return style;
}
getSelectStyle(){
const style = super.getSelectStyle();
## Installation

style.push('background-color: black');
The plugin can easily be integrated via Composer:

return style;
}
}
```
composer require payone-gmbh/shopware-6
php bin/console plugin:install PayonePayment
php bin/console plugin:activate PayonePayment
php bin/console cache:clear
```

Then you can register the overriding plugin in your `custom/plugins/MyPlugin/src/Resources/storefront/main.js`:
## Not a Customer Yet?

```js
import MyPayonePaymentCreditCard from './my-payone-payment/my-payone-payment.credit-card.plugin';
If you don't have a PAYONE Merchant Account yet, get in touch and we'll setup
a test account for you!

const PluginManager = window.PluginManager;
PluginManager.override('PayonePaymentCreditCard', MyPayonePaymentCreditCard, '[data-is-payone-credit-card]');
## Documentation

// Necessary for the webpack hot module reloading server
if (module.hot) {
module.hot.accept();
}
```
Please refer to our extensive online documentation at
https://docs.payone.com/display/public/INT/Shopware+6+Plugin

## Support and Contact

PAYONE GmbH
Office Kiel
Fraunhoferstraße 2–4
24118 Kiel, Germany
Phone +49 431 25968-400
[email protected]

## License

Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "payone/shopware",
"name": "payone-gmbh/shopware-6",
"type": "shopware-platform-plugin",
"description": "PAYONE Payment Plugin",
"version": "1.0.0",
"license": "MIT",
"authors": [
{
"name": "PAYONE GmbH",
"email": "feedback@bspayone.com",
"homepage": "https://www.bspayone.com"
"email": "shopware@payone.com",
"homepage": "https://www.payone.com"
},
{
"name": "Kellerkinder GmbH",
Expand Down Expand Up @@ -58,12 +58,12 @@
"en-GB": "PAYONE Payment Plugin"
},
"manufacturerLink": {
"de-DE": "https://www.bspayone.com",
"en-GB": "https://www.bspayone.com"
"de-DE": "https://www.payone.com",
"en-GB": "https://www.payone.com"
},
"supportLink": {
"de-DE": "https://www.bspayone.com",
"en-GB": "https://www.bspayone.com"
"de-DE": "https://www.payone.com",
"en-GB": "https://www.payone.com"
}
}
}
8 changes: 8 additions & 0 deletions src/Resources/config/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,14 @@
<card>
<title>Payolution Debit</title>

<input-field>
<name>payolutionDebitCompanyName</name>
<label>Company Name</label>
<label lang="de-DE">Firmenname</label>
<helpText>Is displayed in the supplementary notes to the privacy statement for purchase on account.</helpText>
<helpText lang="de-DE">Wird in den ergänzenden Hinweisen zur Datenschutzerklärung für Kauf auf Rechnung angezeigt.</helpText>
</input-field>

<input-field>
<name>payolutionDebitMerchantId</name>
<label>Merchant ID</label>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/administration/css/payone-payment.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Resources/public/administration/js/payone-payment.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Resources/translations/de_DE/messages.de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"downloadButton": "Mandat herunterladen",
"noEntries": "Keine SEPA-Lastschriftmandate vorhanden."
},
"checkoutPage": {
"checkoutConfirmPage": {
"defaultCardTitle": "Zahlungsinformationen"
},
"finishPage": {
"checkoutFinishPage": {
"mandateIdentification": "SEPA-Laschtschriftmandat"
},
"mandateModal": {
Expand Down Expand Up @@ -92,7 +92,7 @@
"bic": "BIC: %bic%"
},
"consentCheckbox": {
"introduction": "Mit der Übermittlung der für die Abwicklung des Rechnungskaufes und einer Identitätsprüfung und Bonitätsprüfung erforderlicher Daten an payolution bin ich einverstanden.",
"introduction": "Mit der Übermittlung der für die Abwicklung des Rechnungskaufes und einer Identitätsprüfung und Bonitätsprüfung erforderlicher Daten an die payolution GmbH, Am Euro Platz 2, 1120 Wien bin ich einverstanden.",
"textWithLink": "Meine <a href=\"%link%\" data-url=\"%link%\" data-modal-class=\"payolution\" data-toggle=\"modal\" title=\"Einwilligung\">Einwilligung</a> kann ich jederzeit mit Wirkung für die Zukunft wiederrufen."
},
"mandateCheckbox": {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/translations/en_GB/messages.en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"bic": "BIC: %bic%"
},
"consentCheckbox": {
"introduction": "With the transmission of the data necessary for the completion of the invoice purchase, an identity check and credit check to payolution I agree.",
"introduction": "With the transmission of the data necessary for the completion of the invoice purchase, an identity check and credit check to payolution GmbH, Am Euro Platz 2, 1120 Wien I agree.",
"textWithLink": "I can revoke my <a href=\"%link%\" data-url=\"%link%\" data-modal-class=\"payolution\" data-toggle=\"modal\" title=\"Einwilligung\">consent</a> at any time with effect for the future."
},
"mandateCheckbox": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

<label for="payolutionMandate" class="custom-control-label consent-label">
{{ "PayonePayment.payolution.mandateCheckbox.textWithLink" | trans({
'%link%': path('frontend.account.payone.payolution.consent')
'%link%': 'https://payment.payolution.com/payolution-payment/infoport/sepa/mandate.pdf'
}) | raw }}
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function mandateOverview(Request $request, SalesChannelContext $context):
if (!empty($response['mandate']['HtmlText'])) {
$response['mandate']['HtmlText'] = urldecode($response['mandate']['HtmlText']);

$content = $this->renderView('@PayonePayment/payone/mandate/mandate.html.twig', $response);
$content = $this->renderView('@PayonePayment/storefront/payone/mandate/mandate.html.twig', $response);

$response['modal_content'] = $content;
}
Expand Down
29 changes: 21 additions & 8 deletions src/Storefront/Controller/Payolution/PayolutionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use DateTime;
use PayonePayment\Components\CartHasher\CartHasherInterface;
use PayonePayment\Components\ConfigReader\ConfigReaderInterface;
use PayonePayment\PaymentMethod\PayonePayolutionDebit;
use PayonePayment\PaymentMethod\PayonePayolutionInstallment;
use PayonePayment\PaymentMethod\PayonePayolutionInvoicing;
use PayonePayment\Payone\Client\Exception\PayoneRequestException;
Expand Down Expand Up @@ -87,14 +88,26 @@ public function displayContentModal(SalesChannelContext $context): Response
{
$configuration = $this->configReader->read($context->getSalesChannel()->getId());

$companyName = '';
switch ($context->getPaymentMethod()->getId()) {
case PayonePayolutionInvoicing::UUID:
$companyName = $configuration->get('payolutionInvoicingCompanyName');

if ($context->getPaymentMethod()->getId() === PayonePayolutionInvoicing::UUID) {
$companyName = $configuration->get('payolutionInvoicingCompanyName');
}
break;

case PayonePayolutionInstallment::UUID:
$companyName = $configuration->get('payolutionInstallmentCompanyName');

break;

case PayonePayolutionDebit::UUID:
$companyName = $configuration->get('payolutionDebitCompanyName');

break;

default:
$companyName = null;

if ($context->getPaymentMethod()->getId() === PayonePayolutionInstallment::UUID) {
$companyName = $configuration->get('payolutionInstallmentCompanyName');
break;
}

if (empty($companyName)) {
Expand Down Expand Up @@ -181,7 +194,7 @@ public function calculation(RequestDataBag $dataBag, SalesChannelContext $contex
$calculationResponse = $this->prepareCalculationOutput($calculationResponse);

$response['installmentSelection'] = $this->getInstallmentSelectionHtml($calculationResponse);
$response['calculationOverview'] = $this->geCalculationOverviewHtml($calculationResponse);
$response['calculationOverview'] = $this->getCalculationOverviewHtml($calculationResponse);

$this->saveCalculationResponse($cart, $calculationResponse, $context);
} catch (Throwable $exception) {
Expand Down Expand Up @@ -341,7 +354,7 @@ private function getInstallmentSelectionHtml(array $calculationResponse): string
return $this->renderView($view, $calculationResponse);
}

private function geCalculationOverviewHtml(array $calculationResponse): string
private function getCalculationOverviewHtml(array $calculationResponse): string
{
$view = '@PayonePayment/storefront/payone/payolution/payolution-calculation-overview.html.twig';

Expand Down

0 comments on commit 0966fba

Please sign in to comment.