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;
|
$config->plaidPublicKey = $oldConfig->plaidPublicKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($gatewayId == GATEWAY_STRIPE) {
|
||||||
|
$config->enableAlipay = boolval(Input::get('enable_alipay'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($gatewayId == GATEWAY_STRIPE || $gatewayId == GATEWAY_WEPAY) {
|
if ($gatewayId == GATEWAY_STRIPE || $gatewayId == GATEWAY_WEPAY) {
|
||||||
$config->enableAch = boolval(Input::get('enable_ach'));
|
$config->enableAch = boolval(Input::get('enable_ach'));
|
||||||
}
|
}
|
||||||
|
@ -149,10 +149,6 @@ class AccountGateway extends EntityModel
|
|||||||
*/
|
*/
|
||||||
public function getAlipayEnabled()
|
public function getAlipayEnabled()
|
||||||
{
|
{
|
||||||
if (\Utils::isNinjaDev()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ! empty($this->getConfigField('enableAlipay'));
|
return ! empty($this->getConfigField('enableAlipay'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1214,7 +1214,7 @@ $LANG = array(
|
|||||||
'payment_type_stripe' => 'Stripe',
|
'payment_type_stripe' => 'Stripe',
|
||||||
'ach' => 'ACH',
|
'ach' => 'ACH',
|
||||||
'enable_ach' => 'Enable 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.',
|
'ach_disabled' => 'Another gateway is already configured for direct debit.',
|
||||||
|
|
||||||
'plaid' => 'Plaid',
|
'plaid' => 'Plaid',
|
||||||
@ -2438,7 +2438,9 @@ $LANG = array(
|
|||||||
'deleted_company_details' => 'Your company (:account) has been successfully deleted.',
|
'deleted_company_details' => 'Your company (:account) has been successfully deleted.',
|
||||||
'deleted_account_details' => 'Your account (: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('update_address', intval($accountGateway->update_address)) !!}
|
||||||
{!! Former::populateField('publishable_key', $accountGateway->getPublishableStripeKey() ? str_repeat('*', strlen($accountGateway->getPublishableStripeKey())) : '') !!}
|
{!! Former::populateField('publishable_key', $accountGateway->getPublishableStripeKey() ? str_repeat('*', strlen($accountGateway->getPublishableStripeKey())) : '') !!}
|
||||||
{!! Former::populateField('enable_ach', $accountGateway->getAchEnabled() ? 1 : 0) !!}
|
{!! 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('enable_paypal', $accountGateway->getPayPalEnabled() ? 1 : 0) !!}
|
||||||
{!! Former::populateField('plaid_client_id', $accountGateway->getPlaidClientId() ? str_repeat('*', strlen($accountGateway->getPlaidClientId())) : '') !!}
|
{!! Former::populateField('plaid_client_id', $accountGateway->getPlaidClientId() ? str_repeat('*', strlen($accountGateway->getPlaidClientId())) : '') !!}
|
||||||
{!! Former::populateField('plaid_secret', $accountGateway->getPlaidSecret() ? str_repeat('*', strlen($accountGateway->getPlaidSecret())) : '') !!}
|
{!! Former::populateField('plaid_secret', $accountGateway->getPlaidSecret() ? str_repeat('*', strlen($accountGateway->getPlaidSecret())) : '') !!}
|
||||||
@ -149,7 +150,12 @@
|
|||||||
{!! Former::checkbox('enable_ach')
|
{!! Former::checkbox('enable_ach')
|
||||||
->label(trans('texts.ach'))
|
->label(trans('texts.ach'))
|
||||||
->text(trans('texts.enable_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) !!}
|
->value(1) !!}
|
||||||
|
|
||||||
<div class="stripe-ach-options">
|
<div class="stripe-ach-options">
|
||||||
|
@ -1164,19 +1164,22 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
var invoice = createInvoiceModel();
|
var invoice = createInvoiceModel();
|
||||||
if (! checkedInvoiceBalances) {
|
|
||||||
// check amounts are correct
|
@if ($invoice->exists)
|
||||||
checkedInvoiceBalances = true;
|
if (! checkedInvoiceBalances) {
|
||||||
var phpBalance = invoice.balance;
|
// check amounts are correct
|
||||||
var koBalance = model.invoice().totals.rawTotal();
|
checkedInvoiceBalances = true;
|
||||||
var jsBalance = calculateAmounts(invoice).total_amount;
|
var phpBalance = invoice.balance;
|
||||||
if (phpBalance == koBalance && koBalance == jsBalance) {
|
var koBalance = model.invoice().totals.rawTotal();
|
||||||
// do nothing
|
var jsBalance = calculateAmounts(invoice).total_amount;
|
||||||
} else {
|
if (phpBalance == koBalance && koBalance == jsBalance) {
|
||||||
var invitationKey = invoice.invitations[0].invitation_key;
|
// do nothing
|
||||||
window.onerror(invitationKey + ': Balances do not match | PHP: ' + phpBalance + ', JS: ' + jsBalance + ', KO: ' + koBalance);
|
} 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)
|
@if ( ! $account->live_preview)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user