Create Payment Plugin

I have been trying to create a new payment method plugin based on the example at Payment Plugin however, I’ve been having problems. What should the composer.json file contain? The service id in the example is "Swag\PaymentPlugin\Service\MyCustomPaymentHandler, but what does PaymentPlugin refer to? This doesn’t appear in the other files. How should the plugin and service be named, as this isn’t clear from the example.

I would greatly appreciate any help or working sample that anyone could share. Thanks.