Skip to content

Commit 04be902

Browse files
committed
clean notify url in purchase
1 parent f448be0 commit 04be902

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

resources/views/payment.blade.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<form action="POST" action="/process/payment">
3333
<input type="hidden" name="transition_id" value="{{ $transactionId }}" />
3434
<input type="hidden" name="amount" value="{{ $amount }}" />
35-
<input type="hidden" name="notify_url" value="{{ $notifyUrl }}" />
3635
<input type="submit" name="status" value="{{ $label_success }}" />
3736
<input type="submit" name="status" value="{{ $label_denied }}" />
3837
</form>

src/App/Http/Controllers/PaymentController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ public function __invoke(Request $request)
1414
'transaction_id' => 'required',
1515
'description' => 'required',
1616
'amount' => 'required|numeric',
17-
'notify_url' => 'required|url',
1817
]);
1918

2019
return view('omonipay-offline-dummy::payment', [
2120
'transactionId' => $request->input('transaction_id'),
2221
'description' => $request->input('description'),
2322
'amount' => $request->input('amount'),
24-
'notifyUrl' => $request->input('notify_url'),
2523
'label_success' => App::STATUS_SUCCESS,
2624
'label_denied' => App::STATUS_DENIED,
2725
]);

src/Message/PurchaseRequest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ public function getData()
3838
'transactionId'
3939
);
4040

41-
$data = [];
42-
$data['notify_url'] = $this->getNotifyUrl();
43-
$data['transaction_id'] = $this->getTransactionId();
44-
$data['amount'] = $this->getAmount();
45-
$data['description'] = $this->getDescription();
46-
47-
return $data;
41+
return [
42+
'transaction_id' => $this->getTransactionId(),
43+
'amount' => $this->getAmount(),
44+
'description' => $this->getDescription(),
45+
];
4846
}
4947

5048
public function sendData($data)

tests/AppTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ public function testPurchase()
2626
'amount' => '12.00',
2727
'description' => 'Test purchase',
2828
'transactionId' => 1,
29-
'notifyUrl' => 'http://localhost:8080/gateway/notify',
3029
]
3130
)->send();
3231

3332
$responseHttp = $this->postJson($response->getRedirectUrl(), [
3433
'transaction_id' => $response->getData()['transaction_id'],
3534
'amount' => $response->getData()['amount'],
3635
'description' => $response->getData()['description'],
37-
'notify_url' => $response->getData()['notify_url'],
3836
])->assertStatus(200)
3937
->assertSee('<form action="POST" action="/process/payment">', false);
4038
}

0 commit comments

Comments
 (0)