Skip to content

RecurringApplicationCharge compatibility with latest Shopify API #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
62 changes: 62 additions & 0 deletions lib/RecurringApplicationCharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,68 @@ class RecurringApplicationCharge extends ShopifyResource
'activate',
);

/*
* Create a recurring application charge
*
* @param array $data
*
* @return array
*
*/
public function create($dataArray)
{
$dataArray = $this->wrapData($dataArray);

$url = $this->generateUrl($dataArray);

$response = $this->post(array(), $url);

return $response;
}

/**
* Get list of all charges
*
* @return array
*/
public function charges(){
$url = $this->generateUrl();

$response = $this->get(array(), $url);

return $response;
}

/**
* Get details of a single charge
*
* @param $charge_id
*
* @return array
*/
public function charge( $charge_id ){
$url = $this->generateUrl(array(), $charge_id);

$response = $this->get(array(), $url);

return $response;
}

/**
* Cancel a recurring charge
*
* @param $charge_id
*
* @return array
*/
public function cancel($charge_id){
$url = $this->generateUrl(array(), $charge_id);

$response = $this->delete(array(), $url);

return $response;
}

/*
* Customize a recurring application charge
*
Expand Down