{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/60648464","id":60648464,"diff_hunk":"@@ -1,28 +1,26 @@\n module Spree\n-  class CreditCard < Spree::Base\n-    belongs_to :payment_method\n+  class CreditCard < Spree::PaymentSource\n     belongs_to :user, class_name: Spree.user_class, foreign_key: 'user_id'\n     belongs_to :address\n-    has_many :payments, as: :source\n \n     before_save :set_last_digits\n \n-    after_save :ensure_one_default\n-\n     accepts_nested_attributes_for :address\n \n     attr_reader :number\n-    attr_accessor :encrypted_data,\n-                    :imported,\n-                    :verification_value\n+    attr_accessor :encrypted_data, :verification_value\n \n     validates :month, :year, numericality: { only_integer: true }, if: :require_card_numbers?, on: :create\n     validates :number, presence: true, if: :require_card_numbers?, on: :create, unless: :imported\n     validates :name, presence: true, if: :require_card_numbers?, on: :create\n     validates :verification_value, presence: true, if: :require_card_numbers?, on: :create, unless: :imported\n \n     scope :with_payment_profile, -> { where('gateway_customer_profile_id IS NOT NULL') }\n-    scope :default, -> { where(default: true) }\n+\n+    def self.default\n+      ActiveSupport::Deprecation.warn(\"CreditCard.default is deprecated. Please use Spree::Wallet instead.\")\n+      joins(:wallet_sources).where(spree_wallet_sources: {default: true})","path":"core/app/models/spree/credit_card.rb","position":31,"original_position":31,"commit_id":"c742bb9cc04d5f047e6d664957739edf9da8e01f","original_commit_id":"c742bb9cc04d5f047e6d664957739edf9da8e01f","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Space inside { missing.<br>Space inside } missing.","created_at":"2016-04-21T20:20:25Z","updated_at":"2016-04-21T20:20:25Z","html_url":"https://github.com/solidusio/solidus/pull/1091#discussion_r60648464","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1091","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/60648464"},"html":{"href":"https://github.com/solidusio/solidus/pull/1091#discussion_r60648464"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1091"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1091","id":67415874,"html_url":"https://github.com/solidusio/solidus/pull/1091","diff_url":"https://github.com/solidusio/solidus/pull/1091.diff","patch_url":"https://github.com/solidusio/solidus/pull/1091.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1091","number":1091,"state":"open","locked":false,"title":"[RFC] Wallet & Support for non-credit card payment sources","user":{"login":"jordan-brough","id":23050,"avatar_url":"https://avatars.githubusercontent.com/u/23050?v=3","gravatar_id":"","url":"https://api.github.com/users/jordan-brough","html_url":"https://github.com/jordan-brough","followers_url":"https://api.github.com/users/jordan-brough/followers","following_url":"https://api.github.com/users/jordan-brough/following{/other_user}","gists_url":"https://api.github.com/users/jordan-brough/gists{/gist_id}","starred_url":"https://api.github.com/users/jordan-brough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordan-brough/subscriptions","organizations_url":"https://api.github.com/users/jordan-brough/orgs","repos_url":"https://api.github.com/users/jordan-brough/repos","events_url":"https://api.github.com/users/jordan-brough/events{/privacy}","received_events_url":"https://api.github.com/users/jordan-brough/received_events","type":"User","site_admin":false},"body":"This is an attempt to update Solidus to fully support non-credit-card payment sources, and to make that easier to do it also introduces the concept of `Spree::Wallet` (see the code comments in wallet.rb for a summary of that class).\r\n\r\nI've based this on top of three other PRs that I hope will be merged first:\r\n- https://github.com/solidusio/solidus/pull/1023\r\n- https://github.com/solidusio/solidus/pull/1033\r\n- https://github.com/solidusio/solidus/pull/1086\r\n\r\nThis is based on and heavily influenced by @mamhoff's Spree PR from last year:\r\nhttps://github.com/spree/spree/pull/6831/\r\nThe major difference is the \"Wallet\" concept that he and I have discussed a bunch in the past month.\r\n\r\nComments and suggestions are very welcome.","created_at":"2016-04-21T20:20:12Z","updated_at":"2016-04-21T20:20:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eed57aaccfb2af214bdec4adef1d2abaa161e7a6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1091/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1091/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1091/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/c742bb9cc04d5f047e6d664957739edf9da8e01f","head":{"label":"jordan-brough:non-credit-card-payment-sources","ref":"non-credit-card-payment-sources","sha":"c742bb9cc04d5f047e6d664957739edf9da8e01f","user":{"login":"jordan-brough","id":23050,"avatar_url":"https://avatars.githubusercontent.com/u/23050?v=3","gravatar_id":"","url":"https://api.github.com/users/jordan-brough","html_url":"https://github.com/jordan-brough","followers_url":"https://api.github.com/users/jordan-brough/followers","following_url":"https://api.github.com/users/jordan-brough/following{/other_user}","gists_url":"https://api.github.com/users/jordan-brough/gists{/gist_id}","starred_url":"https://api.github.com/users/jordan-brough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordan-brough/subscriptions","organizations_url":"https://api.github.com/users/jordan-brough/orgs","repos_url":"https://api.github.com/users/jordan-brough/repos","events_url":"https://api.github.com/users/jordan-brough/events{/privacy}","received_events_url":"https://api.github.com/users/jordan-brough/received_events","type":"User","site_admin":false},"repo":{"id":37918071,"name":"solidus","full_name":"jordan-brough/solidus","owner":{"login":"jordan-brough","id":23050,"avatar_url":"https://avatars.githubusercontent.com/u/23050?v=3","gravatar_id":"","url":"https://api.github.com/users/jordan-brough","html_url":"https://github.com/jordan-brough","followers_url":"https://api.github.com/users/jordan-brough/followers","following_url":"https://api.github.com/users/jordan-brough/following{/other_user}","gists_url":"https://api.github.com/users/jordan-brough/gists{/gist_id}","starred_url":"https://api.github.com/users/jordan-brough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordan-brough/subscriptions","organizations_url":"https://api.github.com/users/jordan-brough/orgs","repos_url":"https://api.github.com/users/jordan-brough/repos","events_url":"https://api.github.com/users/jordan-brough/events{/privacy}","received_events_url":"https://api.github.com/users/jordan-brough/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jordan-brough/solidus","description":"Solidus e-commerce system","fork":true,"url":"https://api.github.com/repos/jordan-brough/solidus","forks_url":"https://api.github.com/repos/jordan-brough/solidus/forks","keys_url":"https://api.github.com/repos/jordan-brough/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jordan-brough/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jordan-brough/solidus/teams","hooks_url":"https://api.github.com/repos/jordan-brough/solidus/hooks","issue_events_url":"https://api.github.com/repos/jordan-brough/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/jordan-brough/solidus/events","assignees_url":"https://api.github.com/repos/jordan-brough/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/jordan-brough/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/jordan-brough/solidus/tags","blobs_url":"https://api.github.com/repos/jordan-brough/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jordan-brough/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jordan-brough/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/jordan-brough/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jordan-brough/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/jordan-brough/solidus/languages","stargazers_url":"https://api.github.com/repos/jordan-brough/solidus/stargazers","contributors_url":"https://api.github.com/repos/jordan-brough/solidus/contributors","subscribers_url":"https://api.github.com/repos/jordan-brough/solidus/subscribers","subscription_url":"https://api.github.com/repos/jordan-brough/solidus/subscription","commits_url":"https://api.github.com/repos/jordan-brough/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/jordan-brough/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/jordan-brough/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/jordan-brough/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/jordan-brough/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/jordan-brough/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jordan-brough/solidus/merges","archive_url":"https://api.github.com/repos/jordan-brough/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jordan-brough/solidus/downloads","issues_url":"https://api.github.com/repos/jordan-brough/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/jordan-brough/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/jordan-brough/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/jordan-brough/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jordan-brough/solidus/labels{/name}","releases_url":"https://api.github.com/repos/jordan-brough/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/jordan-brough/solidus/deployments","created_at":"2015-06-23T12:36:58Z","updated_at":"2015-06-23T12:37:02Z","pushed_at":"2016-04-21T20:17:07Z","git_url":"git://github.com/jordan-brough/solidus.git","ssh_url":"git@github.com:jordan-brough/solidus.git","clone_url":"https://github.com/jordan-brough/solidus.git","svn_url":"https://github.com/jordan-brough/solidus","homepage":"","size":66738,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"solidusio:jordan/non-credit-card-payment-sources-base","ref":"jordan/non-credit-card-payment-sources-base","sha":"a3edbb14ad68526735675220c265b66d146d81cd","user":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"repo":{"id":30985840,"name":"solidus","full_name":"solidusio/solidus","owner":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solidusio/solidus","description":"Solidus, Rails eCommerce System","fork":false,"url":"https://api.github.com/repos/solidusio/solidus","forks_url":"https://api.github.com/repos/solidusio/solidus/forks","keys_url":"https://api.github.com/repos/solidusio/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solidusio/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solidusio/solidus/teams","hooks_url":"https://api.github.com/repos/solidusio/solidus/hooks","issue_events_url":"https://api.github.com/repos/solidusio/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/solidusio/solidus/events","assignees_url":"https://api.github.com/repos/solidusio/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/solidusio/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/solidusio/solidus/tags","blobs_url":"https://api.github.com/repos/solidusio/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solidusio/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solidusio/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solidusio/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/solidusio/solidus/languages","stargazers_url":"https://api.github.com/repos/solidusio/solidus/stargazers","contributors_url":"https://api.github.com/repos/solidusio/solidus/contributors","subscribers_url":"https://api.github.com/repos/solidusio/solidus/subscribers","subscription_url":"https://api.github.com/repos/solidusio/solidus/subscription","commits_url":"https://api.github.com/repos/solidusio/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solidusio/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solidusio/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solidusio/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solidusio/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/solidusio/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solidusio/solidus/merges","archive_url":"https://api.github.com/repos/solidusio/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solidusio/solidus/downloads","issues_url":"https://api.github.com/repos/solidusio/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/solidusio/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/solidusio/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/solidusio/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solidusio/solidus/labels{/name}","releases_url":"https://api.github.com/repos/solidusio/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/solidusio/solidus/deployments","created_at":"2015-02-18T20:41:58Z","updated_at":"2016-04-21T14:20:34Z","pushed_at":"2016-04-21T20:20:12Z","git_url":"git://github.com/solidusio/solidus.git","ssh_url":"git@github.com:solidusio/solidus.git","clone_url":"https://github.com/solidusio/solidus.git","svn_url":"https://github.com/solidusio/solidus","homepage":"http://solidus.io/","size":68730,"stargazers_count":898,"watchers_count":898,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":239,"mirror_url":null,"open_issues_count":104,"forks":239,"open_issues":104,"watchers":898,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1091"},"html":{"href":"https://github.com/solidusio/solidus/pull/1091"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1091"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1091/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1091/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1091/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/c742bb9cc04d5f047e6d664957739edf9da8e01f"}}}}