function exampleConfigPaymentWay($param) { $moip = new Moip(); $moip->setEnvironment('test'); $moip->setCredential(array('key' => 'ABABABABABABABABABABABABABABABABABABABAB', 'token' => '01010101010101010101010101010101')); $moip->setUniqueID(false); $moip->setValue('100.00'); $moip->setReason('Teste do Moip-PHP'); $moip->setPayer(array('name' => 'Nome Sobrenome', 'email' => '*****@*****.**', 'payerId' => 'id_usuario', 'billingAddress' => array('address' => 'Rua do Zézinho Coração', 'number' => '45', 'complement' => 'z', 'city' => 'São Paulo', 'neighborhood' => 'Palhaço Jão', 'state' => 'SP', 'country' => 'BRA', 'zipCode' => '01230-000', 'phone' => '(11)8888-8888'))); $moip->validate('Identification'); $moip->addPaymentWay('creditCard'); $moip->addPaymentWay('billet'); $moip->setBilletConf("2011-04-06", true, array("Primeira linha", "Segunda linha", "Terceira linha"), "http://seusite.com.br/logo.gif"); print_r($moip->send()); }
<?php phpinfo(); ini_set('display_errors', 1); require 'vendor/autoload.php'; /** include_once 'examples.php'; exampleBasicInstructions(); exampleFull(); exampleQueryParcels(); * */ use Moip\Moip; $moip = new Moip(); $moip->setEnvironment('test'); $moip->setCredential(array('key' => '8UUKVUTBRLBGDGISZUY7UY7Y22SHZO3OIKBW6RMJ', 'token' => '6YA2TFYGRIWA5LPPTUJRJ88VPBNMKLF1')); $moip->setUniqueID(false); $moip->setValue('100.00'); $moip->setReason('Teste do Moip-PHP'); $moip->validate('Basic'); $moip->send(); print_r($moip->getAnswer());