File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public function testGetData()
35
35
{
36
36
$ data = $ this ->request ->getData ();
37
37
38
+ $ this ->assertArrayNotHasKey ('paymentMethodToken ' , $ data );
38
39
$ this ->assertSame ('abc123 ' , $ data ['paymentMethodNonce ' ]);
39
40
$ this ->assertSame ('10.00 ' , $ data ['amount ' ]);
40
41
$ this ->assertSame ('684 ' , $ data ['orderId ' ]);
@@ -50,6 +51,28 @@ public function testGetData()
50
51
$ this ->assertSame ('production ' , \Braintree_Configuration::environment ());
51
52
}
52
53
54
+ public function testPaymentToken ()
55
+ {
56
+ $ this ->request ->initialize (
57
+ array (
58
+ 'amount ' => '10.00 ' ,
59
+ 'token ' => 'abc123 ' ,
60
+ 'transactionId ' => '684 ' ,
61
+ 'testMode ' => false ,
62
+ 'taxExempt ' => false ,
63
+ 'card ' => [
64
+ 'firstName ' => 'Kayla ' ,
65
+ 'shippingCompany ' => 'League ' ,
66
+ ],
67
+ 'usePaymentMethodToken ' => true
68
+ )
69
+ );
70
+
71
+ $ data = $ this ->request ->getData ();
72
+ $ this ->assertSame ('abc123 ' , $ data ['paymentMethodToken ' ]);
73
+ $ this ->assertArrayNotHasKey ('paymentMethodNonce ' , $ data );
74
+ }
75
+
53
76
public function testSandboxEnvironment ()
54
77
{
55
78
$ this ->request ->setTestMode (true );
You can’t perform that action at this time.
0 commit comments