-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update stripe-php to version 1.11.0, tweaked to keep PHP 5.1 support.
- Loading branch information
1 parent
6c4850f
commit d409938
Showing
20 changed files
with
510 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
class Stripe_ApplicationFee extends Stripe_ApiResource | ||
{ | ||
public static function className($class) | ||
{ | ||
return 'application_fee'; | ||
} | ||
|
||
public static function constructFrom($values, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::scopedConstructFrom($class, $values, $apiKey); | ||
} | ||
|
||
public static function retrieve($id, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::_scopedRetrieve($class, $id, $apiKey); | ||
} | ||
|
||
public static function all($params=null, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::_scopedAll($class, $params, $apiKey); | ||
} | ||
|
||
public function refund($params=null) | ||
{ | ||
$requestor = new Stripe_ApiRequestor($this->_apiKey); | ||
$url = $this->instanceUrl() . '/refund'; | ||
list($response, $apiKey) = $requestor->request('post', $url, $params); | ||
$this->refreshFrom($response, $apiKey); | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
class Stripe_AttachedObject extends Stripe_Object | ||
{ | ||
public function replaceWith($properties) | ||
{ | ||
$removed = array_diff(array_keys($this->_values), array_keys($properties)); | ||
// Don't unset, but rather set to null so we send up '' for deletion. | ||
foreach ($removed as $k) { | ||
$this->$k = null; | ||
} | ||
|
||
foreach ($properties as $k => $v) { | ||
$this->$k = $v; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
class Stripe_Balance extends Stripe_SingletonApiResource | ||
{ | ||
public static function constructFrom($values, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::scopedConstructFrom($class, $values, $apiKey); | ||
} | ||
|
||
public static function retrieve($apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::_scopedSingletonRetrieve($class, $apiKey); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
class Stripe_BalanceTransaction extends Stripe_ApiResource | ||
{ | ||
public static function classUrl($class) { | ||
return "/v1/balance/history"; | ||
} | ||
|
||
public static function constructFrom($values, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::scopedConstructFrom($class, $values, $apiKey); | ||
} | ||
|
||
public static function retrieve($id, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::_scopedRetrieve($class, $id, $apiKey); | ||
} | ||
|
||
public static function all($params=null, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::_scopedAll($class, $params, $apiKey); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
class Stripe_Card extends Stripe_ApiResource | ||
{ | ||
public static function constructFrom($values, $apiKey=null) | ||
{ | ||
$class = get_class(); | ||
return self::scopedConstructFrom($class, $values, $apiKey); | ||
} | ||
|
||
public function instanceUrl() | ||
{ | ||
$id = $this['id']; | ||
$customer = $this['customer']; | ||
$class = get_class($this); | ||
if (!$id) { | ||
throw new Stripe_InvalidRequestError("Could not determine which URL to request: $class instance has invalid ID: $id", null); | ||
} | ||
$id = Stripe_ApiRequestor::utf8($id); | ||
$customer = Stripe_ApiRequestor::utf8($customer); | ||
|
||
$base = self::classUrl('Stripe_Customer'); | ||
$customerExtn = urlencode($customer); | ||
$extn = urlencode($id); | ||
return "$base/$customerExtn/cards/$extn"; | ||
} | ||
|
||
public function delete($params=null) | ||
{ | ||
$class = get_class(); | ||
return self::_scopedDelete($class, $params); | ||
} | ||
|
||
public function save() | ||
{ | ||
$class = get_class(); | ||
return self::_scopedSave($class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
d409938
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do i install?
d409938
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/franksmule/prestashop-stripejs/releases/latest