1. Go to this page and download the library: Download tear/moip-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tear / moip-bundle example snippets
// app/AppKernel.php
public function registerBundles()
{
return [
// ...
new LeonnLeite\MoipBundle\MoipBundle(),
// ...
];
}
//...
class AcmeController extends Controller
{
public function indexAction()
{
try {
$customer = $this->get('moip')
->customers()->setOwnId(uniqid())
->setFullname('Fulano de Tal')
->setEmail('[email protected]')
->setBirthDate('1988-12-30')
->setTaxDocument('22222222222')
->setPhone(11, 66778899)
->addAddress('BILLING',
'Rua de teste', 123,
'Bairro', 'Sao Paulo', 'SP',
'01234567', 8)
->addAddress('SHIPPING',
'Rua de teste do SHIPPING', 123,
'Bairro do SHIPPING', 'Sao Paulo', 'SP',
'01234567', 8)
->create();
print_r($customer);
} catch (Exception $e) {
printf($e->__toString());
}
//...