for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ByTIC\Payments\Models\AbstractModels;
use ByTIC\Payments\Models\Purchase\Traits\IsPurchasableModelTrait;
/**
* Trait HasPurchaseParent
* @package ByTIC\Payments\Models\AbstractModels
*/
trait HasPurchaseParent
{
* @param IsPurchasableModelTrait $payment
* @return $this
public function populateFromPayment($payment)
$this->{$this->getPurchaseFk()} = $payment->id;
$this->amount = floor($payment->getPurchaseAmount() * 100);
amount
$this->currency = $payment->getPurchaseCurrency();
currency
return $this;
}
* @return string
protected function getPurchaseFk()
return 'id_purchase';