Skip to content

Commit

Permalink
Copy CVV content page from SolidusFrontend
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmendoza committed Feb 15, 2023
1 parent ae77f76 commit cdc518e
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/views/spree/shared/_braintree_hosted_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<%= label_tag "card_code#{payment_method.id}", Spree::CreditCard.human_attribute_name(:card_code), class: "required" %>
<div class="input" id="card_code<%= payment_method.id %>"></div>

<a href="/content/cvv" class="info cvvLink" target="_blank">
<a href="/solidus_braintree/content/cvv" class="info cvvLink" target="_blank">
(<%= I18n.t("spree.what_is_this") %>)
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
post :update
end
end

get '/content/cvv', to: 'content#cvv', as: :cvv
end
11 changes: 11 additions & 0 deletions lib/controllers/frontend/solidus_braintree/content_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module SolidusBraintree
class ContentController < StoreController
respond_to :html

def cvv
render layout: false
end
end
end
13 changes: 13 additions & 0 deletions lib/views/frontend/solidus_braintree/content/cvv.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="cvv" data-hook>
<h1><%= t('spree.what_is_a_cvv') %></h1>
<p>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.</p>
<p>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.</p>
<div class="cid-caption">Visa</div>
<%= image_tag 'solidus_braintree/credit_cards/visa_cid.gif' %>
<div class="cid-caption">Master Card</div>
<%= image_tag 'solidus_braintree/credit_cards/master_cid.jpg' %>
<div class="cid-caption">American Express</div>
<%= image_tag 'solidus_braintree/credit_cards/amex_cid.gif' %>
<div class="cid-caption">Discover</div>
<%= image_tag 'solidus_braintree/credit_cards/discover_cid.gif' %>
</div>
12 changes: 12 additions & 0 deletions spec/controllers/solidus_braintree/content_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cdc518e

Please sign in to comment.