Skip to content

Commit

Permalink
Merge branch 'feature/discount-and-fee' into feature/layout-front
Browse files Browse the repository at this point in the history
  • Loading branch information
valdeir2000 committed Sep 2, 2020
2 parents e136c1b + ffa570d commit a989ecc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions upload/catalog/model/extension/total/pagseguro_discount.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

class ModelExtensionTotalPagSeguroDiscount extends Model
{
const EXTENSION_PAYMENT_PREFIX = 'payment_pagseguro_';
const EXTENSION_PAGSEGURO_BOLETO = 'pagseguro_boleto';
const EXTENSION_PAGSEGURO_CREDIT = 'pagseguro_credit';
const EXTENSION_PAGSEGURO_DEBIT = 'pagseguro_debit';
const EXTENSION_PAGSEGURO_DEBIT = 'pagseguro_zdebit';

public function getTotal($total) {
$status_key = self::EXTENSION_PAYMENT_PREFIX . 'status';
Expand Down Expand Up @@ -41,7 +42,7 @@ public function getTotal($total) {
*/
private function getDiscountValue(): float
{
switch ($this->session->data['payment_method']) {
switch ($this->session->data['payment_method']['code']) {
case self::EXTENSION_PAGSEGURO_BOLETO:
return floatval($this->config->get(self::EXTENSION_PAYMENT_PREFIX . 'discount_boleto'));
break;
Expand Down
8 changes: 4 additions & 4 deletions upload/catalog/model/extension/total/pagseguro_fee.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
class ModelExtensionTotalPagSeguroFee extends Model
{
const EXTENSION_PAYMENT_PREFIX = 'payment_pagseguro_';
const EXTENSION_PAGSEGURO_BOLETO = self::EXTENSION_PAYMENT_PREFIX . 'boleto';
const EXTENSION_PAGSEGURO_CREDIT = self::EXTENSION_PAYMENT_PREFIX . 'credit';
const EXTENSION_PAGSEGURO_DEBIT = self::EXTENSION_PAYMENT_PREFIX . 'debit';
const EXTENSION_PAGSEGURO_BOLETO = 'pagseguro_boleto';
const EXTENSION_PAGSEGURO_CREDIT = 'pagseguro_credit';
const EXTENSION_PAGSEGURO_DEBIT = 'pagseguro_zdebit';

public function getTotal($total) {
$status_key = self::EXTENSION_PAYMENT_PREFIX . 'status';
Expand Down Expand Up @@ -42,7 +42,7 @@ public function getTotal($total) {
*/
private function getFeeValue(): float
{
switch ($this->session->data['payment_method']) {
switch ($this->session->data['payment_method']['code']) {
case self::EXTENSION_PAGSEGURO_BOLETO:
return floatval($this->config->get(self::EXTENSION_PAYMENT_PREFIX . 'fee_boleto'));
break;
Expand Down

0 comments on commit a989ecc

Please sign in to comment.