-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge branch 'release/2.0.0' of https://github.com/mercadopag…
…o/sdk-ruby into release/2.0.0" This reverts commit 73c240d, reversing changes made to dfd1e42.
- Loading branch information
Pedro Gonçalves
committed
May 25, 2020
1 parent
7f0366f
commit ee91c14
Showing
2 changed files
with
54 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ bin/ | |
config/*yml | ||
pkg/ | ||
*.log | ||
*.gem | ||
*.gem |
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 |
---|---|---|
@@ -1,53 +1,53 @@ | ||
|
||
require 'rubygems' | ||
require 'json' | ||
require 'uri' | ||
require 'net/https' | ||
require 'yaml' | ||
require File.dirname(__FILE__) + '/version' | ||
require 'ssl_options_patch' | ||
require 'card' | ||
require 'cardtoken' | ||
require 'customer' | ||
require 'discountcampaign' | ||
require 'genericcall' | ||
require 'identificationtype' | ||
require 'merchantorder' | ||
require 'payment' | ||
require 'preference' | ||
|
||
class MercadoPago | ||
attr_reader :card, :cardtoken, :customer, :discountcampaign, :genericcall, :identificationtype, :merchantorder, :payment, :preference | ||
@@sandbox = false | ||
def initialize(*args) | ||
if args.size < 1 or args.size > 2 | ||
raise "Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN" | ||
end | ||
|
||
@client_id = args.at(0) if args.size == 2 | ||
@client_secret = args.at(1) if args.size == 2 | ||
@ll_access_token = args.at(0) if args.size == 1 | ||
|
||
@card = Card.new(@client_id, @client_secret, @ll_access_token) | ||
@cardtoken = CardToken.new(@client_id, @client_secret, @ll_access_token) | ||
@customer = Customer.new(@client_id, @client_secret, @ll_access_token) | ||
@discountcampaign = DiscountCampaign.new(@client_id, @client_secret, @ll_access_token) | ||
@genericcall = GenericCall.new(@client_id, @client_secret, @ll_access_token) | ||
@identificationtype = IdentificationType.new(@client_id, @client_secret, @ll_access_token) | ||
@merchantorder = MerchantOrder.new(@client_id, @client_secret, @ll_access_token) | ||
@payment = Payment.new(@client_id, @client_secret, @ll_access_token) | ||
@preference = Preference.new(@client_id, @client_secret, @ll_access_token) | ||
end | ||
|
||
def sandbox_mode(enable=nil) | ||
if not enable.nil? | ||
@@sandbox = enable | ||
end | ||
|
||
return @@sandbox | ||
end | ||
|
||
def self.sandbox | ||
@@sandbox | ||
end | ||
end | ||
|
||
require 'rubygems' | ||
require 'json' | ||
require 'uri' | ||
require 'net/https' | ||
require 'yaml' | ||
require File.dirname(__FILE__) + '/version' | ||
require 'ssl_options_patch' | ||
require 'card' | ||
require 'cardtoken' | ||
require 'customer' | ||
require 'discountcampaign' | ||
require 'genericcall' | ||
require 'identificationtype' | ||
require 'merchantorder' | ||
require 'payment' | ||
require 'preference' | ||
|
||
class MercadoPago | ||
attr_reader :card, :cardtoken, :customer, :discountcampaign, :genericcall, :identificationtype, :merchantorder, :payment, :preference | ||
@@sandbox = false | ||
def initialize(*args) | ||
if args.size < 1 or args.size > 2 | ||
raise "Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN" | ||
end | ||
|
||
@client_id = args.at(0) if args.size == 2 | ||
@client_secret = args.at(1) if args.size == 2 | ||
@ll_access_token = args.at(0) if args.size == 1 | ||
|
||
@card = Card.new(@client_id, @client_secret, @ll_access_token) | ||
@cardtoken = CardToken.new(@client_id, @client_secret, @ll_access_token) | ||
@customer = Customer.new(@client_id, @client_secret, @ll_access_token) | ||
@discountcampaign = DiscountCampaign.new(@client_id, @client_secret, @ll_access_token) | ||
@genericcall = GenericCall.new(@client_id, @client_secret, @ll_access_token) | ||
@identificationtype = IdentificationType.new(@client_id, @client_secret, @ll_access_token) | ||
@merchantorder = MerchantOrder.new(@client_id, @client_secret, @ll_access_token) | ||
@payment = Payment.new(@client_id, @client_secret, @ll_access_token) | ||
@preference = Preference.new(@client_id, @client_secret, @ll_access_token) | ||
end | ||
|
||
def sandbox_mode(enable=nil) | ||
if not enable.nil? | ||
@@sandbox = enable | ||
end | ||
|
||
return @@sandbox | ||
end | ||
|
||
def self.sandbox | ||
@@sandbox | ||
end | ||
end |