public function testCompletePurchase() { $soapResponse = PaymentStatusResponseTest::paymentStatusWithState(GopayHelper::CREATED); $this->soapClient->expects($this->once())->method('paymentStatus')->with($this->anything())->will($this->returnValue($soapResponse)); $this->getHttpRequest()->query->replace(array('targetGoId' => self::GO_ID, 'paymentSessionId' => '98765', 'orderNumber' => '111', 'encryptedSignature' => GopayHelper::getPaymentIdentitySignature(self::GO_ID, '98765', null, '111', self::SECURE_KEY))); $this->assertSame($soapResponse, $this->gateway->completePurchase(array())->send()->getData()); }
public function testSendSuccess() { $notificationParams = array('targetGoId' => 12345, 'paymentSessionId' => 1111, 'orderNumber' => 2222, 'encryptedSignature' => GopayHelper::getPaymentIdentitySignature(12345, 1111, null, 2222, GatewayTest::SECURE_KEY)); $paymentStatusParams = array('targetGoId' => 12345, 'paymentSessionId' => 1111, 'encryptedSignature' => GopayHelper::getPaymentSessionSignature(12345, 1111, GatewayTest::SECURE_KEY)); $paymentStatusResponse = PaymentStatusResponseTest::paymentStatusWithState(GopayHelper::CREATED); $this->getHttpRequest()->query->replace($notificationParams); $this->soapClient->expects($this->once())->method('paymentStatus')->with($paymentStatusParams)->will($this->returnValue($paymentStatusResponse)); $this->request = new CompletePurchaseRequest($this->soapClient, $this->getHttpClient(), $this->getHttpRequest()); $this->request->setGoId('12345'); $this->request->setSecureKey(GatewayTest::SECURE_KEY); $response = $this->request->send(); $this->assertSame($paymentStatusResponse, $response->getData()); }