Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Ruby Gems
/
var
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Ricardo Garcia
2016-07-11 15:26:25 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f599453a7e5be11fc64c83ec3a450031e97291ae
f599453a
1 parent
f32fdcc5
Builds for 1 pipeline
failed
in 0 seconds
Rubocop auto
Changes
22
Builds
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
51 additions
and
5 deletions
.ruby-version
Gemfile
Guardfile
Rakefile
bin/console
lib/acts_as_chargeable.rb
lib/conekta_card_handler.rb
lib/conekta_handler.rb
lib/conekta_oxxo_handler.rb
lib/conekta_payout_handler.rb
lib/conekta_spei_handler.rb
lib/generators/var_model/var_model_generator.rb
lib/var.rb
lib/var/version.rb
spec/acts_as_chargeable_spec.rb
spec/conekta_handler_spec.rb
spec/mocks/var_database_mock.rb
spec/mocks/var_models_mock.rb
spec/mocks/webhooks_requests.rb
spec/spec_helper.rb
spec/var_spec.rb
var.gemspec
.ruby-version
0 → 100644
View file @
f599453
2.3.1
Gemfile
View file @
f599453
# frozen_string_literal: true
source
'https://rubygems.org'
group
:development
do
...
...
Guardfile
View file @
f599453
# frozen_string_literal: true
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
...
...
Rakefile
View file @
f599453
# frozen_string_literal: true
require
'rspec/core/rake_task'
require
'bundler/gem_tasks'
...
...
bin/console
View file @
f599453
#!/usr/bin/env ruby
# frozen_string_literal: true
require
'bundler/setup'
require
'active_record'
...
...
lib/acts_as_chargeable.rb
View file @
f599453
# frozen_string_literal: true
module
ActsAsChargeable
extend
ActiveSupport
::
Concern
# Class Methods
...
...
lib/conekta_card_handler.rb
View file @
f599453
# frozen_string_literal: true
module
Var
class
ConektaCardHandler
<
ConektaHandler
PAYMENT_METHOD_STRING
=
'Card'
.
freeze
PAYMENT_METHOD_STRING
=
'Card'
end
end
...
...
lib/conekta_handler.rb
View file @
f599453
# frozen_string_literal: true
module
Var
class
ConektaHandler
PAYMENT_METHOD_STRING
=
'Conekta_payment'
.
freeze
PAYMENT_METHOD_STRING
=
'Conekta_payment'
class
<<
self
def
analyze
(
event
)
...
...
lib/conekta_oxxo_handler.rb
View file @
f599453
# frozen_string_literal: true
module
Var
class
ConektaOxxoHandler
<
ConektaHandler
PAYMENT_METHOD_STRING
=
'OXXO'
.
freeze
PAYMENT_METHOD_STRING
=
'OXXO'
end
end
...
...
lib/conekta_payout_handler.rb
View file @
f599453
# frozen_string_literal: true
module
Var
class
ConektaPayoutHandler
class
<<
self
...
...
lib/conekta_spei_handler.rb
View file @
f599453
# frozen_string_literal: true
module
Var
class
ConektaSpeiHandler
<
ConektaHandler
PAYMENT_METHOD_STRING
=
'Bank Transfer'
.
freeze
PAYMENT_METHOD_STRING
=
'Bank Transfer'
end
end
...
...
lib/generators/var_model/var_model_generator.rb
View file @
f599453
# frozen_string_literal: true
require
'rails/generators'
# Generator for models
class
VarModelGenerator
<
Rails
::
Generators
::
NamedBase
...
...
lib/var.rb
View file @
f599453
# frozen_string_literal: true
require
'var/version'
require
'conekta'
require
'paypal-sdk-rest'
...
...
lib/var/version.rb
View file @
f599453
# frozen_string_literal: true
# Var Version
module
Var
VERSION
=
'0.3.0'
.
freeze
VERSION
=
'0.3.0'
end
...
...
spec/acts_as_chargeable_spec.rb
View file @
f599453
# frozen_string_literal: true
require
'spec_helper'
describe
ActsAsChargeable
do
...
...
spec/conekta_handler_spec.rb
View file @
f599453
# frozen_string_literal: true
require
'spec_helper'
describe
Var
::
ConektaHandler
do
...
...
spec/mocks/var_database_mock.rb
View file @
f599453
# frozen_string_literal: true
class
VarDatabaseMock
class
<<
self
def
setup_db
...
...
spec/mocks/var_models_mock.rb
View file @
f599453
# frozen_string_literal: true
class
Product
<
ActiveRecord
::
Base
acts_as_chargeable
end
...
...
spec/mocks/webhooks_requests.rb
0 → 100644
View file @
f599453
module
WebHookPostRequest
OXXO_CHARGE_CREATED
=
{
"data"
:
{
"object"
:
{
"id"
:"5514803f241229981e0022e6"
,
"livemode"
:false
,
"created_at"
:
1427406911
,
"status"
:"pending_payment"
,
"currency"
:"MXN"
,
"description"
:"Stogies"
,
"reference_id"
:"9839-wolf_pack"
,
"failure_code"
:null
,
"failure_message"
:null
,
"monthly_installments"
:null
,
"object"
:"charge"
,
"amount"
:
20000
,
"paid_at"
:null
,
"fee"
:
812
,
"customer_id"
:""
,
"refunds"
:[]
,
"payment_method"
:
{
"barcode"
:"38100000000042290121213001160013"
,
"barcode_url"
:"http://s3.amazonaws.com/cash_payment_barcodes/"
\
"38100000000042290121213001160013.png"
,
"object"
:"cash_payment"
,
"type"
:"oxxo"
,
"expires_at"
:
1430006400
,
"store_name"
:"OXXO"
},
"details"
:
{
"name"
:"Wolverine"
,
"phone"
:"403-342-0642"
,
"email"
:"logan@x-men.org"
,
"line_items"
:[]
}
},
"previous_attributes"
:{}},
"livemode"
:false
,
"webhook_status"
:"pending"
,
"id"
:"5514803f241229981e0022e9"
,
"object"
:"event"
,
"type"
:"charge.created"
,
"created_at"
:
1427406911
,
"webhook_logs"
:[
{
"id"
:"webhl_PBmYvkfdNDYKezJ"
,
"url"
:"http://requestb.in/u3n4ywu3"
,
"failed_attempts"
:
0
,
"last_http_response_status"
:
-
1
,
"object"
:"webhook_log"
,
"last_attempted_at"
:
0
}]}
end
spec/spec_helper.rb
View file @
f599453
# frozen_string_literal: true
require
'pry'
require
'active_record'
require
'active_support'
...
...
spec/var_spec.rb
View file @
f599453
This diff is collapsed. Click to expand it.
var.gemspec
View file @
f599453
# frozen_string_literal: true
lib
=
File
.
expand_path
(
'../lib'
,
__FILE__
)
$LOAD_PATH
.
unshift
(
lib
)
unless
$LOAD_PATH
.
include?
(
lib
)
require
'var/version'
...
...
Please
register
or
login
to post a comment