for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PHPSC\PagSeguro\Purchases\Subscriptions;
use DateTime;
use PHPSC\PagSeguro\Purchases\SubscriptionService as SubscriptionServiceInterface;
use PHPSC\PagSeguro\Service;
/**
* @author Luís Otávio Cobucci Oblonczyk <[email protected]>
*/
class SubscriptionService extends Service implements SubscriptionServiceInterface
{
* {@inheritdoc}
public function createChargeBuilder($code)
return new ChargeBuilder($code);
}
public function cancel($code)
$response = $this->get(static::CANCEL_ENDPOINT . '/' . $code);
return new CancellationResponse(
(string) $response->status,
new DateTime((string) $response->date)
);
public function charge(Charge $charge)
$response = $this->post(static::CHARGE_ENDPOINT, $charge->xmlSerialize());
return new ChargeResponse(
(string) $response->transactionCode,