File tree Expand file tree Collapse file tree
components/admin/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -622,6 +622,27 @@ const Settings = (props: SettingsProps) => {
622622 }
623623 } ;
624624
625+ const handleResetPaymentSettings = ( ) => {
626+ setNewSettings ( {
627+ ...newSettings ,
628+ currencyISOCode : "" ,
629+ paymentMethod : PAYMENT_METHOD_NONE ,
630+ stripeKey : "" ,
631+ stripeSecret : "" ,
632+ paypalSecret : "" ,
633+ paytmSecret : "" ,
634+ razorpayKey : "" ,
635+ razorpaySecret : "" ,
636+ razorpayWebhookSecret : "" ,
637+ lemonsqueezyKey : "" ,
638+ lemonsqueezyStoreId : "" ,
639+ lemonsqueezyWebhookSecret : "" ,
640+ lemonsqueezyOneTimeVariantId : "" ,
641+ lemonsqueezySubscriptionMonthlyVariantId : "" ,
642+ lemonsqueezySubscriptionYearlyVariantId : "" ,
643+ } ) ;
644+ } ;
645+
625646 const getPaymentSettings = ( getNewSettings = false ) => ( {
626647 currencyISOCode : getNewSettings
627648 ? newSettings . currencyISOCode
@@ -765,7 +786,7 @@ const Settings = (props: SettingsProps) => {
765786 </ div >
766787 </ div >
767788
768- < div >
789+ < div className = "flex gap-2" >
769790 < Button
770791 type = "submit"
771792 value = { BUTTON_SAVE }
@@ -789,6 +810,20 @@ const Settings = (props: SettingsProps) => {
789810 >
790811 { BUTTON_SAVE }
791812 </ Button >
813+ < Dialog2
814+ title = "Reset Payment Settings"
815+ trigger = { < Button variant = "soft" > Reset</ Button > }
816+ okButton = {
817+ < Button
818+ onClick = { handleResetPaymentSettings }
819+ >
820+ Reset
821+ </ Button >
822+ }
823+ >
824+ Are you sure you want to reset your payment
825+ settings?
826+ </ Dialog2 >
792827 </ div >
793828 </ Form >
794829
Original file line number Diff line number Diff line change 11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
3- import "./.next/types/routes.d.ts" ;
3+ /// <reference path= "./.next/types/routes.d.ts" />
44
55// NOTE: This file should not be edited
66// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
You can’t perform that action at this time.
0 commit comments