mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for token billing
This commit is contained in:
parent
c6bf1d5fcc
commit
cf3465b5e2
@ -113,9 +113,9 @@ class PaymentMethod extends EntityModel
|
|||||||
*/
|
*/
|
||||||
public function scopeClientId($query, $clientId)
|
public function scopeClientId($query, $clientId)
|
||||||
{
|
{
|
||||||
return $query->with(['contact' => function($query) use ($clientId) {
|
$query->whereHas('contact', function($query) use ($clientId) {
|
||||||
return $query->whereClientId($clientId);
|
$query->whereClientId($clientId);
|
||||||
}]);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -531,6 +531,7 @@ class BasePaymentDriver
|
|||||||
public function createPaymentMethod($customer)
|
public function createPaymentMethod($customer)
|
||||||
{
|
{
|
||||||
$paymentMethod = PaymentMethod::createNew($this->invitation);
|
$paymentMethod = PaymentMethod::createNew($this->invitation);
|
||||||
|
$paymentMethod->contact_id = $this->contact()->id;
|
||||||
$paymentMethod->ip = Request::ip();
|
$paymentMethod->ip = Request::ip();
|
||||||
$paymentMethod->account_gateway_token_id = $customer->id;
|
$paymentMethod->account_gateway_token_id = $customer->id;
|
||||||
$paymentMethod->setRelation('account_gateway_token', $customer);
|
$paymentMethod->setRelation('account_gateway_token', $customer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user