| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testSimpleSend() |
||
| 16 | { |
||
| 17 | $client = $this->getHttpClient(); |
||
| 18 | $httpRequest = HttpRequestBuilder::createCompletePurchase(); |
||
| 19 | $request = new CompletePurchaseRequest($client, $httpRequest); |
||
| 20 | $request->initialize( |
||
| 21 | [ |
||
| 22 | 'publicKey' => getenv('PAYLIKE_PUBLIC_KEY'), |
||
| 23 | 'privateKey' => getenv('PAYLIKE_PRIVATE_KEY') |
||
| 24 | ] |
||
| 25 | ); |
||
| 26 | |||
| 27 | /** @var CompletePurchaseResponse $response */ |
||
| 28 | $response = $request->send(); |
||
| 29 | self::assertInstanceOf(CompletePurchaseResponse::class, $response); |
||
| 30 | self::assertTrue($response->isSuccessful()); |
||
| 31 | |||
| 32 | $data = $response->getData(); |
||
| 33 | self::assertIsArray($data); |
||
| 34 | self::assertTrue($data['success']); |
||
| 35 | self::assertArrayHasKey('transaction', $data); |
||
| 36 | } |
||
| 38 |