Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelen5 committed Apr 13, 2024
1 parent e61cb15 commit e91a5b9
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions public/ts/payment_common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,10 @@ export function initializeStripe() {
stripe = Stripe(window.stripeKey);
}

export function mountStripe() {
// Create an instance of Elements.
const elements = stripe.elements({ locale: "sv" });
// Custom styling can be passed to options when creating an Element.
const stripeStyle = {
base: {
color: "#32325d",
lineHeight: "18px",
fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
fontSmoothing: "antialiased",
fontSize: "16px",
"::placeholder": {
color: "#aab7c4",
},
},
invalid: {
color: "#fa755a",
iconColor: "#fa755a",
},
};

// Create an instance of the card Element.
card = elements.create("card", { style: stripeStyle });
card.mount("#card-element");

payButton = document.getElementById("pay-button") as HTMLInputElement;
spinner = document.querySelector(".progress-spinner");
errorElement = document.getElementById("card-errors");
return card;
}

interface InitializePaymentFunction {
(result: any): Promise<any>;
}
interface ResponseFunction {
(json: any): void;
}

export interface PaymentFlowDefinition {
initiate_payment: InitializePaymentFunction;
before_initiate_payment?: Function;
Expand All @@ -85,10 +52,6 @@ export function disable_pay_button() {
spinner.classList.add("progress-spinner-visible");
}

function default_before_initiate_payment() {
disable_pay_button();
errorElement.textContent = "";
}
export function display_stripe_error(error: any) {
errorElement.textContent = error.message;
UIkit.modal.alert("<h2>Your payment failed</h2>" + errorElement.innerHTML);
Expand Down

0 comments on commit e91a5b9

Please sign in to comment.