Skip to content

Commit

Permalink
Merge pull request #12 from mwarzybok-sumoheavy/feature/SP-607
Browse files Browse the repository at this point in the history
Fix git issue related with SDK directory
  • Loading branch information
bobbrodie authored Jul 31, 2023
2 parents 37e0866 + 1be176c commit f0058ce
Show file tree
Hide file tree
Showing 494 changed files with 188,466 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BitPayEddLib/class-bitpaycheckouttransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function create_transaction(
$this->get_wpdb()->query( $query );
}

public function get_order_id_by_invoice_id(mixed $invoice_id): ?int {
public function get_order_id_by_invoice_id( string $invoice_id ): ?int {
$table_name = $this->table_name;
$wp_db = $this->get_wpdb();
$sql = $wp_db->prepare(
Expand Down
2 changes: 1 addition & 1 deletion BitPayEddLib/class-bitpayeddabandonorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct( BitPayCheckoutTransactions $bitpay_checkout_transac
public function execute( WP_REST_Request $request ): void {
$data = $request->get_params();
$invoice_id = $data['invoiceid'];
$order_id = $this->bitpay_checkout_transactions->get_order_id_by_invoice_id($invoice_id);
$order_id = $this->bitpay_checkout_transactions->get_order_id_by_invoice_id( (string) $invoice_id);
if ( ! $order_id ) {
die();
}
Expand Down
1 change: 0 additions & 1 deletion vendor/bitpay/sdk
Submodule sdk deleted from 77d760
13 changes: 13 additions & 0 deletions vendor/bitpay/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# IDE
.idea

# Compose
/vendor/
composer.phar

# phpDocumentor
.phpdoc

# PHPUnit
.phpunit.result.cache
test/unit/_html
5 changes: 5 additions & 0 deletions vendor/bitpay/sdk/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: php
php:
- 7.1
- 7.2
- 7.3
21 changes: 21 additions & 0 deletions vendor/bitpay/sdk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 BitPay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
92 changes: 92 additions & 0 deletions vendor/bitpay/sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<img src="https://bitpay.com/_nuxt/img/bitpay-logo-blue.1c0494b.svg" width="150">

# BitPay PHP Client
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/bitpay/php-bitpay-client-v2/master/LICENSE)
[![Packagist](https://img.shields.io/packagist/v/bitpay/sdk.svg?style=flat-square)](https://packagist.org/packages/bitpay/sdk)
[![Total Downloads](https://poser.pugx.org/bitpay/sdk/downloads.svg)](https://packagist.org/packages/bitpay/sdk)
[![Latest Unstable Version](https://poser.pugx.org/bitpay/sdk/v/unstable.svg)](https://packagist.org/packages/bitpay/sdk)

Full implementation of the BitPay Payment Gateway. This library implements BitPay's [Cryptographically Secure RESTful API](https://bitpay.com/api).

Our Lite version will most likely be all you need to integrate to your site, available [here](https://github.com/bitpay/php-bitpay-light-client)

## Getting Started

To get up and running with our PHP library quickly, follow [the guide](https://bitpay.readme.io/reference/php-full-sdk-getting-started)

## Support

* https://github.com/bitpay/php-bitpay-client-v2/issues
* https://support.bitpay.com

### Requirements

- PHP version: 8.0 / 8.1 / 8.2
- PHP extensions: json, reflection

## Unit Tests
```php
./vendor/bin/phpunit --testsuite "Unit"
```

## Functional Tests

To run functional tests you will need to perform the following steps.

### Generate Configuration


Run the following command to generate `BitPay.config.yml`:

```bash
composer setup
```

Copy `BitPay.config.yml` to the `test/functional/BitPaySDK` directory.

Copy `PrivateKeyName.key` to the `setup` directory.

### Create Recipient

To submit requests you should:

1. Create a recipient in https://test.bitpay.com/dashboard/payouts/recipients
2. Accept the invite in the recipient's email inbox
3. Create a file at `test/functional/BitPaySDK/email.txt` containing the email
address of the recipient you created in step 1.

### Run the Functional Tests

Run the following command to execute the functional tests:

```php
./vendor/bin/phpunit --testsuite "Functional"
```

## Contribute

To contribute to this project, please fork and submit a pull request.

## License

MIT License

Copyright (c) 2019 BitPay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 48 additions & 0 deletions vendor/bitpay/sdk/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "bitpay/sdk",
"description": "Complete version of the PHP library for the new cryptographically secure BitPay API",
"license": "MIT",
"minimum-stability": "stable",
"keywords": [
"bitpay",
"bitcoin",
"cash",
"payment",
"gateway"
],
"homepage": "https://github.com/bitpay/php-bitpay-client-v2",
"require": {
"php": "^8.0 || ^8.1 || ^8.2",
"ext-json": "*",
"ext-reflection": "*",
"bitpay/key-utils": "^1.1",
"guzzlehttp/guzzle": "^7.0",
"symfony/yaml": "^5.4 || ^6.0 || ^6.1 || ^6.2",
"netresearch/jsonmapper": "^4.1"
},
"authors": [
{
"name": "Antonio Buedo",
"email": "solutions-engineering@bitpay.com"
}
],
"require-dev": {
"phpunit/phpunit": "^7.5 || ^9.0"
},
"scripts": {
"setup": [
"php setup/ConfigGenerator.php"
]
},
"autoload": {
"psr-4": {
"BitPaySDK\\": "src/BitPaySDK"
}
},
"autoload-dev": {
"psr-4": {
"BitPaySDK\\Test\\": "test/unit/BitPaySDK",
"BitPaySDK\\Functional\\": "test/functional/BitPaySDK"
}
}
}
Loading

0 comments on commit f0058ce

Please sign in to comment.