mirror of
https://gitlab.metager.de/open-source/MetaGer.git
synced 2025-10-06 00:32:55 +02:00
remove creditcard option from membership form
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Localization;
|
||||
use App\Mail\Membership\ApplicationDeny;
|
||||
use App\Mail\Membership\MembershipAdminApplicationNotification;
|
||||
use App\Mail\Membership\MembershipAdminPaymentFailed;
|
||||
use App\Mail\Membership\PaymentMethodCard;
|
||||
use App\Mail\Membership\PaymentMethodFailed;
|
||||
use App\Mail\Membership\PaymentReminder;
|
||||
use App\Mail\Membership\ReductionDeny;
|
||||
@@ -40,6 +41,9 @@ class MembershipController extends Controller
|
||||
|
||||
public function test(Request $request)
|
||||
{
|
||||
return response()->json(["id" => PayPal::GET_ID()]);
|
||||
$mail = new PaymentMethodCard(CiviCrm::FIND_MEMBERSHIPS(membership_id: "2376")[0]);
|
||||
return $mail;
|
||||
abort(404);
|
||||
}
|
||||
/**
|
||||
@@ -289,7 +293,7 @@ class MembershipController extends Controller
|
||||
$validator->sometimes("interval", 'required|in:annual,six-monthly,quarterly,monthly', function (Fluent $input) use ($application) {
|
||||
return $application !== null && ($application->contact !== null || $application->company !== null) && $application->amount !== null && $application->interval === null;
|
||||
});
|
||||
$validator->sometimes("payment-method", 'required|in:directdebit,banktransfer,paypal,card', function (Fluent $input) use ($application) {
|
||||
$validator->sometimes("payment-method", 'required|in:directdebit,banktransfer,paypal', function (Fluent $input) use ($application) {
|
||||
return $application !== null && ($application->contact !== null || $application->company !== null) && $application->amount !== null && $application->interval !== null;
|
||||
});
|
||||
$validator->sometimes("iban", ["exclude_unless:payment-method,directdebit", "required", new IBANValidator()], function (Fluent $input) use ($application) {
|
||||
@@ -410,7 +414,6 @@ class MembershipController extends Controller
|
||||
$application->save();
|
||||
break;
|
||||
case "paypal":
|
||||
case "card":
|
||||
return $this->createPayPalAuthorizeOrder(
|
||||
$application,
|
||||
$form_data["payment-method"],
|
||||
@@ -450,6 +453,12 @@ class MembershipController extends Controller
|
||||
case "VAULT.PAYMENT-TOKEN.DELETED":
|
||||
$vault_id = $request->input("resource.id");
|
||||
MembershipPaymentPaypal::where("vault_id", "=", $vault_id)->delete();
|
||||
$membership = CiviCrm::FIND_MEMBERSHIP_PAYPAL_VAULT($vault_id);
|
||||
if ($membership === null)
|
||||
abort(500);
|
||||
if (sizeof($membership) === 0)
|
||||
return response()->json([]);
|
||||
$membership = Arr::get($membership, "0");
|
||||
if (($membership_data = CiviCrm::REMOVE_MEMBERSHIP_PAYPAL_VAULT($vault_id)) !== null) {
|
||||
$membership_id = Arr::get($membership_data, "values.0.id");
|
||||
if ($membership_id !== null) {
|
||||
|
@@ -1,6 +1,3 @@
|
||||
import { initializeCreditcard } from "./membership_creditcard";
|
||||
|
||||
|
||||
// Add event when custom amount is selected to focus the input field
|
||||
document.querySelector("#amount-custom")?.addEventListener("change", (e) => {
|
||||
if (!e.target.checked) {
|
||||
@@ -16,7 +13,6 @@ document.addEventListener("DOMContentLoaded", (e) => {
|
||||
document.querySelectorAll("input[name=payment-method]").forEach((input) => {
|
||||
input.addEventListener("change", (e) => {
|
||||
updateIBANRequired();
|
||||
initializeCreditcard();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,10 +26,6 @@ document.querySelectorAll("input[name=payment-method]").forEach((input) => {
|
||||
});
|
||||
})();
|
||||
|
||||
(async () => {
|
||||
initializeCreditcard();
|
||||
})();
|
||||
|
||||
function validateAmount() {
|
||||
let amount_element = document.querySelector("input[name=amount]:checked");
|
||||
if (amount_element == null) return;
|
||||
|
@@ -242,7 +242,6 @@
|
||||
@endif
|
||||
<div class="funding-sources">
|
||||
<img src="/img/funding_source/sepa.svg" alt="SEPA">
|
||||
<img src="/img/funding_source/card.svg" alt="Creditcard">
|
||||
<img src="/img/funding_source/paypal.svg" alt="PayPal">
|
||||
</div>
|
||||
</h3>
|
||||
@@ -263,9 +262,6 @@
|
||||
<input type="radio" name="payment-method" id="payment-method-paypal" class="js-only" value="paypal"
|
||||
@if($payment_method==="paypal" )checked @endif required>
|
||||
<label for="payment-method-paypal" class="js-only">PayPal</label>
|
||||
<input type="radio" name="payment-method" id="payment-method-creditcard" class="js-only" value="card"
|
||||
@if($payment_method==="card" )checked @endif required data-clientid="{{ config("metager.metager.paypal.membership.client_id") }}">
|
||||
<label for="payment-method-creditcard" class="js-only">Kredit-/Debitkarte</label>
|
||||
<div id="directdebit-data" class="info-container">
|
||||
@if(isset($errors) && $errors->has("iban"))
|
||||
@foreach($errors->get("iban") as $error)
|
||||
@@ -294,6 +290,7 @@
|
||||
<div>@lang('membership.application.payment_block')</div>
|
||||
@endif
|
||||
</div>
|
||||
{{-- Credit card memberships are disabled for now
|
||||
<div id="creditcard-data" class="info-container" data-loading-text="{{ __('spende.execute-payment.card.loading') }}" data-is-update="{{ $application !== null ? $application->is_update : false }}">
|
||||
<div id="creditcard-name-container">
|
||||
<label for="creditcard-name">@lang("spende.execute-payment.card.name")</label>
|
||||
@@ -351,6 +348,7 @@
|
||||
<div id="payment-block">@lang('membership.application.payment_block')</div>
|
||||
@endif
|
||||
</div>
|
||||
--}}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user