@@ -518,22 +518,6 @@ defmodule AlgoraWeb.Org.JobLive do
518
518
"""
519
519
end
520
520
521
- @ impl true
522
- def handle_event ( "activate_subscription" , _params , socket ) do
523
- case Jobs . create_payment_session (
524
- % { socket . assigns . job | email: socket . assigns . current_user . email } ,
525
- socket . assigns . current_org . subscription_price
526
- ) do
527
- { :ok , url } ->
528
- Algora.Admin . alert ( "Payment session created for job posting: #{ socket . assigns . job . company_name } " , :info )
529
- { :noreply , redirect ( socket , external: url ) }
530
-
531
- { :error , reason } ->
532
- Logger . error ( "Failed to create payment session: #{ inspect ( reason ) } " )
533
- { :noreply , put_flash ( socket , :error , "Something went wrong. Please try again." ) }
534
- end
535
- end
536
-
537
521
@ impl true
538
522
def handle_event ( "toggle_payment_drawer" , _ , socket ) do
539
523
socket =
@@ -709,7 +693,7 @@ defmodule AlgoraWeb.Org.JobLive do
709
693
710
694
{ :noreply ,
711
695
socket
712
- |> put_flash ( :info , "We'll send you an invoice via email soon" )
696
+ |> put_flash ( :info , "We'll send you an invoice via email soon! " )
713
697
|> assign ( :show_payment_drawer , false ) }
714
698
715
699
% { valid?: false } = changeset ->
@@ -1535,7 +1519,7 @@ defmodule AlgoraWeb.Org.JobLive do
1535
1519
< . drawer_header >
1536
1520
< . drawer_title > Activate Subscription</ . drawer_title >
1537
1521
< . drawer_description >
1538
- Choose your preferred payment method to activate your annual subscription
1522
+ Choose your preferred payment method
1539
1523
</ . drawer_description >
1540
1524
</ . drawer_header >
1541
1525
@@ -1584,7 +1568,7 @@ defmodule AlgoraWeb.Org.JobLive do
1584
1568
< div class = "flex justify-between items-center " >
1585
1569
< span class = "text-sm text-muted-foreground " > Annual Subscription</ span >
1586
1570
< span class = "font-semibold font-display " >
1587
- { Money . to_string! ( @ current_org . subscription_price ) }
1571
+ { Money . to_string! ( price ( ) ) }
1588
1572
</ span >
1589
1573
</ div >
1590
1574
< div class = "flex justify-between items-center " >
@@ -1595,6 +1579,21 @@ defmodule AlgoraWeb.Org.JobLive do
1595
1579
) }
1596
1580
</ span >
1597
1581
</ div >
1582
+
1583
+ < div class = "flex justify-between items-center " >
1584
+ < span class = "text-sm text-muted-foreground " >
1585
+ Early Believer Discount:
1586
+ </ span >
1587
+ < span class = "font-semibold font-display -ml-1.5 " >
1588
+ -{ Money . to_string! (
1589
+ Money . sub! (
1590
+ price ( ) ,
1591
+ @ current_org . subscription_price
1592
+ )
1593
+ ) }
1594
+ </ span >
1595
+ </ div >
1596
+
1598
1597
< div class = "border-t pt-4 flex justify-between items-center " >
1599
1598
< span class = "font-semibold " > Total</ span >
1600
1599
< span class = "font-semibold font-display " >
@@ -1626,31 +1625,31 @@ defmodule AlgoraWeb.Org.JobLive do
1626
1625
< . card_content class = "pt-0 " >
1627
1626
< div class = "space-y-4 " >
1628
1627
< div class = "grid grid-cols-2 gap-2 text-sm " >
1629
- < span class = "text-muted-foreground " > Bank Name: </ span >
1628
+ < span class = "text-muted-foreground " > Bank Name</ span >
1630
1629
< span class = "font-medium " > { @ wire_details [ "bank_name" ] } </ span >
1631
1630
1632
- < span class = "text-muted-foreground " > Account Name: </ span >
1631
+ < span class = "text-muted-foreground " > Account Name</ span >
1633
1632
< span class = "font-medium " > { @ wire_details [ "account_name" ] } </ span >
1634
1633
1635
- < span class = "text-muted-foreground " > Account Number: </ span >
1634
+ < span class = "text-muted-foreground " > Account Number</ span >
1636
1635
< span class = "font-medium " > { @ wire_details [ "account_number" ] } </ span >
1637
1636
1638
- < span class = "text-muted-foreground " > Routing Number: </ span >
1637
+ < span class = "text-muted-foreground " > Routing Number</ span >
1639
1638
< span class = "font-medium " > { @ wire_details [ "routing_number" ] } </ span >
1640
1639
1641
- < span class = "text-muted-foreground " > SWIFT Code: </ span >
1640
+ < span class = "text-muted-foreground " > SWIFT Code</ span >
1642
1641
< span class = "font-medium " > { @ wire_details [ "swift_code" ] } </ span >
1643
1642
</ div >
1644
1643
1645
1644
< div class = "border-t pt-4 " >
1646
1645
< div class = "grid grid-cols-2 gap-2 text-sm " >
1647
- < span class = "text-muted-foreground " > Annual Subscription: </ span >
1646
+ < span class = "text-muted-foreground " > Annual Subscription</ span >
1648
1647
< span class = "font-medium font-display " >
1649
- { Money . to_string! ( @ current_org . subscription_price ) }
1648
+ { Money . to_string! ( price ( ) ) }
1650
1649
</ span >
1651
1650
1652
1651
< span class = "text-muted-foreground line-through block " >
1653
- Processing Fee:
1652
+ Stripe Processing Fee
1654
1653
</ span >
1655
1654
< span class = "font-medium font-display flex " >
1656
1655
< span class = "text-muted-foreground line-through " > $0</ span >
@@ -1661,15 +1660,35 @@ defmodule AlgoraWeb.Org.JobLive do
1661
1660
</ span >
1662
1661
</ span >
1663
1662
1664
- < span class = "text-muted-foreground " > Total:</ span >
1665
- < span class = "font-medium font-display " >
1666
- { Money . to_string! ( @ current_org . subscription_price ) }
1663
+ < span class = "text-muted-foreground block " >
1664
+ Early Believer Discount
1665
+ </ span >
1666
+ < span class = "font-medium font-display flex " >
1667
+ < span class = "-ml-1.5 " >
1668
+ -{ Money . to_string! (
1669
+ Money . sub! (
1670
+ price ( ) ,
1671
+ @ current_org . subscription_price
1672
+ )
1673
+ ) }
1674
+ </ span >
1667
1675
</ span >
1668
1676
</ div >
1669
1677
</ div >
1670
1678
1671
1679
< div class = "border-t pt-4 " >
1672
- < h4 class = "font-medium mb-4 " > Billing Information</ h4 >
1680
+ < div class = "grid grid-cols-2 gap-2 text-sm " >
1681
+ < span class = "text-foreground font-semibold " > Total</ span >
1682
+ < span class = "font-semibold font-display " >
1683
+ { Money . to_string! ( @ current_org . subscription_price ) }
1684
+ </ span >
1685
+ </ div >
1686
+ </ div >
1687
+
1688
+ < div class = "pt-6 " >
1689
+ < h4 class = "tracking-tight font-semibold leading-none text-2xl mb-4 " >
1690
+ Billing Details
1691
+ </ h4 >
1673
1692
< div class = "space-y-4 " >
1674
1693
< . input
1675
1694
type = "text "
@@ -1731,4 +1750,6 @@ defmodule AlgoraWeb.Org.JobLive do
1731
1750
</ . drawer >
1732
1751
"""
1733
1752
end
1753
+
1754
+ def price , do: Money . new! ( :USD , 35_000 , no_fraction_if_integer: true )
1734
1755
end
0 commit comments