コード例 #1
0
function createTransactionRequest()
{
    $transactionRequest = new TransactionRequest();
    $transactionRequest->setSellerMail("*****@*****.**");
    $transactionRequest->setIpSeller("127.0.0.1");
    $transactionRequest->setOrderId("123456");
    $transactionRequest->setBuyer(createBuyer());
    $transactionRequest->setFree("Campo livre");
    $transactionRequest->setFreight(10.95);
    $transactionRequest->setFreightType(FreightTypeEnum::E_SEDEX);
    $transactionRequest->setDiscount(1.2);
    $transactionRequest->setAddition(3);
    $transactionRequest->setUrlReturn("https://www.bcash.com.br/loja/retorno.php");
    $transactionRequest->setUrlNotification("https://www.bcash.com.br/loja/aviso.php");
    $transactionRequest->setProducts(createProduct());
    $transactionRequest->setInstallments(5);
    $transactionRequest->setCurrency(CurrencyEnum::REAL);
    $transactionRequest->setAcceptedContract("S");
    $transactionRequest->setViewedContract("S");
    $transactionRequest->setCampaignId("123");
    return $transactionRequest;
}