diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..47f24e1 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,30 @@ +# This is a basic workflow that is manually triggered + +name: Manual workflow + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Person to greet' + # Default value if no value is explicitly provided + default: 'World' + # Input has to be provided for the workflow to run + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send greeting + run: echo "Hello ${{ github.event.inputs.name }}" diff --git a/README.md b/README.md index e7150f1..eca90aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![CircleCI](https://circleci.com/gh/coinbase/coinbase-commerce-php/tree/master.svg?style=svg)](https://circleci.com/gh/coinbase/coinbase-commerce-php/tree/master) # Coinbase Commerce +**Note: This repository is not actively maintained.** The official PHP library for the [Coinbase Commerce API](https://commerce.coinbase.com/docs/). @@ -37,6 +38,11 @@ $apiClientObj = ApiClient::init(); $apiClientObj->setTimeout(3); ``` +### Disable SSL Check +``` php +$apiClientObj->verifySsl(false); +``` + The API resource class provides the following static methods: ``list, all, create, retrieve, updateById, deleteById``. Additionally, the API resource class also provides the following instance methods: ``save, delete, insert, update``. Each API method returns an ``ApiResource`` which represents the JSON response from the API. @@ -254,7 +260,7 @@ Note: Only new charges can be successfully canceled. Once payment is detected, c $chargeObj = Charge::retrieve(); if ($chargeObj) { - $chargeObj->confirm(); + $chargeObj->cancel(); } ``` diff --git a/src/ApiClient.php b/src/ApiClient.php index 6eab0a3..0396c05 100644 --- a/src/ApiClient.php +++ b/src/ApiClient.php @@ -41,6 +41,11 @@ class ApiClient */ private $httpClient; + /** + * @var boolean + */ + private $verifySSL = true ; + /** * ApiClient constructor. */ @@ -254,7 +259,7 @@ private function makeRequest($method, $path, $options) public function getHttpClient() { if (!isset($this->httpClient)) { - $this->httpClient = new Client(); + $this->httpClient = new Client(['verify' => $this->verifySSL]); } return $this->httpClient; @@ -354,4 +359,12 @@ public static function getClassName() { return get_called_class(); } + + public function verifySsl($verify) + { + if(!is_bool($verify)) { + return; + } + $this->verifySSL = $verify ; + } }