diff --git a/src/Gateway.php b/src/Gateway.php index 828b4df..10cd75d 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -7,7 +7,7 @@ use Omnipay\MyCash\Message\CompletePurchaseRequest; use Omnipay\MyCash\Message\FetchTransactionRequest; use Omnipay\MyCash\Message\PurchaseRequest; -use Omnipay\MyCash\Message\ReceiveTransactionInfoRequest; +use Omnipay\MyCash\Message\GetPaymentInfoRequest; use Omnipay\MyCash\Traits\HasMyCash; /** @@ -39,7 +39,7 @@ public function purchase(array $options = []) public function completePurchase(array $options = []) { if ($this->httpRequest->request->get('RtnCode') === '5') { - return $this->receiveTransactionInfo($options); + return $this->getPaymentInfo($options); } return $this->createRequest(CompletePurchaseRequest::class, $options); @@ -48,15 +48,15 @@ public function completePurchase(array $options = []) public function acceptNotification(array $options = []) { if ($this->httpRequest->request->get('RtnCode') === '5') { - return $this->receiveTransactionInfo($options); + return $this->getPaymentInfo($options); } return $this->createRequest(AcceptNotificationRequest::class, $options); } - public function receiveTransactionInfo(array $options = []) + public function getPaymentInfo(array $options = []) { - return $this->createRequest(ReceiveTransactionInfoRequest::class, $options); + return $this->createRequest(GetPaymentInfoRequest::class, $options); } public function fetchTransaction(array $options = []) diff --git a/src/Message/ReceiveTransactionInfoRequest.php b/src/Message/GetPaymentInfoRequest.php similarity index 77% rename from src/Message/ReceiveTransactionInfoRequest.php rename to src/Message/GetPaymentInfoRequest.php index b90ed7f..aa73b11 100644 --- a/src/Message/ReceiveTransactionInfoRequest.php +++ b/src/Message/GetPaymentInfoRequest.php @@ -6,7 +6,7 @@ use Omnipay\Common\Message\AbstractRequest; use Omnipay\MyCash\Traits\HasMyCash; -class ReceiveTransactionInfoRequest extends AbstractRequest +class GetPaymentInfoRequest extends AbstractRequest { use HasMyCash; @@ -28,10 +28,10 @@ public function getData() /** * @param array $data - * @return ReceiveTransactionInfoResponse + * @return GetPaymentInfoResponse */ public function sendData($data) { - return $this->response = new ReceiveTransactionInfoResponse($this, $data); + return $this->response = new GetPaymentInfoResponse($this, $data); } } diff --git a/src/Message/ReceiveTransactionInfoResponse.php b/src/Message/GetPaymentInfoResponse.php similarity index 70% rename from src/Message/ReceiveTransactionInfoResponse.php rename to src/Message/GetPaymentInfoResponse.php index d91c9ac..e95fee6 100644 --- a/src/Message/ReceiveTransactionInfoResponse.php +++ b/src/Message/GetPaymentInfoResponse.php @@ -2,7 +2,7 @@ namespace Omnipay\MyCash\Message; -class ReceiveTransactionInfoResponse extends CompletePurchaseResponse +class GetPaymentInfoResponse extends CompletePurchaseResponse { /** * @return bool diff --git a/tests/Message/ReceiveTransactionInfoRequestTest.php b/tests/Message/GetPaymentInfoRequestTest.php similarity index 89% rename from tests/Message/ReceiveTransactionInfoRequestTest.php rename to tests/Message/GetPaymentInfoRequestTest.php index 3cf68a2..7542492 100644 --- a/tests/Message/ReceiveTransactionInfoRequestTest.php +++ b/tests/Message/GetPaymentInfoRequestTest.php @@ -2,10 +2,10 @@ namespace Omnipay\MyCash\Tests\Message; -use Omnipay\MyCash\Message\ReceiveTransactionInfoRequest; +use Omnipay\MyCash\Message\GetPaymentInfoRequest; use Omnipay\Tests\TestCase; -class ReceiveTransactionInfoRequestTest extends TestCase +class GetPaymentInfoRequestTest extends TestCase { private $initialize = [ 'HashKey' => 'FEFRGFEFWEF', // 廠商 HashKey(由易沛提供) @@ -30,7 +30,7 @@ public function testATMReceiveTransactionInfoRequest(): void ]; $this->getHttpRequest()->request->add($options); - $request = new ReceiveTransactionInfoRequest($this->getHttpClient(), $this->getHttpRequest()); + $request = new GetPaymentInfoRequest($this->getHttpClient(), $this->getHttpRequest()); $request->initialize($this->initialize); $response = $request->send(); @@ -66,7 +66,7 @@ public function testCVSReceiveTransactionInfoRequest(): void ]; $this->getHttpRequest()->request->add($options); - $request = new ReceiveTransactionInfoRequest($this->getHttpClient(), $this->getHttpRequest()); + $request = new GetPaymentInfoRequest($this->getHttpClient(), $this->getHttpRequest()); $request->initialize($this->initialize); $response = $request->send();