-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor _big.json.jbuilder so that it dynamically loads the payment source view based on that source's payment method. Add payment views for each payment method which will be used to render a payment source as json.
- Loading branch information
Taylor Scott
committed
Apr 2, 2018
1 parent
0666737
commit 6bbe885
Showing
5 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
api/app/views/spree/api/payments/source_views/_check.json.jbuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.nil! |
6 changes: 6 additions & 0 deletions
6
api/app/views/spree/api/payments/source_views/_gateway.json.jbuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
attrs = [:id, :month, :year, :cc_type, :last_digits, :name] | ||
if @current_user_roles.include?("admin") | ||
attrs += [:gateway_customer_profile_id, :gateway_payment_profile_id] | ||
end | ||
|
||
json.(payment_source, *attrs) |
3 changes: 3 additions & 0 deletions
3
api/app/views/spree/api/payments/source_views/_storecredit.json.jbuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
json.(payment_source, :id, :memo, :created_at) | ||
json.created_by payment_source.created_by.email | ||
json.category payment_source.category, :id, :name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters