Skip to content

Commit

Permalink
Merge pull request #10 from p1fb/SW6-20-1.0.0-rc.2-preparation
Browse files Browse the repository at this point in the history
SW6-20: 1.0.0-rc.2 Preparation
  • Loading branch information
hreinberger committed Jan 29, 2020
2 parents 63986d8 + 962d8a1 commit 071a3e1
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Component.register('payone-settings', {
'paypalExpress',
'payolutionInvoicing',
'payolutionInstallment',
'payolutionDebit',
'sofort'
];
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"debit": "Die API-Zugangsdaten für Lastschrift sind nicht korrekt.",
"paypalExpress": "Die API-Zugangsdaten für PayPal Express sind nicht korrekt.",
"paypal": "Die API-Zugangsdaten für PayPal sind nicht korrekt.",
"payolutionInstallment": "Die API-Zugangsdaten für Payolution Installment sind nicht korrekt.",
"payolutionInvoicing": "Die API-Zugangsdaten für Payolution Invoicing sind nicht korrekt.",
"payolutionInstallment": "Die API-Zugangsdaten für Paysafe Pay Later Ratenzahlung sind nicht korrekt.",
"payolutionInvoicing": "Die API-Zugangsdaten für Paysafe Pay Later Rechnungskauf sind nicht korrekt.",
"payolutionDebit": "Die API-Zugangsdaten für Paysafe Pay Later Lastschrift sind nicht korrekt.",
"sofort": "Die API-Zugangsdaten für SOFORT sind nicht korrekt."
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"debit": "The API credentials for Debit are not valid.",
"paypalExpress": "The API credentials for PayPal Express are not valid.",
"paypal": "The API credentials for PayPal are not valid.",
"payolutionInstallment": "The API credentials for Payolution Installment are not valid.",
"payolutionInvoicing": "The API credentials for Payolution Invoicing are not valid.",
"payolutionInstallment": "The API credentials for Paysafe Pay Later Installment are not valid.",
"payolutionInvoicing": "The API credentials for Paysafe Pay Later Invoicing are not valid.",
"payolutionDebit": "The API credentials for Paysafe Pay Later Debit are not valid.",
"sofort": "The API credentials for SOFORT are not valid."
}
},
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class PayonePaymentCreditCard extends Plugin {
init() {
this.iframe = null;

this.iframeFieldCheckerStarted = false;
this.orderFormDisabled = true;

const requestContainer = document.getElementById('payone-request');
Expand Down Expand Up @@ -48,14 +49,13 @@ export default class PayonePaymentCreditCard extends Plugin {
getSelectStyle() {
return [
'width: 100%',
'height: calc(1.5em + 1.45rem)',
'padding: .5625rem',
'color: #8798a9',
'vertical-align: middle',
'line-height: 1.5',
'font-weight: 500',
'background-color: #fff',
'border: .0625rem solid #d1d9e0',
'border: none',
'border-radius: 3px',
];
}
Expand All @@ -70,7 +70,7 @@ export default class PayonePaymentCreditCard extends Plugin {
'line-height: 1.5',
'font-weight: 500',
'background-color: #fff',
'border: .0625rem solid #d1d9e0',
'border: none',
'border-radius: .1875rem',
];
}
Expand All @@ -88,6 +88,7 @@ export default class PayonePaymentCreditCard extends Plugin {
type: 'password',
size: '4',
maxlength: '4',
length: { 'A': 4, 'V': 3, 'M': 3, 'J': 0 },
style: this.getFieldStyle().join('; '),
},
cardexpiremonth: {
Expand Down Expand Up @@ -159,17 +160,39 @@ export default class PayonePaymentCreditCard extends Plugin {
return true;
}

if (!this.iframe.isComplete() || this.orderFormDisabled) {
const me = this;
// Check if the hosted IFrame fields are invalid,
// if so, show error message and prevent form submit.
if (!this.iframe.isComplete()) {
const iframeError = document.getElementById('iframeErrorOutput');

// Register an interval to after the first time the
// user clicked the submit button to re-check the fields.
if (!this.iframeFieldCheckerStarted) {
setInterval(() => {
if (this.iframe.isComplete()) {
iframeError.style.display = 'none';
} else {
iframeError.style.display = 'block';
}
}, 250);
}

window.creditCardCheckCallback = function(response) {
me._payoneCheckCallback(response);
};
// Flag that the check interval has started and prevent
// submitting the form.
this.iframeFieldCheckerStarted = true;
event.preventDefault();
return false;
}

this.iframe.creditCardCheck('creditCardCheckCallback');
// Perform the credit card check if no check was performed
// before or the prior check was not successful.
if (this.orderFormDisabled) {
window.payoneCreditCardCheckCallback = this._payoneCheckCallback.bind(this);
this.iframe.creditCardCheck('payoneCreditCardCheckCallback');

// Prevent form submit, credit card check handler takes
// care about submitting the form.
event.preventDefault();

return false;
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/Resources/app/storefront/src/scss/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ $payone-logo-gutter: 1rem;

.form-control.iframe {
padding: 0;
border: 0;
border: .0625rem solid #d1d9e0;
border-radius: 3px;
height: calc(5em - #{$payone-input-gutter});
}

Expand Down Expand Up @@ -82,4 +83,4 @@ $payone-logo-gutter: 1rem;
.installment {
font-size: 0.8rem;
}
}
}
2 changes: 1 addition & 1 deletion src/Resources/public/administration/js/payone-payment.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/Resources/translations/de_DE/messages.de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"cardNumber": "Kartennummer",
"securityCode": "CVV",
"expiryDate": "Gültig bis",
"savedCards": "Gespeicherte Karte"
"savedCards": "Gespeicherte Karte",
"iframeError": "Bitte prüfen Sie, ob alle Felder korrekt und vollständig ausgefüllt sind."
},
"debit": {
"accountOwner": "Kontoinhaber",
Expand Down Expand Up @@ -88,6 +89,7 @@
},
"document": {
"clearingReference": "Referenz: %reference%",
"invoicingDescription": "Bitte überweisen Sie den ausstehenden Betrag auf das folgende Konto:",
"iban": "IBAN: %iban%",
"bic": "BIC: %bic%"
},
Expand Down
4 changes: 3 additions & 1 deletion src/Resources/translations/en_GB/messages.en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"cardNumber": "Card number",
"securityCode": "Security code",
"expiryDate": "Expiry date",
"savedCards": "Saved card"
"savedCards": "Saved card",
"iframeError": "Please verify the fields and make sure no field is empty."
},
"debit": {
"accountOwner": "Account owner",
Expand Down Expand Up @@ -88,6 +89,7 @@
},
"document": {
"clearingReference": "Reference: %reference%",
"invoicingDescription": "Please transfer the outstanding amount to the following bank account:",
"iban": "IBAN: %iban%",
"bic": "BIC: %bic%"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
{% endblock %}

{% if order.extensions.payone_document %}
<br>
<strong>{{ 'PayonePayment.payolution.document.invoicingDescription' | trans }}</strong>
{% block document_payment_payone_invoicing_iban %}
{{ 'PayonePayment.payolution.document.iban' | trans({'%iban%': order.extensions.payone_document.iban}) }}<br>
{% endblock %}
Expand All @@ -30,6 +32,15 @@
{% endblock %}
{% endif %}
{% endif %}

{% if constant('PayonePayment\\PaymentMethod\\PayonePayolutionDebit::UUID') == order.transactions.first.paymentMethod.id %}
{% block document_payment_payone_debit_clearing_reference %}
{% if order.transactions.first.customFields.payone_clearing_reference %}
<br>
{{ 'PayonePayment.payolution.document.clearingReference' | trans({'%reference%': order.transactions.first.customFields.payone_clearing_reference}) }}<br>
{% endif %}
{% endblock %}
{% endif %}
{% endblock %}

{% block document_footer_bank_name %}
Expand Down Expand Up @@ -70,4 +81,4 @@
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{% if card.expiresAt <= date() %}
({{ "PayonePayment.cardPage.expired" | trans }})
{% else %}
({{ "PayonePayment.cardPage.expiresAt" | trans({'%expiresAt%': card.expiresAt|format_date('medium', 'none', locale, 'UTC')}) }})
({{ "PayonePayment.cardPage.expiresAt" | trans({'%expiresAt%': card.expiresAt | format_date('medium')}) }})
{% endif %}
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% if card.expiresAt > date() %}
<option value="{{ card.pseudoCardPan }}">
{{ card.truncatedCardPan }}
({{ "PayonePayment.cardPage.expiresAt" | trans({'%expiresAt%': card.expiresAt | format_date('medium', 'none', locale, 'UTC')}) }})
({{ "PayonePayment.cardPage.expiresAt" | trans({'%expiresAt%': card.expiresAt | format_date('medium')}) }})
</option>
{% endif %}
{% endfor %}
Expand Down Expand Up @@ -63,6 +63,9 @@

<div class="form-row col-md-12">
<div class="form-group col-md-12" >
<div id="iframeErrorOutput" class="alert alert-warning" role="alert" style="display: none;">
{{ "PayonePayment.creditCard.iframeError" | trans }}
</div>
<div id="errorOutput" class="alert alert-warning" role="alert" style="display: none;"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function cardOverview(Request $request, SalesChannelContext $context): Re

$page = $this->accountCardPageLoader->load($request, $context);

return $this->renderStorefront('@Storefront/payone/account/card.html.twig', ['page' => $page]);
return $this->renderStorefront('@Storefront/storefront/payone/account/card.html.twig', ['page' => $page]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function mandateOverview(Request $request, SalesChannelContext $context):

$page = $this->accountMandatePageLoader->load($request, $context);

return $this->renderStorefront('@Storefront/payone/account/mandate.html.twig', ['page' => $page]);
return $this->renderStorefront('@Storefront/storefront/payone/account/mandate.html.twig', ['page' => $page]);
}

/**
Expand Down

0 comments on commit 071a3e1

Please sign in to comment.