-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegra_transparente.php
98 lines (92 loc) · 2.46 KB
/
integra_transparente.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
$email = "[email protected]";
$token = "D193CD83E4BE43F7A33E3D652FE072EE";
$url = "https://ws.sandbox.pagseguro.uol.com.br/v2/transactions/?email=".$email."&token=".$token;
$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"?><payment>
<mode>default</mode>
<method>credit_card</method>
<reference>$id_venda</reference>
<receiver>
<email>$email</email>
</receiver>
<sender>
<name>Livia Dionizio</name>
<email>[email protected]</email>
<phone>
<areaCode>17</areaCode>
<number>981452144</number>
</phone>
<documents>
<document>
<type>CPF</type>
<value>40236258842</value>
</document>
</documents>
<!--
<hash>d5f881a700849e2b5817dd4e5bfb1e518a96cd7e54171b6d5d55fbae53bf01f2</hash>
-->
</sender>
<currency>BRL</currency>
<notificationURL>http://www.guicheweb.com.br/compra/retornops.php</notificationURL>
<items>
<item>
<id>1</id>
<description>Ingresso 1</description>
<quantity>2</quantity>
<amount>1.00</amount>
</item>
</items>
<!--
Informações sobre pagamento em débito (eft) ou boleto
-->
<bank>
<name>bradesco</name>
</bank>
<!--
Informações sobre pagamento em cartão de crédito
-->
<creditCard>
<token>dc251dc26d99463792b69f661df649bc</token>
<installment>
<quantity>1</quantity>
<value>5.50</value>
</installment>
<holder>
<name>Nome impresso no cartão</name>
<birthDate>13/02/1992</birthDate>
<phone>
<areaCode>17</areaCode>
<number>981452144</number>
</phone>
<documents>
<document>
<type>CPF</type>
<value>40236258842</value>
</document>
</documents>
</holder>
<billingAddress>
<street>R. Itacolomi</street>
<number>3699</number>
<complement></complement>
<district>Vila Marin</district>
<city>Votuporanga</city>
<state>SP</state>
<country>BRA</country>
<postalCode>15500467</postalCode>
</billingAddress>
</creditCard>
</payment>";
//var_dump($xml);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, Array("Content-Type: application/xml; charset=UTF-8"));
curl_setopt($curl, CURLOPT_POSTFIELDS,$xml);
$xml_retorno = curl_exec($curl);
curl_close($curl);
//echo $xml_retorno;
$xml_retorno = simplexml_load_string($xml_retorno);
print_r($xml_retorno);
?>