Skip to content

Commit

Permalink
1.12.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Oct 10, 2017
1 parent 8b1b646 commit 2681b8f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 39 deletions.
22 changes: 6 additions & 16 deletions Facade/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ final class Charge extends \Df\StripeClone\Facade\Charge {
*/
function capturePreauthorized($id, $a) {return C::retrieve($id)->capture(['amount' => $a]);}

/**
* 2017-02-11
* @override
* @see \Df\StripeClone\Facade\Charge::cardIdPrefix()
* @used-by \Df\StripeClone\Payer::usePreviousCard()
* @return string
*/
function cardIdPrefix() {return 'card';}

/**
* 2017-02-10
* @override
Expand Down Expand Up @@ -56,6 +47,7 @@ function id($c) {return $c->id;}
* @override
* @see \Df\StripeClone\Facade\Charge::pathToCard()
* @used-by \Df\StripeClone\Block\Info::prepare()
* @used-by \Df\StripeClone\Facade\Charge::cardData()
* @return string
*/
function pathToCard() {return 'source';}
Expand Down Expand Up @@ -97,15 +89,13 @@ function refund($id, $a) {return R::create(df_clean([
function void($id) {return $this->refund($id, null);}

/**
* 2017-02-11 The bank card data.
* 2017-02-11
* @override
* @see \Df\StripeClone\Facade\Charge::cardData()
* @used-by \Df\StripeClone\Facade\Charge::card()
* @param C $c
* @return \Stripe\Card
* @see \Dfe\Stripe\Facade\Customer::cardsData()
* @see \Df\StripeClone\Facade\Charge::cardIdPrefix()
* @used-by \Df\StripeClone\Payer::usePreviousCard()
* @return string
*/
protected function cardData($c) {return $c->{'source'};}
protected function cardIdPrefix() {return 'card_';}

/**
* 2016-03-18
Expand Down
28 changes: 14 additions & 14 deletions Facade/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
use Stripe\Customer as C;
// 2017-02-10
final class Customer extends \Df\StripeClone\Facade\Customer {
/**
* 2017-02-10
* «When requesting the ID of a customer that has been deleted,
* a subset of the customer’s information will be returned,
* including a deleted property, which will be true.»
* https://stripe.com/docs/api/php#retrieve_customer
* @override
* @see \Df\StripeClone\Facade\Customer::get()
* @used-by \Df\StripeClone\Facade\Customer::get()
* @param int $id
* @return C|null
*/
function _get($id) {/** @var C $c */return dfo($c = C::retrieve($id), 'deleted') ? null : $c;}

/**
* 2017-02-10
* @override
Expand Down Expand Up @@ -48,6 +34,20 @@ function create(array $p) {return C::create($p);}
*/
function id($c) {return $c->id;}

/**
* 2017-02-10
* «When requesting the ID of a customer that has been deleted,
* a subset of the customer’s information will be returned,
* including a deleted property, which will be true.»
* https://stripe.com/docs/api/php#retrieve_customer
* @override
* @see \Df\StripeClone\Facade\Customer::_get()
* @used-by \Df\StripeClone\Facade\Customer::get()
* @param int $id
* @return C|null
*/
protected function _get($id) {/** @var C $c */return dfo($c = C::retrieve($id), 'deleted') ? null : $c;}

/**
* 2017-02-11
* @override
Expand Down
5 changes: 2 additions & 3 deletions P/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ final class Address extends \Df\Payment\Operation {
*/
static function p() {
$i = new self(dfpm(__CLASS__)); /** @var self $i */
/** @var A|null $a */ /** @var @var array(string => mixed) $shipping */
/** @var A|null $a */
return !($a = $i->addressS()) ? [] : [
// 2016-03-14 hipping address.
// https://stripe.com/docs/api/php#charge_object-shipping-address
// 2016-03-14 Shipping address https://stripe.com/docs/api/php#charge_object-shipping-address
'address' => [
// 2016-03-14 City/Suburb/Town/Village.
// https://stripe.com/docs/api/php#charge_object-shipping-address-city
Expand Down
2 changes: 1 addition & 1 deletion P/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
final class Charge extends \Df\StripeClone\P\Charge {
/**
* 2017-02-11
* 2017-02-18 Ключ, значением которого является токен банковской карты.
* 2017-10-09 The key name of a bank card token or of a saved bank card ID.
* @override
* @see \Df\StripeClone\P\Charge::k_CardId()
* @used-by \Df\StripeClone\P\Charge::request()
Expand Down
13 changes: 10 additions & 3 deletions Settings.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<?php
namespace Dfe\Stripe;
// 2016-03-08
/** @method static Settings s() */
final class Settings extends \Df\StripeClone\Settings {
/**
* 2016-03-08
* @override
* @see \Df\Payment\Settings::init()
* @used-by account()
* @used-by \Df\Payment\Method::action()
*/
function init() {\Stripe\Stripe::setApiKey($this->privateKey());}

/** @return bool */
/**
* 2016-03-08
* @used-by \Dfe\Stripe\ConfigProvider::config()
* @used-by \Dfe\Stripe\Method::minimumAmount()
* @return bool
*/
function isMerchantInUS() {return 'US' === $this->account()->{'country'};}

/**
* 2016-03-08
* https://stripe.com/docs/api/php#retrieve_account
* 2016-03-08 https://stripe.com/docs/api/php#retrieve_account
* @used-by isMerchantInUS()
* @return \Stripe\Account
*/
private function account() {return dfc($this, function() {
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/stripe"
,"version": "1.12.4"
,"version": "1.12.5"
,"description": "The «Stripe» payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/stripe"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.11.36", "stripe/stripe-php": "3.*"}
,"require": {"mage2pro/core": ">=3.1.0", "stripe/stripe-php": "3.*"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\Stripe\\": ""}}
,"keywords": [
"API"
Expand Down

0 comments on commit 2681b8f

Please sign in to comment.