The cost for a payment processor 3% and 30 cents per transaction PLUS the costs (time-related, development-related, support-related) to manage to obtain a merchant account, deal with VAT, fraud detection, a nice customer experience, and many other things. For startups you end up way ahead by NOT rolling your own solution to this and other problems.