|
@@ 184-197 (lines=14) @@
|
| 181 |
|
* |
| 182 |
|
* @throws \Exception |
| 183 |
|
*/ |
| 184 |
|
public function authorizePaymentRequest($paymentId, AuthorizePaymentRequest $paymentRequest = null) |
| 185 |
|
{ |
| 186 |
|
$this->configuration->assertLoaded(); |
| 187 |
|
|
| 188 |
|
$request = RequestBuilder::post($this->getAuthorizePaymentURL($paymentId)) |
| 189 |
|
->addRawHeader( |
| 190 |
|
$this->getToken(OauthToken::SCOPE_PAYMENT_ACTIONS)->getAuthorizationString() |
| 191 |
|
) |
| 192 |
|
->setRequestEntity($paymentRequest ?: new AuthorizePaymentRequest()) |
| 193 |
|
->setResponseEntity(new AuthorizePaymentResponse()) |
| 194 |
|
->build(); |
| 195 |
|
|
| 196 |
|
return $this->getHttpClient()->execute($request); |
| 197 |
|
} |
| 198 |
|
|
| 199 |
|
/** |
| 200 |
|
* {@inheritdoc} |
|
@@ 267-282 (lines=16) @@
|
| 264 |
|
* |
| 265 |
|
* @throws \Exception |
| 266 |
|
*/ |
| 267 |
|
public function shippingGoodsPaymentRequest( |
| 268 |
|
$paymentId, |
| 269 |
|
ShippingGoodsPaymentRequest $paymentRequest = null |
| 270 |
|
) { |
| 271 |
|
$this->configuration->assertLoaded(); |
| 272 |
|
|
| 273 |
|
$request = RequestBuilder::post($this->getShippingGoodsPaymentURL($paymentId)) |
| 274 |
|
->addRawHeader( |
| 275 |
|
$this->getToken(OauthToken::SCOPE_PAYMENT_ACTIONS)->getAuthorizationString() |
| 276 |
|
) |
| 277 |
|
->setRequestEntity($paymentRequest ?: new ShippingGoodsPaymentRequest()) |
| 278 |
|
->setResponseEntity(new ShippingGoodsPaymentResponse()) |
| 279 |
|
->build(); |
| 280 |
|
|
| 281 |
|
return $this->getHttpClient()->execute($request); |
| 282 |
|
} |
| 283 |
|
|
| 284 |
|
/** |
| 285 |
|
* {@inheritdoc} |