@megotickets/payments
v1.0.10
Published
Payment processing components for MegoTickets React components library
Maintainers
Readme
@megotickets/payments
Payment processing components for MegoTickets React components library.
Installation
npm install @megotickets/paymentsUsage
import { Ticket, MegoBuyTicketModal, BuyTicketForm } from '@megotickets/payments';
function PaymentPage() {
return (
<div>
{/* Show all sections (default behavior) */}
<Ticket
ticketId="your-ticket-id"
googleMapsApiKey="your-google-maps-api-key"
/>
{/* Show only header and payment sections */}
<Ticket
ticketId="your-ticket-id"
showHeader={true}
showPayment={true}
showLocation={false}
showUserNFT={false}
/>
{/* Show only the location section */}
<Ticket
ticketId="your-ticket-id"
googleMapsApiKey="your-google-maps-api-key"
showHeader={false}
showPayment={false}
showLocation={true}
showUserNFT={false}
/>
<MegoBuyTicketModal>
<BuyTicketForm />
</MegoBuyTicketModal>
</div>
);
}Components
Ticket- Ticket display component with Google Maps integrationMegoBuyTicketModal- Main ticket purchase modalBuyTicketForm- Ticket purchase formBuyTicketWithCrypto- Cryptocurrency payment componentBuyTicketWithStripe- Stripe payment componentMyTicket- User's ticket management component
Ticket Component Props
ticketId(string, required) - The ID of the ticket to displaygoogleMapsApiKey(string, optional) - Google Maps API key for location displayshowOnlyButton(boolean, optional) - Show only the claim/buy buttonoverrideButton(ReactNode, optional) - Custom button to override the defaultonTicketLoad(function, optional) - Callback when ticket data is loadedmetadataConfig(array, optional) - Configuration for metadata fieldsshareEmail(object, optional) - Email sharing configurationredirectUrl(string, optional) - URL to redirect after actions
Display Control Props (all default to true)
showHeader(boolean, optional) - Show/hide the ticket header sectionshowPayment(boolean, optional) - Show/hide the payment sectionshowLocation(boolean, optional) - Show/hide the location sectionshowUserNFT(boolean, optional) - Show/hide the user NFT section
License
MIT
