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();
|
||||
Session::flash('message', trans('texts.updated_plan'));
|
||||
}
|
||||
} else {
|
||||
} elseif (!empty($planDetails['started'])) {
|
||||
// Downgrade
|
||||
$refund_deadline = clone $planDetails['started'];
|
||||
$refund_deadline->modify('+30 days');
|
||||
@ -186,7 +186,7 @@ class AccountController extends BaseController
|
||||
$gateway = $this->paymentService->createGateway($payment->account_gateway);
|
||||
$refund = $gateway->refund(array(
|
||||
'transactionReference' => $payment->transaction_reference,
|
||||
'amount' => $payment->amount * 100
|
||||
'amount' => $payment->amount
|
||||
));
|
||||
$refund->send();
|
||||
$payment->delete();
|
||||
@ -238,7 +238,7 @@ class AccountController extends BaseController
|
||||
|
||||
if (!empty($new_plan)) {
|
||||
$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);
|
||||
|
@ -220,6 +220,11 @@
|
||||
}
|
||||
$('#plan_term, #plan').change(updatePlanModal);
|
||||
updatePlanModal();
|
||||
|
||||
if(window.location.hash) {
|
||||
var hash = window.location.hash;
|
||||
$(hash).modal('toggle');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@stop
|
@ -189,15 +189,13 @@
|
||||
function submitProPlan() {
|
||||
fbq('track', 'AddPaymentInfo');
|
||||
trackEvent('/account', '/submit_pro_plan/' + NINJA.proPlanFeature);
|
||||
if (NINJA.isRegistered) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '{{ URL::to('account/go_pro') }}',
|
||||
success: function(result) {
|
||||
NINJA.formIsChanged = false;
|
||||
window.location = '/payment/' + result;
|
||||
}
|
||||
});
|
||||
if (NINJA.isRegistered) {
|
||||
if (window.showChangePlan) {
|
||||
$('#proPlanModal').modal('hide');
|
||||
showChangePlan();
|
||||
} else {
|
||||
window.location = '/settings/account_management#changePlanModel';
|
||||
}
|
||||
} else {
|
||||
$('#proPlanModal').modal('hide');
|
||||
$('#go_pro').val('true');
|
||||
|
Loading…
x
Reference in New Issue
Block a user