1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00

Fix for token billing

This commit is contained in:
Hillel Coren 2016-07-15 11:25:22 +03:00
parent e03a185d39
commit 2440070376
3 changed files with 5 additions and 4 deletions

View File

@ -606,7 +606,7 @@ if (!defined('CONTACT_EMAIL')) {
define('NINJA_WEB_URL', env('NINJA_WEB_URL', 'https://www.invoiceninja.com'));
define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com'));
define('NINJA_DATE', '2000-01-01');
define('NINJA_VERSION', '2.6.2' . env('NINJA_VERSION_SUFFIX'));
define('NINJA_VERSION', '2.6.3' . env('NINJA_VERSION_SUFFIX'));
define('SOCIAL_LINK_FACEBOOK', env('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'));
define('SOCIAL_LINK_TWITTER', env('SOCIAL_LINK_TWITTER', 'https://twitter.com/invoiceninja'));

View File

@ -113,9 +113,9 @@ class PaymentMethod extends EntityModel
*/
public function scopeClientId($query, $clientId)
{
return $query->with(['contact' => function($query) use ($clientId) {
return $query->whereClientId($clientId);
}]);
$query->whereHas('contact', function($query) use ($clientId) {
$query->whereClientId($clientId);
});
}
/**

View File

@ -516,6 +516,7 @@ class BasePaymentDriver
public function createPaymentMethod($customer)
{
$paymentMethod = PaymentMethod::createNew($this->invitation);
$paymentMethod->contact_id = $this->contact()->id;
$paymentMethod->ip = Request::ip();
$paymentMethod->account_gateway_token_id = $customer->id;
$paymentMethod->setRelation('account_gateway_token', $customer);