There are two broad ways to charge customers by credit card from your website: the difficult way and the easy way.
The difficult way
You can integrate directly with a payment gateway or bank API. That gives you more control, but it also means more technical work, more responsibility for testing, and more compliance requirements.
The easy way
Use a platform or plugin that already supports payment gateways such as Stripe, PayPal, or your local processor. In many cases this is enough for:
- online stores
- service payments
- invoices
- subscriptions
What you need either way
- HTTPS enabled with SSL
- a payment provider account
- clear pricing and refund information
- confirmation emails or receipts
If your goal is to start quickly, the practical path is usually to use an established ecommerce platform or payment plugin instead of building the integration from scratch.