Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.9.0
- * @ Author : DeZender
- * @ Release on : 08.08.2019
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Gate\Pagseguro\Message;
- class CompletePurchaseRequest extends \Gate\Common\Request
- {
- protected $endpoint = 'https://ws.pagseguro.uol.com.br/v2/transactions/';
- protected $test_endpoint = 'https://ws.sandbox.pagseguro.uol.com.br/v2/transactions/';
- public function getSellerEmail()
- {
- return $this->getParameter('seller_email');
- }
- public function getToken()
- {
- return $this->getParameter('token');
- }
- public function getIsTest()
- {
- return $this->getParameter('isTest');
- }
- public function call()
- {
- if ($this->getIsTest()) {
- $this->endpoint = $this->test_endpoint;
- }
- $response = $this->sendData(['email' => $this->getSellerEmail(), 'token' => $this->getToken(), 'reference' => $this->getHash()], ['Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8'], 'GET');
- if (is_array($response)) {
- return $response;
- }
- $result = ads_xml_to_array($response);
- if (isset($result['error'])) {
- return ['error' => $result['error']['code'] . ': ' . $result['error']['message']];
- }
- $this->endpoint .= $result['transactions']['transaction']['code'] . '?email=' . $this->getSellerEmail() . '&token=' . $this->getToken();
- $response = $this->sendData([], ['Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8'], 'GET');
- if (is_array($response)) {
- return $response;
- ..............................................................
- ........................................
- ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement