-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpayment.php
54 lines (47 loc) · 1.2 KB
/
payment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
include '../vendor/autoload.php';
//\Sounoob\pagseguro\config\Config::setAccountCredentials('seu@email.com.br', 'BD65179DCD806314A77B774DF6148CA9');
$payment = new \Sounoob\pagseguro\Payment();
$itens = array();
$itens[] = array(
'id' => '0001',
'description' => 'Notebook prata',
'quantity' => 2,
'amount' => '130.00',
);
$itens[] = array(
'id' => '0002',
'description' => 'Notebook preto',
'quantity' => 2,
'amount' => '430.00',
);
$itens[] = array(
'id' => '0003',
'description' => 'Notebook rosa',
'quantity' => 4,
'amount' => '330.00',
'shippingCost' => '0.99',
);
$payment->addItens($itens);
$item4 = array();
$item4['id'] = 0004;
$item4['description'] = 'Notebook azul';
$item4['quantity'] = '8';
$item4['amount'] = '150.00';
$item4['weight'] = '200';
$item4['shippingCost'] = '1.00';
$payment->addItem(
$item4['id'],
$item4['description'],
$item4['quantity'],
$item4['amount'],
$item4['weight'],
$item4['shippingCost']
);
//$payment->skipAddress();
$payment->setShippingAddressState('SP');
$payment->setShippingTypeSedex();
//$payment->setShippingTypeOther();
//$payment->setShippingTypePAC();
$payment->send();
print_r($payment);exit;