Created
October 17, 2018 17:30
-
-
Save geekcom/5427990afd53ee12e1017e871832fcf7 to your computer and use it in GitHub Desktop.
SetShippingCost e SetShippingType PagSeguro - PHPSDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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