Skip to content

Commit 2ffe569

Browse files
committed
v2.0.0
* Automated Payouts * Support to BlockBee Checkout page * Various improvements
1 parent 205780a commit 2ffe569

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: BlockBee/Checkout.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct($api_key, $parameters = [], $bb_params = [])
2929
* Handles request to payments.
3030
* @return array
3131
*/
32-
public function payment_request($redirect_url, $value)
32+
public function payment_request($redirect_url, $notify_url, $value)
3333
{
3434
if (empty($redirect_url) || empty($value)) {
3535
return null;
@@ -38,10 +38,12 @@ public function payment_request($redirect_url, $value)
3838
if (!empty($this->parameters)) {
3939
$req_parameters = http_build_query($this->parameters);
4040
$redirect_url = "{$redirect_url}?{$req_parameters}";
41+
$notify_url = "{$notify_url}?{$req_parameters}";
4142
}
4243

4344
$bb_params = array_merge([
4445
'redirect_url' => $redirect_url,
46+
'notify_url' => $notify_url,
4547
'apikey' => $this->api_key,
4648
'value' => $value
4749
], $this->bb_params);

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,14 @@ require 'vendor/autoload.php'; // Where your vendor directory is
273273

274274
$bb = new BlockBee\Checkout($api_key, $parameters, $blockbee_params);
275275

276-
$payment_address = $bb->payment_request($redirect_url, $value);
276+
$payment_address = $bb->payment_request($redirect_url, $notify_url, $value);
277277
```
278278
#### Where:
279279
* ``$api_key`` is the API Key provided by our [Dashboard](https://dash.blockbee.io/).
280280
* ``$parameters`` is any parameter you wish to send to identify the payment, such as `['order_id' => 1234]`
281281
* ``$blockbee_params`` parameters that will be passed to BlockBee _(check which extra parameters are available here: https://docs.blockbee.io/#operation/payment)
282282
* ``$redirect_url`` URL in your platform, where the user will be redirected to following the payment. Should be able to process the payment using the `success_token`.
283+
* ``$notify_url`` URL in your platform, where the IPN will be sent notifying that a deposit was done. Parameters are available here: https://docs.blockbee.io/#operation/depositipn.
283284
* ``$value`` amount in currency set in Payment Settings you want to receive from the user.
284285

285286
### Getting notified when the user completes the Payment

Diff for: test.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
$bb_checkout = new BlockBee\Checkout($api_key, $parameters, $blockbee_params);
5959

60-
# var_dump($bb_checkout->payment_request('https://example.com/', 5)) . PHP_EOL;
60+
# var_dump($bb_checkout->payment_request('https://example.com/', 'https://example.com/', 5)) . PHP_EOL;
6161

6262
# var_dump($bb_checkout->deposit_request('https://example.com/')) . PHP_EOL;
6363

0 commit comments

Comments
 (0)