<?php

namespace Omise\Payment\Gateway\Http\Client;

require_once dirname(__FILE__).'/../Lib/omise-php/lib/omise/OmiseCharge.php';

class Charge extends AbstractOmiseClient
{
    /**
     * @param  array $body
     *
     * @return array
     */
    public function request(Array $body)
    {
        return \OmiseCharge::create([
            'amount'   => 10000,
            'currency' => "thb",
            'card'     => "tokn_test_55zygut6s3y0s91k0n5"
        ]);
    }
}

<?php

namespace Omise\Payment\Gateway\Http\Client;

require_once dirname(__FILE__).'/../Lib/omise-php/lib/omise/OmiseCharge.php';

class Charge extends AbstractOmiseClient
{
    /**
     * @param  array $body
     *
     * @return array
     */
    public function request(Array $body)
    {
        return \OmiseCharge::create([
            'amount'   => 10000,
            'currency' => "thb",
            'card'     => "tokn_test_55zygut6s3y0s91k0n5",
            'capture'  => true
        ], $this->publicKey, $this->secretKey);
    }
}

Create the charge with authorize and capture by using the key from DB
Create the charge with authorize and capture by using the key from DB

Create the charge with authorize and capture. The public key and secret
key will be used from the initialize of parent class.

Add a parameter, capture, and set the value to be true.

Although, without this parameter, capture, the charge will be captured
automatically by default but this adding parameter will be add more
intention to this charge creation. Others developer do not need to set
the assumption.