diff --git a/src/Message/AuthorizeRequest.php b/src/Message/AuthorizeRequest.php index 08d9d118..03bf404e 100644 --- a/src/Message/AuthorizeRequest.php +++ b/src/Message/AuthorizeRequest.php @@ -249,13 +249,13 @@ public function getData() $stripeVersion = $this->getStripeVersion(); if (is_null($stripeVersion) || (!is_null($stripeVersion) && $stripeVersion >= self::API_VERSION_STATEMENT_DESCRIPTOR)) { - $data['statement_descriptor'] = $this->getStatementDescriptor(); + $data['statement_descriptor_suffix'] = $this->getStatementDescriptor(); } else { $data['statement_description'] = $this->getStatementDescriptor(); } if ($this->getDestination()) { - $data['destination'] = $this->getDestination(); + $data['transfer_data'] = ['destination' => $this->getDestination()]; } if ($this->getOnBehalfOf()) { @@ -263,7 +263,7 @@ public function getData() } if ($this->getApplicationFee()) { - $data['application_fee'] = $this->getApplicationFeeInteger(); + $data['application_fee_amount'] = $this->getApplicationFeeInteger(); } if ($this->getTransferGroup()) { diff --git a/tests/Message/AuthorizeRequestTest.php b/tests/Message/AuthorizeRequestTest.php index 2e6a5afd..f8474fab 100644 --- a/tests/Message/AuthorizeRequestTest.php +++ b/tests/Message/AuthorizeRequestTest.php @@ -35,7 +35,7 @@ public function testGetData() $this->assertSame('Order #42', $data['description']); $this->assertSame('false', $data['capture']); $this->assertSame(array('foo' => 'bar'), $data['metadata']); - $this->assertSame(100, $data['application_fee']); + $this->assertSame(100, $data['application_fee_amount']); } /** @@ -72,7 +72,7 @@ public function testDataWithStatementDescriptor() $this->request->setStatementDescriptor('OMNIPAY'); $data = $this->request->getData(); - $this->assertSame('OMNIPAY', $data['statement_descriptor']); + $this->assertSame('OMNIPAY', $data['statement_descriptor_suffix']); } public function testDataWithSourceAndDestination() @@ -82,7 +82,7 @@ public function testDataWithSourceAndDestination() $data = $this->request->getData(); $this->assertSame('abc', $data['source']); - $this->assertSame('xyz', $data['destination']); + $this->assertSame('xyz', $data['transfer_data']['destination']); } public function testDataWithToken() diff --git a/tests/Message/PurchaseRequestTest.php b/tests/Message/PurchaseRequestTest.php index 0490ee6c..6624148a 100644 --- a/tests/Message/PurchaseRequestTest.php +++ b/tests/Message/PurchaseRequestTest.php @@ -45,7 +45,7 @@ public function testShouldReturnDataAsAnArray() 'object' => 'card', 'email' => null ), - 'statement_descriptor' => 'FOO', + 'statement_descriptor_suffix' => 'FOO', 'description' => null, 'capture' => 'true', 'metadata' => null @@ -100,7 +100,7 @@ public function testShouldReturnLevel3DataIfItemsPresent() 'object' => 'card', 'email' => null ), - 'statement_descriptor' => 'BOBS ANTIQUES', + 'statement_descriptor_suffix' => 'BOBS ANTIQUES', 'description' => null, 'capture' => 'true', 'metadata' => null, @@ -178,7 +178,7 @@ public function testShouldNotReturnLevel3DataIfItemsAmountsDoNotAddUpToAmountCha 'object' => 'card', 'email' => null ), - 'statement_descriptor' => 'BOBS ANTIQUES', + 'statement_descriptor_suffix' => 'BOBS ANTIQUES', 'description' => null, 'capture' => 'true', 'metadata' => null @@ -195,7 +195,7 @@ public function testShouldUseOlderKeyOfStatementDescriptorWhenStripeVersionIsBef $data = $this->request->getData(); - $this->assertFalse(isset($data['statement_descriptor']), 'statement_descriptor should not be used for older version of the API'); + $this->assertFalse(isset($data['statement_descriptor_suffix']), 'statement_descriptor_suffix should not be used for older version of the API'); $this->assertNotNull($data['statement_description'], 'statement_description should be used for this api version'); $this->assertEquals('FOO', $data['statement_description']); }