Exemplo n.º 1
0
$Customer->setName('Robson Morais');
$Customer->setID('1001');
$Customer->setEmail('*****@*****.**');
//Customer address (optional)
$AddressData = new BraspagAddressData();
$AddressData->Street = 'Blvd. 28 de Setembro';
$AddressData->Number = '389';
$AddressData->Complement = 'Sala 512';
$AddressData->District = 'Vila Isabel';
$AddressData->City = 'Rio de Janeiro';
$AddressData->State = 'RJ';
$AddressData->ZipCode = '20551030';
$AddressData->Country = 'BR';
//Set address data is optional
$Customer->setAddressData($AddressData);
$Customer->setDeliveryAddressData($AddressData);
///////////////
//Credit card
///////////////
$CreditCard = new BraspagCreditCardModel();
//Capture transaction after authorization
$CreditCard->setTransactionType(BraspagCreditCardModel::TRANSACTION_TYPE_AUTOCAPTURE);
//Testing
$CreditCard->setMethod(BraspagCreditCardModel::METHOD_HOMOLOGATION);
//Order and payment info
$CreditCard->setOrderId('3598754');
$CreditCard->setCardNumber('0000000000000001');
$CreditCard->setCardHolder("ROBSON M SANTOS");
$CreditCard->setCardExpirationDate('06', '2015');
$CreditCard->setCardSecurityCode('345');
$CreditCard->setCurrency('BRL');