From 165dc3d73c10d150a6a2f2f19403905fc73e3252 Mon Sep 17 00:00:00 2001 From: Looi Ferng Yi Date: Wed, 12 Apr 2017 12:31:15 +0800 Subject: [PATCH] add support for stripe statement descriptor --- app/models/spree/gateway/stripe_gateway.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/spree/gateway/stripe_gateway.rb b/app/models/spree/gateway/stripe_gateway.rb index 8c6a52f..b056e25 100644 --- a/app/models/spree/gateway/stripe_gateway.rb +++ b/app/models/spree/gateway/stripe_gateway.rb @@ -85,6 +85,10 @@ def options_for_purchase_or_auth(money, creditcard, gateway_options) options[:description] = "Spree Order ID: #{gateway_options[:order_id]}" options[:currency] = gateway_options[:currency] + # The Stripe ActiveMerchant gateway accepts a key named statement_description to set statement_descriptor + # The maximum length of the statement descriptor is 22 characters. + options[:statement_description] = options[:description][0..21] + if customer = creditcard.gateway_customer_profile_id options[:customer] = customer end