From f8ce93e3614ad16ec4e2c2996b6fdb865992b979 Mon Sep 17 00:00:00 2001 From: Dmitry Fedyuk Date: Tue, 28 Nov 2017 16:41:03 +0300 Subject: [PATCH] 2.5.0: https://mage2.pro/t/5011 --- composer.json | 2 +- view/frontend/web/main.js | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2e24c38..9b7e615 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/stripe" - ,"version": "2.4.11" + ,"version": "2.5.0" ,"description": "Stripe integration with Magento 2" ,"type": "magento2-module" ,"homepage": "https://mage2.pro/c/stripe" diff --git a/view/frontend/web/main.js b/view/frontend/web/main.js index 1ecdbd6..09c34ea 100644 --- a/view/frontend/web/main.js +++ b/view/frontend/web/main.js @@ -464,8 +464,16 @@ return parent.extend({ * https://stripe.com/docs/api#create_source-owner * https://stripe.com/docs/api#source_object-owner * Hash, optional. + * 2017-11-28 + * An empty value for `name` leads to the failure: + * «You passed an empty string for 'owner[name]'. + * We assume empty values are an attempt to unset a parameter; + * however 'owner[name]' cannot be unset. + * You should remove 'owner[name]' from your request or supply a non-empty value.» + * https://mage2.pro/t/5011 + * To evade such failure, I have added df.clean(). */ - ,owner: { + ,owner: df.clean({ /** * 2017-10-20 «Owner’s address». * «Stripe API Reference» → «Create a source» → «owner» → «address». @@ -488,6 +496,14 @@ return parent.extend({ * https://stripe.com/docs/api#create_source-owner-name * https://stripe.com/docs/api#source_object-owner-name * String, optional. + * 2017-11-28 + * An empty value leads to the failure: + * «You passed an empty string for 'owner[name]'. + * We assume empty values are an attempt to unset a parameter; + * however 'owner[name]' cannot be unset. + * You should remove 'owner[name]' from your request or supply a non-empty value.» + * https://mage2.pro/t/5011 + * To evade such failure, I have added df.clean() to the whole `owner` object (see above). */ ,name: this.cardholder() /** @@ -498,7 +514,7 @@ return parent.extend({ * String, optional. */ ,phone: this._pPhone() - } + }) /** * 2017-10-20 «Stripe API Reference» → «Create a source» → «redirect». * «Parameters required for the redirect flow.