Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Add support for Stripe's statement descriptor field #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/spree/gateway/stripe_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down