-
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.
- Loading branch information
1 parent
74b2113
commit a725517
Showing
3 changed files
with
87 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* This file is part of the Airwallex Payments module. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade | ||
* to newer versions in the future. | ||
* | ||
* @copyright Copyright (c) 2021 Magebit, Ltd. (https://magebit.com/) | ||
* @license GNU General Public License ("GPL") v3.0 | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace Airwallex\Payments\Model\Client\Request\PaymentIntents; | ||
|
||
use Airwallex\Payments\Model\Client\AbstractClient; | ||
use Airwallex\Payments\Model\Client\Interfaces\BearerAuthenticationInterface; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
||
class Get extends AbstractClient implements BearerAuthenticationInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private string $paymentIntentId; | ||
|
||
/** | ||
* @param string $id | ||
* | ||
* @return $this | ||
*/ | ||
public function setPaymentIntentId(string $id): self | ||
{ | ||
$this->paymentIntentId = $id; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getUri(): string | ||
{ | ||
return 'pa/payment_intents/' . $this->paymentIntentId; | ||
} | ||
|
||
/** | ||
* @param ResponseInterface $request | ||
* | ||
* @return string | ||
* @throws \JsonException | ||
*/ | ||
protected function parseResponse(ResponseInterface $request): string | ||
{ | ||
return $request->getBody()->getContents(); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod(): string | ||
{ | ||
return 'GET'; | ||
} | ||
} |
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