mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fix refunds; support using stored card; change proPlanModel link
This commit is contained in:
parent
71b6b6eb87
commit
9d27b68fb6
@ -165,7 +165,7 @@ class AccountController extends BaseController
|
|||||||
$account->company->save();
|
$account->company->save();
|
||||||
Session::flash('message', trans('texts.updated_plan'));
|
Session::flash('message', trans('texts.updated_plan'));
|
||||||
}
|
}
|
||||||
} else {
|
} elseif (!empty($planDetails['started'])) {
|
||||||
// Downgrade
|
// Downgrade
|
||||||
$refund_deadline = clone $planDetails['started'];
|
$refund_deadline = clone $planDetails['started'];
|
||||||
$refund_deadline->modify('+30 days');
|
$refund_deadline->modify('+30 days');
|
||||||
@ -186,7 +186,7 @@ class AccountController extends BaseController
|
|||||||
$gateway = $this->paymentService->createGateway($payment->account_gateway);
|
$gateway = $this->paymentService->createGateway($payment->account_gateway);
|
||||||
$refund = $gateway->refund(array(
|
$refund = $gateway->refund(array(
|
||||||
'transactionReference' => $payment->transaction_reference,
|
'transactionReference' => $payment->transaction_reference,
|
||||||
'amount' => $payment->amount * 100
|
'amount' => $payment->amount
|
||||||
));
|
));
|
||||||
$refund->send();
|
$refund->send();
|
||||||
$payment->delete();
|
$payment->delete();
|
||||||
@ -238,7 +238,7 @@ class AccountController extends BaseController
|
|||||||
|
|
||||||
if (!empty($new_plan)) {
|
if (!empty($new_plan)) {
|
||||||
$invitation = $this->accountRepo->enablePlan($new_plan['plan'], $new_plan['term'], $credit, !empty($pending_monthly));
|
$invitation = $this->accountRepo->enablePlan($new_plan['plan'], $new_plan['term'], $credit, !empty($pending_monthly));
|
||||||
return Redirect::to('payment/'.$invitation->invitation_key);
|
return Redirect::to('view/'.$invitation->invitation_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redirect::to('/settings/'.ACCOUNT_MANAGEMENT, 301);
|
return Redirect::to('/settings/'.ACCOUNT_MANAGEMENT, 301);
|
||||||
|
@ -220,6 +220,11 @@
|
|||||||
}
|
}
|
||||||
$('#plan_term, #plan').change(updatePlanModal);
|
$('#plan_term, #plan').change(updatePlanModal);
|
||||||
updatePlanModal();
|
updatePlanModal();
|
||||||
|
|
||||||
|
if(window.location.hash) {
|
||||||
|
var hash = window.location.hash;
|
||||||
|
$(hash).modal('toggle');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@stop
|
@stop
|
@ -190,14 +190,12 @@
|
|||||||
fbq('track', 'AddPaymentInfo');
|
fbq('track', 'AddPaymentInfo');
|
||||||
trackEvent('/account', '/submit_pro_plan/' + NINJA.proPlanFeature);
|
trackEvent('/account', '/submit_pro_plan/' + NINJA.proPlanFeature);
|
||||||
if (NINJA.isRegistered) {
|
if (NINJA.isRegistered) {
|
||||||
$.ajax({
|
if (window.showChangePlan) {
|
||||||
type: 'POST',
|
$('#proPlanModal').modal('hide');
|
||||||
url: '{{ URL::to('account/go_pro') }}',
|
showChangePlan();
|
||||||
success: function(result) {
|
} else {
|
||||||
NINJA.formIsChanged = false;
|
window.location = '/settings/account_management#changePlanModel';
|
||||||
window.location = '/payment/' + result;
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
$('#proPlanModal').modal('hide');
|
$('#proPlanModal').modal('hide');
|
||||||
$('#go_pro').val('true');
|
$('#go_pro').val('true');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user