diff --git a/src/Message/RefundRequest.php b/src/Message/RefundRequest.php index 15158a3c..74d19ef2 100644 --- a/src/Message/RefundRequest.php +++ b/src/Message/RefundRequest.php @@ -85,7 +85,7 @@ public function getData() $data['amount'] = $this->getAmountInteger(); if ($this->getRefundApplicationFee()) { - $data['refund_application_fee'] = true; + $data['refund_application_fee'] = "true"; } return $data; diff --git a/src/Message/VoidRequest.php b/src/Message/VoidRequest.php index c0af154f..e697ecdb 100644 --- a/src/Message/VoidRequest.php +++ b/src/Message/VoidRequest.php @@ -34,17 +34,16 @@ * @see Omnipay\Stripe\Gateway * @link https://stripe.com/docs/api#create_refund */ -class VoidRequest extends AbstractRequest +class VoidRequest extends RefundRequest { public function getData() { $this->validate('transactionReference'); - return null; - } + if ($this->getRefundApplicationFee()) { + $data['refund_application_fee'] = "true"; + } - public function getEndpoint() - { - return $this->endpoint.'/charges/'.$this->getTransactionReference().'/refund'; + return null; } } diff --git a/tests/Message/RefundRequestTest.php b/tests/Message/RefundRequestTest.php index 71a06676..d6762ae4 100644 --- a/tests/Message/RefundRequestTest.php +++ b/tests/Message/RefundRequestTest.php @@ -27,7 +27,7 @@ public function testAmount() public function testRefundApplicationFee() { $data = $this->request->getData(); - $this->assertTrue($data['refund_application_fee']); + $this->assertEquals("true", $data['refund_application_fee']); } public function testSendSuccess()