Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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/).

Expand Down Expand Up @@ -37,6 +38,11 @@ $apiClientObj = ApiClient::init(<API_KEY>);
$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.
Expand Down Expand Up @@ -254,7 +260,7 @@ Note: Only new charges can be successfully canceled. Once payment is detected, c
$chargeObj = Charge::retrieve(<charge_id>);

if ($chargeObj) {
$chargeObj->confirm();
$chargeObj->cancel();
}
```

Expand Down
15 changes: 14 additions & 1 deletion src/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class ApiClient
*/
private $httpClient;

/**
* @var boolean
*/
private $verifySSL = true ;

/**
* ApiClient constructor.
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -354,4 +359,12 @@ public static function getClassName()
{
return get_called_class();
}

public function verifySsl($verify)
{
if(!is_bool($verify)) {
return;
}
$this->verifySSL = $verify ;
}
}