From e8721a5c9e68122033a3d43356306a58e4825d33 Mon Sep 17 00:00:00 2001 From: Dmitry Fedyuk Date: Mon, 24 Apr 2017 14:34:38 +0300 Subject: [PATCH] 0.1.0 --- T/Basic.php | 23 +++++++++++++---------- composer.json | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/T/Basic.php b/T/Basic.php index e5d90d5..f60c192 100644 --- a/T/Basic.php +++ b/T/Basic.php @@ -1,7 +1,7 @@ api(); /** @var C $c */ $c = $api->customers(); + /** @var GA $ga */ + $ga = df_geo('AIzaSyBj8bPt0PeSxcgPW8vTfNI2xKdhkHCUYuc')->geocode( + 'Av. Lúcio Costa, 3150 - Barra da Tijuca, Rio de Janeiro - RJ, 22630-010' + )->first(); // 2017-04-22 // https://dev.moip.com.br/reference#criar-um-cliente $c @@ -74,48 +78,47 @@ function t02() { // Property: «street». // PHPDoc: «Street address» // Reference: «Address post office», Required, String (45) - ,'Avenida Faria Lima' + ,$ga->getStreetName() ?: 'Unknown' // 2017-04-23 // Property: «streetNumber». // PHPDoc: «Number address» // Reference: «Number», Required, String (10) - ,'2927' + ,$ga->getStreetNumber() ?: 'Unknown' // 2017-04-23 // Property: «district». // PHPDoc: «Neighborhood address» // Reference: «Neighborhood», Required, String (45) - ,'Itaim' + ,$ga->getLocality() ?: ($ga->getSubLocality() ?: 'Unknown') // 2017-04-23 // Property: «city». // PHPDoc: «City address» // Reference: «City», Required, String (32) - ,'Sao Paulo' + ,df_geo_city($ga) ?: 'Unknown' // 2017-04-23 // Property: «state». // PHPDoc: «State address» // Reference: «State», Required, String (32) - ,'SP' + ,df_geo_state_code($ga) ?: 'Unknown' // 2017-04-23 // Property: «STUB». // PHPDoc: «The zip code billing address» // Reference: «The zip code of the billing address», Required, String (9) - ,'01234000' + ,$ga->getPostalCode() // 2017-04-23 // Property: «complement». // PHPDoc: «Address complement» // Reference: «Address complement», Conditional, String (45) - ,'8' + ,'' // 2017-04-23 // Property: «country». // PHPDoc: «Country ISO-alpha3 format, BRA example.» // Reference: «Country in format ISO-alpha3, example BRA», Required, String (3) - ,'BRA' + ,df_country_2_to_3('BR') ) ; /** @var string[] $phoneA */ $phoneA = df_phone_explode(['+79629197300', 'RU'], false); if ($phoneA && 2 < count($phoneA)) { - xdebug_break(); /** * 2017-04-22 * «Customer's phone, with country code, area code and number» diff --git a/composer.json b/composer.json index fbc13c6..49673de 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/moip" - ,"version": "0.0.9" + ,"version": "0.1.0" ,"description": "The «Moip» payment extension for Magento 2." ,"type": "magento2-module" ,"homepage": "https://mage2.pro/c/extensions/moip" @@ -11,7 +11,7 @@ "homepage": "https://mage2.pro/users/dmitry_fedyuk", "role": "Developer" }] - ,"require": {"mage2pro/core": ">=2.5.22", "mage2pro/geo": ">=1.1.2", "moip/moip-sdk-php": ">=1.1.2"} + ,"require": {"mage2pro/core": ">=2.5.22", "mage2pro/geo": ">=1.1.3", "moip/moip-sdk-php": ">=1.1.2"} ,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\Moip\\": ""}} ,"keywords": [ "API"