Skip to content

Commit

Permalink
fix: removing property type for old php versions (#267)
Browse files Browse the repository at this point in the history
* fix: removing property type for old php versions

* fix: code smell

* fix: total amount with coupons

---------

Co-authored-by: RafaMelazzo <[email protected]>
  • Loading branch information
mateus-picoloto and RafaMelazzo authored Oct 26, 2023
1 parent 4037e2a commit 2ef3440
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Model/WebhookManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
class WebhookManagement implements WebhookManagementInterface
{

protected OrderFactory $orderFactory;
/**
* @var OrderFactory
*/
protected $orderFactory;

public function __construct(
OrderFactory $orderFactory
Expand Down
21 changes: 21 additions & 0 deletions view/frontend/web/js/core/checkout/PaymentMethodController.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ define([

this.addCreditCardListeners(this.formObject);
this.modelToken = new CreditCardToken(this.formObject);

this.subscribeTotal();
}

subscribeTotal() {
const _self = this;

this.platformConfig.updateTotals.totals.subscribe(function(){
if (_self.methodCode === 'twocreditcards' || _self.methodCode === 'boletoCreditcard') {
for (let i = 0, len = _self.formObject.numberOfPaymentForms; i < len; i++) {
_self.fillCardAmount(_self.formObject[i], 2, i);
_self.fillInstallments(_self.formObject[i]);
}
return;
}
_self.fillCardAmount(_self.formObject, 1);
_self.fillInstallments(_self.formObject);
});
}

voucherInit() {
Expand Down Expand Up @@ -196,6 +214,7 @@ define([
}

this.modelToken = new CreditCardToken(this.formObject);
this.subscribeTotal();
}

pixInit() {
Expand Down Expand Up @@ -291,6 +310,8 @@ define([
this.formObject,
this.platformConfig.publicKey
);

this.subscribeTotal();
}

addCreditCardListeners(formObject) {
Expand Down

0 comments on commit 2ef3440

Please sign in to comment.