33namespace Omnipay \Alipay ;
44
55use Omnipay \Alipay \Requests \AopCompletePurchaseRequest ;
6+ use Omnipay \Alipay \Requests \AopCompleteRefundRequest ;
67use Omnipay \Alipay \Requests \AopTradeCancelRequest ;
78use Omnipay \Alipay \Requests \AopTradeCloseRequest ;
89use Omnipay \Alipay \Requests \AopTradeOrderSettleRequest ;
1415use Omnipay \Alipay \Requests \DataServiceBillDownloadUrlQueryRequest ;
1516use Omnipay \Common \AbstractGateway ;
1617use Omnipay \Common \Exception \InvalidRequestException ;
18+ use Omnipay \Common \Message \AbstractRequest ;
1719
1820abstract class AbstractAopGateway extends AbstractGateway
1921{
@@ -305,6 +307,10 @@ public function setAlipaySdk($value)
305307 }
306308
307309
310+ /**
311+ * @return AbstractAopGateway
312+ * @throws InvalidRequestException
313+ */
308314 public function production ()
309315 {
310316 return $ this ->setEnvironment ('production ' );
@@ -342,16 +348,22 @@ public function setEndpoint($value)
342348 }
343349
344350
351+ /**
352+ * @return AbstractAopGateway
353+ * @throws InvalidRequestException
354+ */
345355 public function sandbox ()
346356 {
347357 return $ this ->setEnvironment ('sandbox ' );
348358 }
349359
350360
351361 /**
362+ * @noinspection PhpDocRedundantThrowsInspection
363+ *
352364 * @param array $parameters
353365 *
354- * @return \Omnipay\Alipay\Requests\ AopCompletePurchaseRequest
366+ * @return AopCompletePurchaseRequest|AbstractRequest
355367 * @throws InvalidRequestException
356368 */
357369 public function completePurchase (array $ parameters = [])
@@ -360,12 +372,26 @@ public function completePurchase(array $parameters = [])
360372 }
361373
362374
375+ /**
376+ * @noinspection PhpDocRedundantThrowsInspection
377+ *
378+ * @param array $parameters
379+ *
380+ * @return AopCompleteRefundRequest|AbstractRequest
381+ * @throws InvalidRequestException
382+ */
383+ public function completeRefund (array $ parameters = [])
384+ {
385+ return $ this ->createRequest (AopCompleteRefundRequest::class, $ parameters );
386+ }
387+
388+
363389 /**
364390 * Query Order Status
365391 *
366392 * @param array $parameters
367393 *
368- * @return \Omnipay\Alipay\Requests\ AopTradeQueryRequest
394+ * @return AopTradeQueryRequest|AbstractRequest
369395 */
370396 public function query (array $ parameters = [])
371397 {
@@ -378,7 +404,7 @@ public function query(array $parameters = [])
378404 *
379405 * @param array $parameters
380406 *
381- * @return \Omnipay\Alipay\Requests\ AopTradeRefundRequest
407+ * @return AopTradeRefundRequest|AbstractRequest
382408 */
383409 public function refund (array $ parameters = [])
384410 {
@@ -391,7 +417,7 @@ public function refund(array $parameters = [])
391417 *
392418 * @param array $parameters
393419 *
394- * @return \Omnipay\Alipay\Requests\ AopTradeRefundQueryRequest
420+ * @return AopTradeRefundQueryRequest|AbstractRequest
395421 */
396422 public function refundQuery (array $ parameters = [])
397423 {
@@ -404,7 +430,7 @@ public function refundQuery(array $parameters = [])
404430 *
405431 * @param array $parameters
406432 *
407- * @return \Omnipay\Alipay\Requests\ AopTradeCloseRequest
433+ * @return AopTradeCloseRequest|AbstractRequest
408434 */
409435 public function close (array $ parameters = [])
410436 {
@@ -417,7 +443,7 @@ public function close(array $parameters = [])
417443 *
418444 * @param array $parameters
419445 *
420- * @return \Omnipay\Alipay\Requests\ AopTradeCancelRequest
446+ * @return AopTradeCancelRequest|AbstractRequest
421447 */
422448 public function cancel (array $ parameters = [])
423449 {
@@ -430,7 +456,7 @@ public function cancel(array $parameters = [])
430456 *
431457 * @param array $parameters
432458 *
433- * @return \Omnipay\Alipay\Requests\ AopTransferToAccountRequest
459+ * @return AopTransferToAccountRequest|AbstractRequest
434460 */
435461 public function transfer (array $ parameters = [])
436462 {
@@ -443,7 +469,7 @@ public function transfer(array $parameters = [])
443469 *
444470 * @param array $parameters
445471 *
446- * @return \Omnipay\Alipay\Requests\ AopTransferToAccountQueryRequest
472+ * @return AopTransferToAccountQueryRequest|AbstractRequest
447473 */
448474 public function transferQuery (array $ parameters = [])
449475 {
@@ -456,7 +482,7 @@ public function transferQuery(array $parameters = [])
456482 *
457483 * @param array $parameters
458484 *
459- * @return \Omnipay\Alipay\Requests\ AopTradeCancelRequest
485+ * @return AopTradeCancelRequest|AbstractRequest
460486 */
461487 public function settle (array $ parameters = [])
462488 {
@@ -467,7 +493,7 @@ public function settle(array $parameters = [])
467493 /**
468494 * @param array $parameters
469495 *
470- * @return \Omnipay\Common\Message\ AbstractRequest
496+ * @return AbstractRequest
471497 */
472498 public function queryBillDownloadUrl (array $ parameters = [])
473499 {
0 commit comments