diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index d247c22690..35ead952f7 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -937,7 +937,11 @@ class BasePaymentDriver $url = 'javascript:showCustomModal();'; $label = e($this->accountGateway->getConfigField('name')); } else { - $url = $this->paymentUrl($gatewayTypeAlias); + if ($gatewayTypeId == GATEWAY_TYPE_ALIPAY) { + $url = url("/create_source/{$this->invitation->invitation_key}/alipay"); + } else { + $url = $this->paymentUrl($gatewayTypeAlias); + } if ($custom = $this->account()->getLabel($gatewayTypeAlias)) { $label = $custom; } else { diff --git a/resources/views/accounts/account_gateway.blade.php b/resources/views/accounts/account_gateway.blade.php index 835b6e2f6b..f4bca20093 100644 --- a/resources/views/accounts/account_gateway.blade.php +++ b/resources/views/accounts/account_gateway.blade.php @@ -158,7 +158,7 @@ ->help(trans('texts.stripe_alipay_help', ['link' => link_to('https://dashboard.stripe.com/account/payments/settings', 'Stripe', ['target' => '_blank'])])) ->value(1) !!} -
+
@@ -168,6 +168,9 @@ ]) !!}
+
+ +

{{trans('texts.plaid')}}

@@ -247,22 +250,36 @@ } } - function enablePlaidSettings() { + function onEnableAchChanged() { var visible = $('#enable_ach').is(':checked'); + $('.stripe-webhook-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') !!}; $(function() { setFieldsShown(); - enablePlaidSettings(); + updateWebhookShown(); $('#show_address').change(enableUpdateAddress); enableUpdateAddress(); - $('#enable_ach').change(enablePlaidSettings) + $('#enable_ach').change(updateWebhookShown); + $('#enable_alipay').change(updateWebhookShown); @if (!$accountGateway && count($secondaryGateways)) $('#primary_gateway_id').append($('