|
@@ -110,6 +110,29 @@ $routeName = request()->route()->getName();
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ //Save pay url to invoice detailJson
|
|
|
|
+ parentSegment.find('.generate-and-store-ic-pay-url')
|
|
|
|
+ .off('click.generate-and-store-ic-pay-url')
|
|
|
|
+ .on('click.generate-and-store-ic-pay-url', function() {
|
|
|
|
+ $.post('/api/session/proLogInAsCustomer', {
|
|
|
|
+ customerUid: $(this).attr('data-uid')
|
|
|
|
+ }, _data => {
|
|
|
|
+ if (!hasResponseError(_data)) {
|
|
|
|
+ const invoiceUid = $(this).attr('data-invoice-uid');
|
|
|
|
+ const payUrl = '{{ config('app.url') }}/ic/pay/' + invoiceUid + '/' + _data.data
|
|
|
|
+ console.log({payUrl});
|
|
|
|
+ $.post('/customer/invoice/save-pay-url', {invoiceUid: invoiceUid, payUrl: payUrl }, function(response){
|
|
|
|
+ if(response.success){
|
|
|
|
+ toastr.success('Inoice payment url generated!');
|
|
|
|
+ }else{
|
|
|
|
+ toastr.error(response.message);
|
|
|
|
+ }
|
|
|
|
+ }, 'json');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
addMCInitializer('invoice-center', init, '#invoice-center')
|
|
addMCInitializer('invoice-center', init, '#invoice-center')
|
|
}).call(window);
|
|
}).call(window);
|