diff --git a/app/assets/images/solidus_braintree/credit_cards/amex_cid.gif b/app/assets/images/solidus_braintree/credit_cards/amex_cid.gif new file mode 100644 index 00000000..fb940dc5 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/amex_cid.gif differ diff --git a/app/assets/images/solidus_braintree/credit_cards/credit_card.gif b/app/assets/images/solidus_braintree/credit_cards/credit_card.gif new file mode 100644 index 00000000..2e61a23c Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/credit_card.gif differ diff --git a/app/assets/images/solidus_braintree/credit_cards/discover_cid.gif b/app/assets/images/solidus_braintree/credit_cards/discover_cid.gif new file mode 100644 index 00000000..083820f4 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/discover_cid.gif differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/american_express.png b/app/assets/images/solidus_braintree/credit_cards/icons/american_express.png new file mode 100644 index 00000000..73fa1ea7 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/american_express.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/cirrus.png b/app/assets/images/solidus_braintree/credit_cards/icons/cirrus.png new file mode 100644 index 00000000..81065def Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/cirrus.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/delta.png b/app/assets/images/solidus_braintree/credit_cards/icons/delta.png new file mode 100644 index 00000000..f7c79d9a Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/delta.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/diners_club.png b/app/assets/images/solidus_braintree/credit_cards/icons/diners_club.png new file mode 100644 index 00000000..02d8c950 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/diners_club.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/directdebit.png b/app/assets/images/solidus_braintree/credit_cards/icons/directdebit.png new file mode 100644 index 00000000..c76274ed Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/directdebit.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/discover.png b/app/assets/images/solidus_braintree/credit_cards/icons/discover.png new file mode 100644 index 00000000..e7d199b8 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/discover.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/egold.png b/app/assets/images/solidus_braintree/credit_cards/icons/egold.png new file mode 100644 index 00000000..abb2bba8 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/egold.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/maestro.png b/app/assets/images/solidus_braintree/credit_cards/icons/maestro.png new file mode 100644 index 00000000..1dd6f42c Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/maestro.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/master.png b/app/assets/images/solidus_braintree/credit_cards/icons/master.png new file mode 100644 index 00000000..f8992cdf Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/master.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/paypal.png b/app/assets/images/solidus_braintree/credit_cards/icons/paypal.png new file mode 100644 index 00000000..91051c00 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/paypal.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/solo.png b/app/assets/images/solidus_braintree/credit_cards/icons/solo.png new file mode 100644 index 00000000..ad867f1d Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/solo.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/switch.png b/app/assets/images/solidus_braintree/credit_cards/icons/switch.png new file mode 100644 index 00000000..5d8315b1 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/switch.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/visa.png b/app/assets/images/solidus_braintree/credit_cards/icons/visa.png new file mode 100644 index 00000000..7545c43f Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/visa.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/visaelectron.png b/app/assets/images/solidus_braintree/credit_cards/icons/visaelectron.png new file mode 100644 index 00000000..4b0c4a84 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/visaelectron.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/westernunion.png b/app/assets/images/solidus_braintree/credit_cards/icons/westernunion.png new file mode 100644 index 00000000..2a1766ac Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/westernunion.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/wirecard.png b/app/assets/images/solidus_braintree/credit_cards/icons/wirecard.png new file mode 100644 index 00000000..0cc55c5b Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/wirecard.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/icons/worldpay.png b/app/assets/images/solidus_braintree/credit_cards/icons/worldpay.png new file mode 100644 index 00000000..29b89ddb Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/icons/worldpay.png differ diff --git a/app/assets/images/solidus_braintree/credit_cards/master_cid.jpg b/app/assets/images/solidus_braintree/credit_cards/master_cid.jpg new file mode 100644 index 00000000..b27fa71a Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/master_cid.jpg differ diff --git a/app/assets/images/solidus_braintree/credit_cards/visa_cid.gif b/app/assets/images/solidus_braintree/credit_cards/visa_cid.gif new file mode 100644 index 00000000..4048a820 Binary files /dev/null and b/app/assets/images/solidus_braintree/credit_cards/visa_cid.gif differ diff --git a/app/views/spree/shared/_braintree_hosted_fields.html.erb b/app/views/spree/shared/_braintree_hosted_fields.html.erb index 78058086..5d540e2b 100644 --- a/app/views/spree/shared/_braintree_hosted_fields.html.erb +++ b/app/views/spree/shared/_braintree_hosted_fields.html.erb @@ -23,7 +23,7 @@ <%= label_tag "card_code#{payment_method.id}", Spree::CreditCard.human_attribute_name(:card_code), class: "required" %>
- + (<%= I18n.t("spree.what_is_this") %>) diff --git a/config/routes.rb b/config/routes.rb index 46f6f778..6fe5bb34 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,4 +11,6 @@ post :update end end + + get '/content/cvv', to: 'content#cvv', as: :cvv end diff --git a/lib/controllers/frontend/solidus_braintree/content_controller.rb b/lib/controllers/frontend/solidus_braintree/content_controller.rb new file mode 100644 index 00000000..05da3604 --- /dev/null +++ b/lib/controllers/frontend/solidus_braintree/content_controller.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module SolidusBraintree + class ContentController < StoreController + respond_to :html + + def cvv + render layout: false + end + end +end diff --git a/lib/views/frontend/solidus_braintree/content/cvv.html.erb b/lib/views/frontend/solidus_braintree/content/cvv.html.erb new file mode 100644 index 00000000..069062fb --- /dev/null +++ b/lib/views/frontend/solidus_braintree/content/cvv.html.erb @@ -0,0 +1,13 @@ +
+

<%= t('spree.what_is_a_cvv') %>

+

For Visa, MasterCard, and Discover cards, the card code is the last 3 digit number located on the back of your card on or above your signature line. For an American Express card, it is the 4 digits on the FRONT above the end of your card number.

+

To help reduce fraud in the card-not-present environment, credit card companies have introduced a card code program. Visa calls this code Card Verification Value (CVV); MasterCard calls it Card Validation Code (CVC); Discover calls it Card ID (CID). The card code is a three- or four- digit security code that is printed on the back of cards. The number typically appears at the end of the signature panel.

+
Visa
+ <%= image_tag 'solidus_braintree/credit_cards/visa_cid.gif' %> +
Master Card
+ <%= image_tag 'solidus_braintree/credit_cards/master_cid.jpg' %> +
American Express
+ <%= image_tag 'solidus_braintree/credit_cards/amex_cid.gif' %> +
Discover
+ <%= image_tag 'solidus_braintree/credit_cards/discover_cid.gif' %> +
diff --git a/spec/controllers/solidus_braintree/content_controller_spec.rb b/spec/controllers/solidus_braintree/content_controller_spec.rb new file mode 100644 index 00000000..acd80aec --- /dev/null +++ b/spec/controllers/solidus_braintree/content_controller_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'solidus_braintree_helper' + +RSpec.describe SolidusBraintree::ContentController, type: :controller do + routes { SolidusBraintree::Engine.routes } + + it "displays the CVV page" do + get :cvv + expect(response.response_code).to eq(200) + end +end