mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Working on Alipay
This commit is contained in:
parent
1f0dee82cd
commit
62f792fcd8
@ -936,8 +936,12 @@ class BasePaymentDriver
|
|||||||
if ($gatewayTypeId == GATEWAY_TYPE_CUSTOM) {
|
if ($gatewayTypeId == GATEWAY_TYPE_CUSTOM) {
|
||||||
$url = 'javascript:showCustomModal();';
|
$url = 'javascript:showCustomModal();';
|
||||||
$label = e($this->accountGateway->getConfigField('name'));
|
$label = e($this->accountGateway->getConfigField('name'));
|
||||||
|
} else {
|
||||||
|
if ($gatewayTypeId == GATEWAY_TYPE_ALIPAY) {
|
||||||
|
$url = url("/create_source/{$this->invitation->invitation_key}/alipay");
|
||||||
} else {
|
} else {
|
||||||
$url = $this->paymentUrl($gatewayTypeAlias);
|
$url = $this->paymentUrl($gatewayTypeAlias);
|
||||||
|
}
|
||||||
if ($custom = $this->account()->getLabel($gatewayTypeAlias)) {
|
if ($custom = $this->account()->getLabel($gatewayTypeAlias)) {
|
||||||
$label = $custom;
|
$label = $custom;
|
||||||
} else {
|
} else {
|
||||||
|
@ -158,7 +158,7 @@
|
|||||||
->help(trans('texts.stripe_alipay_help', ['link' => link_to('https://dashboard.stripe.com/account/payments/settings', 'Stripe', ['target' => '_blank'])]))
|
->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-webhook-options">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-lg-4 col-sm-4">{{ trans('texts.webhook_url') }}</label>
|
<label class="control-label col-lg-4 col-sm-4">{{ trans('texts.webhook_url') }}</label>
|
||||||
<div class="col-lg-8 col-sm-8 help-block">
|
<div class="col-lg-8 col-sm-8 help-block">
|
||||||
@ -168,6 +168,9 @@
|
|||||||
]) !!}</strong></div>
|
]) !!}</strong></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stripe-ach-options">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-8 col-sm-offset-4">
|
<div class="col-sm-8 col-sm-offset-4">
|
||||||
<h4>{{trans('texts.plaid')}}</h4>
|
<h4>{{trans('texts.plaid')}}</h4>
|
||||||
@ -247,22 +250,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enablePlaidSettings() {
|
function onEnableAchChanged() {
|
||||||
var visible = $('#enable_ach').is(':checked');
|
var visible = $('#enable_ach').is(':checked');
|
||||||
|
$('.stripe-webhook-options').toggle(visible);
|
||||||
$('.stripe-ach-options').toggle(visible);
|
$('.stripe-ach-options').toggle(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onEnableAlipayChanged() {
|
||||||
|
var visible = $('#enable_alipay').is(':checked');
|
||||||
|
$('.stripe-webhook-options').toggle(visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateWebhookShown() {
|
||||||
|
var enableAch = $('#enable_ach').is(':checked');
|
||||||
|
var enableAlipay = $('#enable_alipay').is(':checked');
|
||||||
|
$('.stripe-webhook-options').toggle(enableAch || enableAlipay);
|
||||||
|
$('.stripe-ach-options').toggle(enableAch);
|
||||||
|
}
|
||||||
|
|
||||||
var gateways = {!! Cache::get('gateways') !!};
|
var gateways = {!! Cache::get('gateways') !!};
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
setFieldsShown();
|
setFieldsShown();
|
||||||
enablePlaidSettings();
|
updateWebhookShown();
|
||||||
|
|
||||||
$('#show_address').change(enableUpdateAddress);
|
$('#show_address').change(enableUpdateAddress);
|
||||||
enableUpdateAddress();
|
enableUpdateAddress();
|
||||||
|
|
||||||
$('#enable_ach').change(enablePlaidSettings)
|
$('#enable_ach').change(updateWebhookShown);
|
||||||
|
$('#enable_alipay').change(updateWebhookShown);
|
||||||
|
|
||||||
@if (!$accountGateway && count($secondaryGateways))
|
@if (!$accountGateway && count($secondaryGateways))
|
||||||
$('#primary_gateway_id').append($('<option>', {
|
$('#primary_gateway_id').append($('<option>', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user