-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cardCharge3ds & purchaseOffline
- Loading branch information
Showing
61 changed files
with
1,470 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Omnipay\Przelewy24\Message; | ||
|
||
class CardCharge3dsRequest extends AbstractRequest | ||
{ | ||
public function getData(): array | ||
{ | ||
$this->validate('token'); | ||
|
||
return [ | ||
'token' => $this->getToken(), | ||
]; | ||
} | ||
|
||
public function sendData($data): CardCharge3dsResponse | ||
{ | ||
$httpResponse = $this->sendRequest('POST', 'card/chargeWith3ds', $data); | ||
|
||
$responseData = json_decode($httpResponse->getBody()->getContents(), true); | ||
|
||
return $this->response = new CardCharge3dsResponse($this, $responseData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Omnipay\Przelewy24\Message; | ||
|
||
use Omnipay\Common\Message\RequestInterface; | ||
|
||
class CardCharge3dsResponse extends AbstractResponse | ||
{ | ||
/** | ||
* @var null|string | ||
*/ | ||
private $transactionId = null; | ||
|
||
public function __construct(RequestInterface $request, $data) | ||
{ | ||
parent::__construct($request, $data); | ||
if (isset($data['data'])) { | ||
if (isset($data['data']['orderId'])) { | ||
$this->transactionId = (string) $data['data']['orderId']; | ||
} | ||
} | ||
} | ||
|
||
public function getTransactionId(): ?string | ||
{ | ||
return $this->transactionId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Omnipay\Przelewy24\Message; | ||
|
||
class PurchaseOfflineRequest extends AbstractRequest | ||
{ | ||
public function getData(): array | ||
{ | ||
$this->validate('token'); | ||
|
||
return [ | ||
'token' => $this->getToken(), | ||
]; | ||
} | ||
|
||
public function sendData($data): PurchaseOfflineResponse | ||
{ | ||
$httpResponse = $this->sendRequest('POST', 'transaction/registerOffline', $data); | ||
|
||
$responseData = json_decode($httpResponse->getBody()->getContents(), true); | ||
|
||
return $this->response = new PurchaseOfflineResponse($this, $responseData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Omnipay\Przelewy24\Message; | ||
|
||
use Omnipay\Common\Message\RequestInterface; | ||
|
||
class PurchaseOfflineResponse extends AbstractResponse | ||
{ | ||
/** | ||
* @var string[] | ||
*/ | ||
private $info = []; | ||
|
||
public function __construct(RequestInterface $request, $data) | ||
{ | ||
parent::__construct($request, $data); | ||
|
||
if (isset($this->data['data'])) { | ||
$this->info = $this->data['data']; | ||
$this->info = $this->replaceInfoKeys($this->info, 'orderId', 'transactionId'); | ||
} | ||
} | ||
|
||
public function getInfo(): array | ||
{ | ||
return $this->info; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.