mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on Alipay
This commit is contained in:
parent
9f0a60486d
commit
1f0dee82cd
@ -294,6 +294,10 @@ class AccountGatewayController extends BaseController
|
||||
$config->plaidPublicKey = $oldConfig->plaidPublicKey;
|
||||
}
|
||||
|
||||
if ($gatewayId == GATEWAY_STRIPE) {
|
||||
$config->enableAlipay = boolval(Input::get('enable_alipay'));
|
||||
}
|
||||
|
||||
if ($gatewayId == GATEWAY_STRIPE || $gatewayId == GATEWAY_WEPAY) {
|
||||
$config->enableAch = boolval(Input::get('enable_ach'));
|
||||
}
|
||||
|
@ -149,10 +149,6 @@ class AccountGateway extends EntityModel
|
||||
*/
|
||||
public function getAlipayEnabled()
|
||||
{
|
||||
if (\Utils::isNinjaDev()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return ! empty($this->getConfigField('enableAlipay'));
|
||||
}
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ $LANG = array(
|
||||
'payment_type_stripe' => 'Stripe',
|
||||
'ach' => 'ACH',
|
||||
'enable_ach' => 'Enable ACH',
|
||||
'stripe_ach_help' => 'ACH support must also be enabled at Stripe.',
|
||||
'stripe_ach_help' => 'ACH support must also be enabled in :link.',
|
||||
'ach_disabled' => 'Another gateway is already configured for direct debit.',
|
||||
|
||||
'plaid' => 'Plaid',
|
||||
@ -2438,7 +2438,9 @@ $LANG = array(
|
||||
'deleted_company_details' => 'Your company (:account) has been successfully deleted.',
|
||||
'deleted_account_details' => 'Your account (:account) has been successfully deleted.',
|
||||
|
||||
|
||||
'alipay' => 'Alipay',
|
||||
'enable_alipay' => 'Enable Alipay',
|
||||
'stripe_alipay_help' => 'ACH/Alipay support must also be enabled in :link.',
|
||||
|
||||
);
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
{!! Former::populateField('update_address', intval($accountGateway->update_address)) !!}
|
||||
{!! Former::populateField('publishable_key', $accountGateway->getPublishableStripeKey() ? str_repeat('*', strlen($accountGateway->getPublishableStripeKey())) : '') !!}
|
||||
{!! Former::populateField('enable_ach', $accountGateway->getAchEnabled() ? 1 : 0) !!}
|
||||
{!! Former::populateField('enable_alipay', $accountGateway->getAlipayEnabled() ? 1 : 0) !!}
|
||||
{!! Former::populateField('enable_paypal', $accountGateway->getPayPalEnabled() ? 1 : 0) !!}
|
||||
{!! Former::populateField('plaid_client_id', $accountGateway->getPlaidClientId() ? str_repeat('*', strlen($accountGateway->getPlaidClientId())) : '') !!}
|
||||
{!! Former::populateField('plaid_secret', $accountGateway->getPlaidSecret() ? str_repeat('*', strlen($accountGateway->getPlaidSecret())) : '') !!}
|
||||
@ -149,7 +150,12 @@
|
||||
{!! Former::checkbox('enable_ach')
|
||||
->label(trans('texts.ach'))
|
||||
->text(trans('texts.enable_ach'))
|
||||
->help(trans('texts.stripe_ach_help'))
|
||||
->value(1) !!}
|
||||
|
||||
{!! Former::checkbox('enable_alipay')
|
||||
->label(trans('texts.alipay'))
|
||||
->text(trans('texts.enable_alipay'))
|
||||
->help(trans('texts.stripe_alipay_help', ['link' => link_to('https://dashboard.stripe.com/account/payments/settings', 'Stripe', ['target' => '_blank'])]))
|
||||
->value(1) !!}
|
||||
|
||||
<div class="stripe-ach-options">
|
||||
|
@ -1164,19 +1164,22 @@
|
||||
@endif
|
||||
|
||||
var invoice = createInvoiceModel();
|
||||
if (! checkedInvoiceBalances) {
|
||||
// check amounts are correct
|
||||
checkedInvoiceBalances = true;
|
||||
var phpBalance = invoice.balance;
|
||||
var koBalance = model.invoice().totals.rawTotal();
|
||||
var jsBalance = calculateAmounts(invoice).total_amount;
|
||||
if (phpBalance == koBalance && koBalance == jsBalance) {
|
||||
// do nothing
|
||||
} else {
|
||||
var invitationKey = invoice.invitations[0].invitation_key;
|
||||
window.onerror(invitationKey + ': Balances do not match | PHP: ' + phpBalance + ', JS: ' + jsBalance + ', KO: ' + koBalance);
|
||||
|
||||
@if ($invoice->exists)
|
||||
if (! checkedInvoiceBalances) {
|
||||
// check amounts are correct
|
||||
checkedInvoiceBalances = true;
|
||||
var phpBalance = invoice.balance;
|
||||
var koBalance = model.invoice().totals.rawTotal();
|
||||
var jsBalance = calculateAmounts(invoice).total_amount;
|
||||
if (phpBalance == koBalance && koBalance == jsBalance) {
|
||||
// do nothing
|
||||
} else {
|
||||
var invitationKey = invoice.invitations[0].invitation_key;
|
||||
window.onerror(invitationKey + ': Balances do not match | PHP: ' + phpBalance + ', JS: ' + jsBalance + ', KO: ' + koBalance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@endif
|
||||
|
||||
@if ( ! $account->live_preview)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user