Skip to content

Commit

Permalink
Remove money helper
Browse files Browse the repository at this point in the history
Move GatewayShortNameGenerator to Gateways namespace
  • Loading branch information
litvinjuan committed Aug 10, 2019
1 parent 6a02cc6 commit f399881
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/Gateways/AbstractGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use litvinjuan\LaravelPayments\Requests\AbstractRequest;
use litvinjuan\LaravelPayments\Requests\AbstractValidatePaymentRequest;
use litvinjuan\LaravelPayments\Requests\AbstractVoidRequest;
use litvinjuan\LaravelPayments\Util\GatewayShortNameGenerator;

/**
* @method AbstractPaymentNotificationRequest paymentNotification(array $parameters = array())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

namespace litvinjuan\LaravelPayments\Util;
namespace litvinjuan\LaravelPayments\Gateways;

use Illuminate\Support\Str;
use litvinjuan\LaravelPayments\Gateways\GatewayInterface;

class GatewayShortNameGenerator
{
Expand Down
5 changes: 3 additions & 2 deletions src/Payments/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Konekt\Enum\Eloquent\CastsEnums;
use Money\Currency;
use Money\Money;

/**
Expand Down Expand Up @@ -62,7 +63,7 @@ public function payer(): MorphTo

public function getPriceAttribute(): Money
{
return money($this->attributes['price']);
return new Money($this->attributes['price'], new Currency(config('laravel-payments.currency')));
}

public function setPriceAttribute(Money $money)
Expand All @@ -72,7 +73,7 @@ public function setPriceAttribute(Money $money)

public function getPaidAttribute(): Money
{
return money($this->attributes['paid']);
return new Money($this->attributes['paid'], new Currency(config('laravel-payments.currency')));
}

public function setPaidAttribute(Money $money)
Expand Down
19 changes: 0 additions & 19 deletions src/Util/helpers.php

This file was deleted.

0 comments on commit f399881

Please sign in to comment.