クラス
Get
Amazon Pay V2 SDK Get Charge Permission.
ソース ソース
ファイル: src/API/ChargePermission/Get.php
class Get { /** * AmazonPay module object * * @var AmazonPay */ private $module; /** * Sets `$module` member var with dependency injection. * * @author Evan D Shaw <evandanielshaw@gmail.com> * @param AmazonPay $module * @return void */ public function __construct(AmazonPay $module) { $this->module = $module; } /** * Gets a Charge Permission * * @see https://amazonpaycheckoutintegrationguide.s3.amazonaws.com/amazon-pay-api-v2/charge-permission.html#get-charge-permission * @author Evan D Shaw <evandanielshaw@gmail.com> * @param string $chargePermissionId Charge Permission ID * @return array * @throws InvalidArgumentException Thrown by `getAmazonClient`. */ public function get($chargePermissionId) { try { $client = $this->module->getAmazonClient(); $result = $client->getChargePermission($chargePermissionId); if ($this->module->errors->hasError($result)) { return $this->module->errors->getAmzErrorResponse($result); } } catch (\Exception $e) { return $this->module->errors->getErrorResponse( GenericErrorStore::AMAZON_PAY_SDK_CLIENT_EXCEPTION, [$e->getMessage()] ); } return $result; } }
- __construct — Sets $module member var with dependency injection.
- get — Gets a Charge Permission