Skip to content

Instantly share code, notes, and snippets.

@geekcom
Created October 17, 2018 17:30
Show Gist options
  • Save geekcom/5427990afd53ee12e1017e871832fcf7 to your computer and use it in GitHub Desktop.
Save geekcom/5427990afd53ee12e1017e871832fcf7 to your computer and use it in GitHub Desktop.
SetShippingCost e SetShippingType PagSeguro - PHPSDK
<?php
namespace BilletService;
use PagSeguro\Domains\Requests\DirectPayment\Boleto as BilletPagseguroApi;
class BilletService
{
private $billetPagseguroApi;
public function __construct()
{
$this->billetPagseguroApi = new BilletPagseguroApi();
}
//definindo o tipo do Shipping
private function setShippingType()
{
$this->billetPagseguroApi
->setShipping()
->setType()
->withParameters(\PagSeguro\Enum\Shipping\Type::NOT_SPECIFIED); //aqui defini o tipo como nao especificado
}
//definindo o custo do Shipping
private function setShippingCost()
{
$this->billetPagseguroApi
->setShipping()
->setCost()
->withParameters(3.8); //aqui defino o custo
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment