Skip to content

Commit 51ce499

Browse files
Sayak BhattacharyaSayak Bhattacharya
Sayak Bhattacharya
authored and
Sayak Bhattacharya
committed
fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock
1 parent 09f1734 commit 51ce499

File tree

6 files changed

+18
-30
lines changed

6 files changed

+18
-30
lines changed

crates/hyperswitch_connectors/src/connectors/bitpay.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -439,21 +439,19 @@ static BITPAY_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> = Laz
439439
bitpay_supported_payment_methods
440440
});
441441

442-
static BITPAY_CONNECTOR_INFO: LazyLock<ConnectorInfo> = LazyLock::new(|| {
443-
ConnectorInfo {
442+
static BITPAY_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
444443
display_name: "Bitpay",
445444
description:
446445
"BitPay is a cryptocurrency payment processor that enables businesses to accept Bitcoin and other digital currencies ",
447446
connector_type: enums::PaymentConnectorCategory::AlternativePaymentMethod,
448-
}
449-
});
447+
};
450448

451449
static BITPAY_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 1]> =
452450
LazyLock::new(|| [enums::EventClass::Payments]);
453451

454452
impl ConnectorSpecifications for Bitpay {
455453
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
456-
Some(&*BITPAY_CONNECTOR_INFO)
454+
Some(&BITPAY_CONNECTOR_INFO)
457455
}
458456

459457
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {

crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -548,21 +548,19 @@ static DIGITALVIRGO_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods>
548548
digitalvirgo_supported_payment_methods
549549
});
550550

551-
static DIGITALVIRGO_CONNECTOR_INFO: LazyLock<ConnectorInfo> = LazyLock::new(|| {
552-
ConnectorInfo {
551+
static DIGITALVIRGO_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
553552
display_name: "Digital Virgo",
554553
description:
555554
"Digital Virgo is an alternative payment provider specializing in carrier billing and mobile payments ",
556555
connector_type: enums::PaymentConnectorCategory::AlternativePaymentMethod,
557-
}
558-
});
556+
};
559557

560558
static DIGITALVIRGO_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 0]> =
561559
LazyLock::new(|| []);
562560

563561
impl ConnectorSpecifications for Digitalvirgo {
564562
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
565-
Some(&*DIGITALVIRGO_CONNECTOR_INFO)
563+
Some(&DIGITALVIRGO_CONNECTOR_INFO)
566564
}
567565

568566
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {

crates/hyperswitch_connectors/src/connectors/helcim.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -890,20 +890,18 @@ static HELCIM_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> = Laz
890890
helcim_supported_payment_methods
891891
});
892892

893-
static HELCIM_CONNECTOR_INFO: LazyLock<ConnectorInfo> = LazyLock::new(|| {
894-
ConnectorInfo {
893+
static HELCIM_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
895894
display_name: "Helcim",
896895
description:
897896
"Helcim is a payment processing company that offers transparent, affordable merchant services for businesses of all sizes",
898897
connector_type: enums::PaymentConnectorCategory::PaymentGateway,
899-
}
900-
});
898+
};
901899

902900
static HELCIM_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 0]> = LazyLock::new(|| []);
903901

904902
impl ConnectorSpecifications for Helcim {
905903
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
906-
Some(&*HELCIM_CONNECTOR_INFO)
904+
Some(&HELCIM_CONNECTOR_INFO)
907905
}
908906

909907
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {

crates/hyperswitch_connectors/src/connectors/jpmorgan.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -870,20 +870,18 @@ static JPMORGAN_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
870870
jpmorgan_supported_payment_methods
871871
});
872872

873-
static JPMORGAN_CONNECTOR_INFO: LazyLock<ConnectorInfo> = LazyLock::new(|| {
874-
ConnectorInfo {
873+
static JPMORGAN_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
875874
display_name: "Jpmorgan",
876875
description:
877876
"J.P. Morgan is a global financial services firm and investment bank, offering banking, asset management, and payment processing solutions",
878877
connector_type: enums::PaymentConnectorCategory::BankAcquirer,
879-
}
880-
});
878+
};
881879

882880
static JPMORGAN_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 0]> = LazyLock::new(|| []);
883881

884882
impl ConnectorSpecifications for Jpmorgan {
885883
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
886-
Some(&*JPMORGAN_CONNECTOR_INFO)
884+
Some(&JPMORGAN_CONNECTOR_INFO)
887885
}
888886

889887
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {

crates/hyperswitch_connectors/src/connectors/paybox.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -752,20 +752,18 @@ static PAYBOX_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> = Laz
752752
paybox_supported_payment_methods
753753
});
754754

755-
static PAYBOX_CONNECTOR_INFO: LazyLock<ConnectorInfo> = LazyLock::new(|| {
756-
ConnectorInfo {
755+
static PAYBOX_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
757756
display_name: "Paybox",
758757
description:
759758
"Paybox is a payment gateway that enables businesses to process online transactions securely ",
760759
connector_type: enums::PaymentConnectorCategory::PaymentGateway,
761-
}
762-
});
760+
};
763761

764762
static PAYBOX_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 0]> = LazyLock::new(|| []);
765763

766764
impl ConnectorSpecifications for Paybox {
767765
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
768-
Some(&*PAYBOX_CONNECTOR_INFO)
766+
Some(&PAYBOX_CONNECTOR_INFO)
769767
}
770768

771769
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {

crates/hyperswitch_connectors/src/connectors/payu.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -871,20 +871,18 @@ static PAYU_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> = LazyL
871871
payu_supported_payment_methods
872872
});
873873

874-
static PAYU_CONNECTOR_INFO: LazyLock<ConnectorInfo> = LazyLock::new(|| {
875-
ConnectorInfo {
874+
static PAYU_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
876875
display_name: "Payu",
877876
description:
878877
"PayU is a global fintech company providing online payment solutions, including card processing, UPI, wallets, and BNPL services across multiple markets ",
879878
connector_type: enums::PaymentConnectorCategory::PaymentGateway,
880-
}
881-
});
879+
};
882880

883881
static PAYU_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 0]> = LazyLock::new(|| []);
884882

885883
impl ConnectorSpecifications for Payu {
886884
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
887-
Some(&*PAYU_CONNECTOR_INFO)
885+
Some(&PAYU_CONNECTOR_INFO)
888886
}
889887

890888
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {

0 commit comments

Comments
 (0)