Skip to content

Instantly share code, notes, and snippets.

@gstpereira
Last active December 29, 2015 11:49
Show Gist options
  • Save gstpereira/7666622 to your computer and use it in GitHub Desktop.
Save gstpereira/7666622 to your computer and use it in GitHub Desktop.
<?php
$sale = new \BUBB\Gateway\Clients\Sale();
$sale->setValue(12.5);
$sale->setNumber(5075093);
$card = new \BUBB\Gateway\Clients\Card();
$card->setNumber(4012001037141112);
$card->setValidity('05/2018');
$card->setIndicator(1);
$card->setSecurityCode(123);
$pathSSL = public_path() . '/ssl/VeriSignClass3PublicPrimaryCertificationAuthority-G5.crt';
$store = new \BUBB\Gateway\Clients\Store();
$store->setNumber(1006993069);
$store->setKey('25fbb99741c739dd84d7b06ec78c9bac718838630f30b112d033ce2e621b34f3');
$store->setSSL($pathSSL);
$operator = new \BUBB\Gateway\Clients\Operator();
$operator->setFlag(\BUBB\Cielo\Enum\Flag::VISA);
$operator->setTypePayment(\BUBB\Cielo\Enum\ProductPayment::CREDITO);
$operator->setPlots(1);
$operator->setReturnUrl('http://localhost.com');
$operator->setUrl('https://qasecommerce.cielo.com.br/servicos/ecommwsec.do');
$operator->setAuthorize(3);
$operator->setCapture(false);
$operator->setTid('10069930690AD5921001');
$operator->setPaymentAction('transaction');
$payment = new \BUBB\Gateway\Clients\Payment();
$payment->setPaymentForm('cielo');
$payment->setSale($sale);
$payment->setCard($card);
$payment->setStore($store);
$payment->setOperator($operator);
Gateway::execute($payment);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment