moneytree-rails 0.1.1 β†’ 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d3cb24c4e2a58def5e8f26fdd8ec1bce493b0deea44320eb30eed239a16f470
4
- data.tar.gz: c8d266821266b5b886777afd8f45ed0bb19af5fb11b74de5145f77e25dd10b18
3
+ metadata.gz: e93dc9ca7a7f7c33bb6866abec9c4ef68038d5c9c542a92ea20d890086ab4369
4
+ data.tar.gz: ab099aef15f26a36c21934d1a70d39e8641db9fee2feb88107681b3f72b5f890
5
5
  SHA512:
6
- metadata.gz: ee2779c427433363015894190d09a801cb2cb8ecc3b7eb746cf067149b95486acd8c221ddbc074f0f943b7baf6bcd5845b3c22ccb59cb8464cac11fba5b4d760
7
- data.tar.gz: 04de96735920050133081445ffae416e9248a08d0f33e6c1e806b0f9968a53a0dc8da60c2fa4d0274455a021fc251fb6662cfb567e712449e158bdccf71e6327
6
+ metadata.gz: c76a4655eb8f63a3c7643b95b595e8cbe7484ff5a92642ca28e1947225ed6ebce4be3bf80cb620bc1ace05450b308a976901f4f3415fcfce2083dd4f475453fd
7
+ data.tar.gz: ddb835e4f3a5113752ca9929a4fd0788565729a8881a7c917bbb13548bdc856e025e0b7def3c0647d6e5314bf4e0670ce70036355be1a21a77439002cb786699
data/README.md CHANGED
@@ -1,19 +1,5 @@
1
1
  # 🚧 WORK IN PROGRESS 🚧
2
2
 
3
- - [ ] OAuth
4
- - [ ] Controller actions
5
- - [ ] Scopes
6
- - [ ] Square
7
- - [ ] Stripe
8
- - [ ] Braintree
9
- - [ ] Moneytree models
10
- - [ ] Payment gateway, belongs to account
11
- - [ ] Cards
12
- - [ ] Customers
13
- - [ ] Payments
14
- - [ ] Refunds
15
- - [ ] Notifications
16
-
17
3
  # Moneytree πŸ’΅ 🌴
18
4
 
19
5
  [![Actions Status](https://github.com/kieranklaassen/moneytree/workflows/build/badge.svg)](https://github.com/kieranklaassen/moneytree/actions)
@@ -26,16 +12,16 @@ functionality with almost no work on your end:
26
12
 
27
13
  - πŸ’΅πŸ’ΆπŸ’·πŸ’΄ Multi-currency
28
14
  - πŸ”‘ OAuth to link your PSP account
29
- - πŸ‘©β€πŸ’»PSP account creation, (with commission)
15
+ - πŸ‘©β€πŸ’» PSP account creation, (with commission)
30
16
  - βš™οΈ Webhooks
31
- - πŸ’³ PCI compliance with Javascript libraries
32
- - 🧲 Platform fees
17
+ - πŸ’³ ~~PCI compliance with Javascript libraries~~ comming soon
18
+ - 🧲 Platform fees a.k.a. Market Places
33
19
 
34
20
  Currently we support the following PSP's:
35
21
 
36
- - Square
22
+ - ~~Square~~ comming soon
37
23
  - Stripe
38
- - Braintree
24
+ - ~~Braintree~~ comming soon
39
25
 
40
26
  But if you want to add more PSP's, we make it easy to do so. Read our
41
27
  [Contributing](https://github.com/kieranklaassen/moneytree#contributing) section to learn more.
@@ -57,31 +43,72 @@ Add the latest version of Moneytree to your gem Gemfile by running:
57
43
  ```bash
58
44
  $ bundle add moneytree-rails
59
45
  $ bundle install
60
- $ bundle exec moneytree init
46
+ $ rails g moneytree:install:migrations
47
+ $ rails g db:migrate
61
48
  ```
62
49
 
63
- Or your can use environment variables:
64
-
65
- FIXME: add
66
-
67
50
  ## Configuration
68
51
 
52
+ ### Initializer
53
+
69
54
  Do you need to make some changes to how Moneytree is used? You can create an initializer
70
55
  `config/initializers/moneytree.rb`
71
56
 
72
57
  ```ruby
73
58
  Moneytree.setup do |config|
74
- config.enabled_psps = [:square, :stripe, :braintree]
75
- config.account_class = 'Account'
76
- config.order_class = 'Order'
77
- config.transaction_class = 'Transaction'
78
-
79
- config.square_credentials = {
80
- app_id: ENV['SQUARE_APP_ID'],
81
- app_secret: ENV['SQUARE_APP_SECRET'],
82
- environment: Rails.env.production? : 'production' : 'sandbox',
83
- oauth_domain: Rails.env.production? ? 'https://connect.squareup.com' : 'https://connect.squareupsandbox.com'
59
+ config.current_account = :current_merchant
60
+ config.stripe_credentials = {
61
+ api_key: ENV['STRIPE_API_KEY'],
62
+ client_id: ENV['STRIPE_CLIENT_ID']
84
63
  }
64
+ config.oauth_redirect = '/welcome_back'
65
+ config.refund_application_fee = true # false by default
66
+ end
67
+ ```
68
+
69
+ ### Routes
70
+
71
+ Add to your routes and authenticate if needed to make sure only admins can integrate with OAuth.
72
+
73
+ ```ruby
74
+ authenticate :user, ->(u) { u.admin? } do
75
+ mount Moneytree::Engine => '/moneytree'
76
+ end
77
+ ```
78
+
79
+ ### Models
80
+
81
+ Include account concern into your models and make sure the following attributes work:
82
+
83
+ ```ruby
84
+ class Merchant < ApplicationRecord
85
+ include Moneytree::Account
86
+
87
+ def email
88
+ owner.email
89
+ end
90
+
91
+ def currency_code
92
+ currency.code
93
+ end
94
+
95
+ def website
96
+ 'https://www.boomtown.com'
97
+ end
98
+
99
+ # Optional, will be called by Moneytree after authenticating with the PSP
100
+ def moneytree_oauth_callback
101
+ puts "Hurray, I just got associated with a Moneytree gateway!"
102
+ end
103
+ end
104
+ ```
105
+
106
+ And add `Moneytree::Order` concern to the model that will be the parent for all the transactions. In most cases this
107
+ will be an order. This model will keep a balance and you can add multiple payments and refunds to it.
108
+
109
+ ```ruby
110
+ class Order < ApplicationRecord
111
+ include Moneytree::Order
85
112
  end
86
113
  ```
87
114
 
@@ -95,6 +122,10 @@ transaction attached for the payment. You can name these models however you want
95
122
 
96
123
  ### The API
97
124
 
125
+ #### Moneytree::PaymentGateway
126
+
127
+ ##### #method here
128
+
98
129
  ## Development
99
130
 
100
131
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can
@@ -112,25 +143,9 @@ intended to be a safe, welcoming space for collaboration, and contributors are e
112
143
 
113
144
  ## License
114
145
 
115
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
146
+ The gem is available as open-source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
116
147
 
117
148
  ## Code of Conduct
118
149
 
119
150
  Everyone interacting in the Moneytree project's codebases, issue trackers, chat rooms and mailing lists is expected to
120
151
  follow the [code of conduct](https://github.com/kieranklaassen/moneytree/blob/master/CODE_OF_CONDUCT.md).
121
-
122
- rails g model payment_gateway psp_credentials:text moneytree_psp:integer account:references{polymorphic}
123
-
124
- owner t.string :name t.text :psp_credentials t.integer :moneytree_psp
125
-
126
- rails g model orders t.string :description t.string :remote_identifier t.references :customer t.references :account
127
-
128
- rails g model transactions t.decimal :amount t.decimal :app_fee_amount t.integer :status t.integer :type t.string
129
- :remote_identifier t.string :currency_code t.string :psp_error t.integer :moneytree_psp t.references :account
130
- t.references :order t.references :card
131
-
132
- rails g model customers t.string :first_name t.string :last_name t.string :email t.string :remote_identifier t.integer
133
- :moneytree_psp t.references :account
134
-
135
- rails g model cards t.string :card_brand t.string :last_4 t.integer :expiration_month t.integer :expiration_year
136
- t.string :cardholder_name t.string :fingerprint t.integer :moneytree_psp t.references :customer t.references :account
@@ -6,9 +6,10 @@ module Moneytree
6
6
  end
7
7
 
8
8
  def callback
9
- payment_gateway = PaymentGateway.create!(psp: 'stripe', account: current_account)
9
+ # TODO: Remove this module prefix once we figure out how to properly autoload this.
10
+ payment_gateway = Moneytree::PaymentGateway.create!(psp: 'stripe', account: current_account)
10
11
  payment_gateway.oauth_callback(payment_gateway_params)
11
- redirect_to '/', notice: 'Connected to Stripe'
12
+ redirect_to Moneytree.oauth_redirect, notice: 'Connected to Stripe'
12
13
  end
13
14
 
14
15
  private
@@ -27,7 +28,7 @@ module Moneytree
27
28
  response_type: :code,
28
29
  client_id: Moneytree.stripe_credentials[:client_id],
29
30
  scope: PaymentProvider::Stripe::PERMISSION,
30
- redirect_uri: oauth_stripe_callback_url, # FIXME: use rails url helper and add host
31
+ redirect_uri: oauth_stripe_callback_url,
31
32
  'stripe_user[email]': current_account.email,
32
33
  'stripe_user[url]': current_account.website,
33
34
  'stripe_user[currency]': current_account.currency_code
@@ -1,8 +1,66 @@
1
1
  module Moneytree
2
2
  module Webhooks
3
3
  class StripeController < ApplicationController
4
+ skip_before_action :verify_authenticity_token
5
+
4
6
  def create
5
- # Do some callback magic here
7
+ case webhook_params.type
8
+ when 'charge.succeeded'
9
+ process_charge!
10
+ when 'charge.refunded'
11
+ process_refund!
12
+ else
13
+ puts "Unhandled event type: #{webhook_params.type}"
14
+ end
15
+
16
+ head :ok
17
+ end
18
+
19
+ private
20
+
21
+ def webhook_params
22
+ @webhook_params ||=
23
+ ::Stripe::Event.construct_from(
24
+ JSON.parse(request.body.read, symbolize_names: true)
25
+ )
26
+ end
27
+
28
+ def process_charge!
29
+ return if transaction.completed?
30
+
31
+ transaction.process_response(
32
+ TransactionResponse.new(:success, '', { charge_id: stripe_object.id })
33
+ )
34
+
35
+ if Moneytree.order_status_trigger_method
36
+ transaction.order.send(Moneytree.order_status_trigger_method, transaction)
37
+ end
38
+ end
39
+
40
+ def process_refund!
41
+ stripe_object.refunds.data.each do |stripe_refund_object|
42
+ # TODO: Create refund transaction in db for PSP-initiated refunds
43
+ next if stripe_refund_object.metadata[:moneytree_transaction_id].blank?
44
+
45
+ refund = transaction.refunds.find(stripe_refund_object.metadata[:moneytree_transaction_id])
46
+
47
+ next if refund.completed?
48
+
49
+ refund.process_response(
50
+ TransactionResponse.new(:success, '')
51
+ )
52
+ if Moneytree.order_status_trigger_method
53
+ transaction.order.send(Moneytree.order_status_trigger_method, transaction)
54
+ end
55
+ end
56
+ end
57
+
58
+ def transaction
59
+ @transaction ||= Transaction.find(stripe_object.metadata[:moneytree_transaction_id])
60
+ end
61
+
62
+ def stripe_object
63
+ @stripe_object ||= webhook_params.data.object
6
64
  end
7
65
  end
8
66
  end
@@ -0,0 +1,23 @@
1
+ module Moneytree
2
+ class Payment < Transaction
3
+ has_many :refunds, class_name: 'Refund'
4
+
5
+ validates_absence_of :payment_id
6
+
7
+ validates_numericality_of :amount, greater_than: 0
8
+ validates_numericality_of :app_fee_amount, greater_than_or_equal_to: 0
9
+
10
+ private
11
+
12
+ def execute_transaction(metadata: {})
13
+ process_response(
14
+ payment_gateway.charge(
15
+ amount,
16
+ details,
17
+ app_fee_amount: app_fee_amount,
18
+ metadata: metadata.merge(moneytree_transaction_id: id)
19
+ )
20
+ )
21
+ end
22
+ end
23
+ end
@@ -1,14 +1,12 @@
1
1
  module Moneytree
2
2
  class PaymentGateway < ApplicationRecord
3
- include Moneytree::Account
4
-
5
3
  belongs_to :account, polymorphic: true
6
4
 
7
5
  enum psp: Moneytree::PSPS
8
6
  serialize :psp_credentials
9
7
  # encrypts :psp_credentials
10
8
  # FIXME: enable https://github.com/ankane/lockbox
11
- delegate :oauth_link, :scope_correct?, to: :payment_provider
9
+ delegate :oauth_link, :scope_correct?, :charge, :refund, to: :payment_provider
12
10
 
13
11
  # has_many :orders
14
12
  # has_many :transactions
@@ -17,6 +15,7 @@ module Moneytree
17
15
 
18
16
  def oauth_callback(params)
19
17
  update! psp_credentials: payment_provider.get_access_token(params)
18
+ account.send(:moneytree_oauth_callback) if account.respond_to?(:moneytree_oauth_callback, true)
20
19
  end
21
20
 
22
21
  def psp_connected?
@@ -31,16 +30,13 @@ module Moneytree
31
30
  psp_credentials[:scope] == payment_provider.scope
32
31
  end
33
32
 
34
- def charge; end
35
-
36
- def refund; end
37
-
38
33
  private
39
34
 
40
35
  def payment_provider
41
36
  @payment_provider ||=
42
37
  case psp
43
38
  when 'stripe'
39
+ # TODO: see if we only need to pass credentials
44
40
  Moneytree::PaymentProvider::Stripe.new(self)
45
41
  # when 'square'
46
42
  # Moneytree::PaymentProvider::Square.new(self)
@@ -0,0 +1,46 @@
1
+ module Moneytree
2
+ class Refund < Transaction
3
+ belongs_to :payment, class_name: 'Moneytree::Payment'
4
+
5
+ before_validation :set_order, :set_payment_gateway
6
+
7
+ validates_presence_of :payment
8
+
9
+ validates_numericality_of :amount, less_than: 0
10
+ validates_numericality_of :app_fee_amount, less_than_or_equal_to: 0
11
+
12
+ validate :order_matches_payment, :gateway_matches_payment
13
+
14
+ private
15
+
16
+ def execute_transaction(metadata: {})
17
+ process_response(
18
+ payment_gateway.refund(
19
+ amount,
20
+ payment.details,
21
+ metadata: metadata.merge(moneytree_transaction_id: id)
22
+ )
23
+ )
24
+ end
25
+
26
+ # validates_presence_of :payment
27
+ def set_order
28
+ self.order ||= payment&.order
29
+ end
30
+
31
+ # validates_presence_of :payment
32
+ def set_payment_gateway
33
+ self.payment_gateway ||= payment&.payment_gateway
34
+ end
35
+
36
+ # validates
37
+ def order_matches_payment
38
+ errors.add(:order_id, :mismatch) if order_id != payment&.order_id
39
+ end
40
+
41
+ # validates
42
+ def gateway_matches_payment
43
+ errors.add(:payment_gateway_id, :mismatch) if payment_gateway_id != payment&.payment_gateway_id
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,30 @@
1
+ module Moneytree
2
+ class Transaction < ApplicationRecord
3
+ belongs_to :payment_gateway
4
+ belongs_to :order, polymorphic: true
5
+
6
+ validates_presence_of :psp_error, if: :failed?
7
+
8
+ enum status: %i[initialized pending completed failed]
9
+
10
+ serialize :details
11
+
12
+ after_create_commit :execute_transaction
13
+
14
+ def process_response(response)
15
+ if response.success?
16
+ update!(
17
+ status: :completed,
18
+ psp_error: response.message,
19
+ details: (details || {}).merge(response.body)
20
+ )
21
+ else
22
+ # FIXME: pending state
23
+ update!(
24
+ status: :failed,
25
+ psp_error: response.message
26
+ )
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,4 +1,8 @@
1
1
  Moneytree::Engine.routes.draw do
2
2
  get 'oauth/stripe/new', to: 'oauth/stripe#new'
3
3
  get 'oauth/stripe/callback', to: 'oauth/stripe#callback'
4
+
5
+ namespace :webhooks do
6
+ resources :stripe, only: :create
7
+ end
4
8
  end
@@ -3,7 +3,7 @@ class CreateMoneytreePaymentGateways < ActiveRecord::Migration[6.0]
3
3
  create_table :moneytree_payment_gateways do |t|
4
4
  t.text :psp_credentials
5
5
  t.integer :psp, null: false
6
- t.references :account, polymorphic: true, null: false, index: { name: 'index_moneytree_pg_account_type_and_account_id' }
6
+ t.references :account, polymorphic: true, index: { name: 'index_moneytree_pg_account_type_and_account_id' }
7
7
 
8
8
  t.timestamps
9
9
  end
@@ -0,0 +1,18 @@
1
+ class CreateMoneytreeTransactions < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :moneytree_transactions do |t|
4
+ t.decimal :amount, null: false, default: 0
5
+ t.decimal :app_fee_amount, null: false, default: 0
6
+ t.integer :status, null: false, default: 0
7
+ t.string :type, null: false, default: 'Moneytree::Payment'
8
+ t.references :order, polymorphic: true, null: false
9
+ t.references :payment_gateway, null: false
10
+ t.references :payment, foreign_key: { to_table: :moneytree_transactions }
11
+ t.text :psp_error
12
+ t.text :details
13
+ t.text :refund_reason
14
+
15
+ t.timestamps
16
+ end
17
+ end
18
+ end
@@ -0,0 +1 @@
1
+ require 'moneytree'
@@ -5,7 +5,9 @@
5
5
  # modules
6
6
  # FIXME: autoload instead? https :/ / github.com / excid3 / noticed / blob / master / lib / noticed.rb
7
7
  require 'moneytree/version'
8
+ require 'moneytree/transaction_response'
8
9
  require 'moneytree/account'
10
+ require 'moneytree/order'
9
11
  require 'moneytree/payment_provider/base'
10
12
  require 'moneytree/payment_provider/stripe'
11
13
  require 'moneytree/engine'
@@ -16,9 +18,14 @@ module Moneytree
16
18
  mattr_accessor :enabled_psps
17
19
  mattr_accessor :stripe_credentials
18
20
  mattr_accessor :current_account
21
+ mattr_accessor :oauth_redirect
22
+ mattr_accessor :refund_application_fee
23
+ mattr_accessor :order_status_trigger_method
19
24
 
20
25
  @@enabled_psps = PSPS
21
26
  @@current_account = :current_account
27
+ @@oauth_redirect = '/'
28
+ @@refund_application_fee = false
22
29
 
23
30
  def self.setup
24
31
  yield self
@@ -3,9 +3,10 @@ require 'active_support/concern'
3
3
  module Moneytree
4
4
  module Account
5
5
  extend ActiveSupport::Concern
6
+ # FIXME: see if we can remove config.current_account = :current_merchant and set it from here
6
7
 
7
8
  included do
8
- has_one :moneytree_payment_gateway, class_name: 'Moneytree::PaymentGateway', foreign_key: 'account_id'
9
+ has_one :moneytree_payment_gateway, class_name: 'Moneytree::PaymentGateway', foreign_key: 'account_id', inverse_of: :account, as: :account
9
10
  end
10
11
  end
11
12
  end
@@ -0,0 +1,15 @@
1
+ require 'active_support/concern'
2
+
3
+ module Moneytree
4
+ module Order
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ has_many :moneytree_transactions, class_name: 'Moneytree::Transaction', foreign_key: 'order_id', inverse_of: :order, as: :order
9
+ end
10
+
11
+ def new_payment(*args)
12
+ moneytree_transactions << Payment.new(*args)
13
+ end
14
+ end
15
+ end
@@ -14,16 +14,62 @@ module Moneytree
14
14
 
15
15
  def get_access_token(params)
16
16
  # FIXME: add error handling
17
- ::Stripe::OAuth.token({
18
- grant_type: 'authorization_code',
19
- code: params[:code]
20
- }).to_hash
17
+ ::Stripe::OAuth.token(
18
+ {
19
+ grant_type: 'authorization_code',
20
+ code: params[:code]
21
+ }
22
+ ).to_hash
21
23
  end
22
24
 
23
25
  def scope
24
26
  PERMISSION.to_s
25
27
  end
26
28
 
29
+ def charge(amount, details, app_fee_amount: 0, description: "Charge for #{account.name}", metadata:)
30
+ # `source` is obtained with Stripe.js; see https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token
31
+ response = ::Stripe::Charge.create(
32
+ {
33
+ amount: (amount * 100).to_i,
34
+ currency: account.currency_code,
35
+ source: details[:card_token],
36
+ description: description,
37
+ metadata: metadata,
38
+ application_fee_amount: (app_fee_amount * 100).to_i
39
+ },
40
+ stripe_account: payment_gateway.psp_credentials[:stripe_user_id]
41
+ )
42
+ # succeeded, pending, or failed
43
+ TransactionResponse.new(
44
+ { succeeded: :success, pending: :pending, failed: :failed }[response[:status].to_sym],
45
+ response[:failure_message],
46
+ { charge_id: response[:id] }
47
+ )
48
+ rescue ::Stripe::StripeError => e
49
+ TransactionResponse.new(:failed, e.message)
50
+ end
51
+
52
+ def refund(amount, details, metadata:)
53
+ response = ::Stripe::Refund.create(
54
+ {
55
+ charge: details[:charge_id],
56
+ amount: (-amount * 100).to_i,
57
+ metadata: metadata,
58
+ refund_application_fee: Moneytree.refund_application_fee
59
+ },
60
+ stripe_account: payment_gateway.psp_credentials[:stripe_user_id]
61
+ )
62
+
63
+ # succeeded, pending, or failed
64
+ TransactionResponse.new(
65
+ { succeeded: :success, pending: :pending, failed: :failed }[response[:status].to_sym],
66
+ response[:failure_message],
67
+ { refund_id: response[:id] }
68
+ )
69
+ rescue ::Stripe::StripeError => e
70
+ TransactionResponse.new(:failed, e.message)
71
+ end
72
+
27
73
  private
28
74
 
29
75
  def credentitals
@@ -0,0 +1,15 @@
1
+ module Moneytree
2
+ class TransactionResponse
3
+ attr_reader :message, :status, :body
4
+
5
+ def initialize(status, message, body = {})
6
+ @status = status
7
+ @message = message
8
+ @body = body
9
+ end
10
+
11
+ def success?
12
+ @status == :success
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Moneytree
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moneytree-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kieran Klaassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -56,21 +56,26 @@ files:
56
56
  - app/controllers/moneytree/oauth/stripe_controller.rb
57
57
  - app/controllers/moneytree/webhooks/square_controller.rb
58
58
  - app/controllers/moneytree/webhooks/stripe_controller.rb
59
- - app/helpers/moneytree/application_helper.rb
60
- - app/helpers/moneytree/oauth/stripe_helper.rb
61
59
  - app/jobs/moneytree/application_job.rb
62
60
  - app/mailers/moneytree/application_mailer.rb
63
61
  - app/models/moneytree/application_record.rb
62
+ - app/models/moneytree/payment.rb
64
63
  - app/models/moneytree/payment_gateway.rb
64
+ - app/models/moneytree/refund.rb
65
+ - app/models/moneytree/transaction.rb
65
66
  - app/views/layouts/moneytree/application.html.erb
66
67
  - config/routes.rb
67
68
  - db/migrate/20200914151648_create_moneytree_payment_gateways.rb
69
+ - db/migrate/20201008161617_create_moneytree_transactions.rb
70
+ - lib/moneytree-rails.rb
68
71
  - lib/moneytree.rb
69
72
  - lib/moneytree/account.rb
70
73
  - lib/moneytree/engine.rb
74
+ - lib/moneytree/order.rb
71
75
  - lib/moneytree/payment_provider/base.rb
72
76
  - lib/moneytree/payment_provider/square.rb
73
77
  - lib/moneytree/payment_provider/stripe.rb
78
+ - lib/moneytree/transaction_response.rb
74
79
  - lib/moneytree/version.rb
75
80
  - lib/tasks/moneytree_tasks.rake
76
81
  homepage: https://github.com/kieranklaassen/moneytree
@@ -92,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
97
  - !ruby/object:Gem::Version
93
98
  version: '0'
94
99
  requirements: []
95
- rubygems_version: 3.1.2
100
+ rubygems_version: 3.1.4
96
101
  signing_key:
97
102
  specification_version: 4
98
103
  summary: A payments engine for rails centered aorund transactional payments and orders.
@@ -1,4 +0,0 @@
1
- module Moneytree
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,6 +0,0 @@
1
- module Moneytree
2
- module Oauth
3
- module StripeHelper
4
- end
5
- end
6
- end