File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Omnipay \Datatrans \Message ;
4+
5+ use Omnipay \Common \CreditCard ;
6+ use Omnipay \Tests \TestCase ;
7+
8+ class CreateCardTest extends TestCase
9+ {
10+ /**
11+ * @var PurchaseRequest
12+ */
13+ private $ request ;
14+
15+ public function setUp ()
16+ {
17+ parent ::setUp ();
18+
19+ $ this ->request = new CreateCardRequest ($ this ->getHttpClient (), $ this ->getHttpRequest ());
20+ }
21+
22+ public function testAmountAndAlias ()
23+ {
24+ $ this ->request ->initialize (array (
25+ 'merchantId ' => 'asdf ' ,
26+ 'sign ' => '123 ' ,
27+ 'testMode ' => true ,
28+ 'currency ' => 'CHF ' ,
29+ 'transactionId ' => '123 ' ,
30+ 'returnUrl ' => 'https://www.example.com/success ' ,
31+ 'errorUrl ' => 'https://www.example.com/error ' ,
32+ 'cancelUrl ' => 'https://www.example.com/cancel '
33+ ));
34+
35+ $ expected = [
36+ 'amount ' => 0 ,
37+ 'useAlias ' => 'yes ' ,
38+ ];
39+
40+ $ this ->assertArraySubset ($ expected , $ this ->request ->getData ());
41+
42+ $ this ->assertSame ('asdf0CHF123 ' , $ this ->request ->getHmacString ());
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments