Skip to content

Commit a49bc29

Browse files
Prepare for app in app gateway test.
1 parent bf47e77 commit a49bc29

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace Omnipay\MoMo\Tests\AppInApp;
4+
5+
use Omnipay\Omnipay;
6+
use Omnipay\Tests\GatewayTestCase;
7+
8+
/**
9+
* Class AppInAppGatewayTest
10+
*
11+
* @package Omnipay\MoMo\Tests\AppInApp
12+
*/
13+
class AppInAppGatewayTest extends GatewayTestCase
14+
{
15+
protected function setUp()
16+
{
17+
$this->gateway = Omnipay::create('MoMo_AppInApp', $this->getHttpClient(), $this->getHttpRequest());
18+
$this->gateway->setPublicKey('-----BEGIN PUBLIC KEY-----
19+
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAiBIo9EMTElPppPejirL1cdgCuZUoBzGZ
20+
F3SyrTp+xdMnIXSOiFYG+zHmI1lFzoEbEd1JwXAUV52gn/oAkUo+2qwuqZAPdkm714tiyjvxXE/0
21+
WYLl8X1K8uCSK47u26CnOLgNB6iW1m9jog00i9XV/AmKI1U8OioLFSp1BwMf3O+jA9uuRfj1Lv5Q
22+
0Q7RMtk4tgV924+D8mY/y3otBp5b+zX0NrWkRqwgPly6NeXN5LwqRj0LwAEVVwGbpl6V2cztYv94
23+
ZHjGzNziFJli2D0Vpb/HRPP6ibXvllgbL4UXU4Izqhxml8gwd74jXaNaEgNJGhjjeUXR1sAm7Mpj
24+
qqgyxpx6B2+GpjWtEwvbJuO8DsmQNsm+bJZhw46uf9AuY5VSYy2cAF1XMXSAPNLqYEE8oVUki4IW
25+
YOEWSNXcQwikJC25rAErbyst/0i8RN4yqgiO/xVA1J1vdmRQTvGMXPGbDFpVca4MkHHLrkdC3Z3C
26+
zgMkbIqnpaDYoIHZywraHWA7Zh5fDt/t7FzX69nbGg8i4QFLzIm/2RDPePJTY2R24w1iVO5RhEbK
27+
EaTBMuibp4UJH+nEQ1p6CNdHvGvWz8S0izfiZmYIddaPatQTxYRq4rSsE/+2L+9RE9HMqAhQVveh
28+
RGWWiGSY1U4lWVeTGq2suCNcMZdgDMbbIaSEJJRQTksCAwEAAQ==
29+
-----END PUBLIC KEY-----');
30+
$this->gateway->setPartnerCode('MOMO0HGO20180417');
31+
$this->gateway->setSecretKey('fj00YKnJhmYqahaFWUgkg75saNTzMrbO');
32+
$this->gateway->setTestMode(true);
33+
34+
parent::setUp();
35+
}
36+
37+
public function testPurchase()
38+
{
39+
$this->setMockHttpResponse('PurchaseSuccess.txt');
40+
$this->gateway->purchase([
41+
'customerNumber' => '0909113911',
42+
'appData' => 'holo',
43+
'partnerRefId' => 99,
44+
'amount' => 50000,
45+
])->send();
46+
}
47+
48+
/**
49+
* @doesNotPerformAssertions
50+
*/
51+
public function testDefaultParametersHaveMatchingMethods()
52+
{
53+
parent::testDefaultParametersHaveMatchingMethods();
54+
}
55+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
HTTP/1.1 200 OK
2+
Server: nginx
3+
Date: Tue, 25 Jun 2019 08:56:42 GMT
4+
Content-Type: application/json; charset=utf-8
5+
Transfer-Encoding: chunked
6+
Connection: keep-alive
7+
Vary: Accept-Encoding
8+
X-Kong-Upstream-Latency: 310
9+
X-Kong-Proxy-Latency: 1
10+
Via: kong/0.14.1
11+
Strict-Transport-Security: max-age=15768000
12+
13+
{"status":0,"message":"Thành công","amount":40000,"transid":"43121679","signature":"307b0ee753798e3aff6eb69b2d7966bf0fab29f88336ce0763532fcfafadbe28"}

0 commit comments

Comments
 (0)