Permalink
Browse files

:argdo %s/Stripe/Webpay/g | update

  • Loading branch information...
1 parent 26828cc commit d836f332b68183cbde61e21f30e23b8628b8f844 @keikubo committed Sep 3, 2012
View
@@ -12,12 +12,12 @@
* Switch from vendored stripe-json to multi_json for all JSON
parsing and rendering. This should not impact programmatic usage
of the library, but may cause small rendering differences from,
- e.g., StripeObject#inspect (github issue #22)
+ e.g., WebpayObject#inspect (github issue #22)
* Add new delete_discount method to Customer objects
* Add new Transfer API resource
* 2 minor enhancements:
- * Switch from HTTP Basic auth to Bearer auth (Note: Stripe will
+ * Switch from HTTP Basic auth to Bearer auth (Note: Webpay will
support Basic auth for the indefinite future, but recommends
Bearer auth when possible going forward)
* Numerous test suite improvements
@@ -31,12 +31,12 @@
=== 1.6.2 2012-02-24
* 1 bugfix:
- * Correct argument handling in StripeObject#as_json
+ * Correct argument handling in WebpayObject#as_json
=== 1.6.1 2012-02-22
* 1 bugfix:
- * Fix StripeObject#inspect when ActiveSupport 3.0 is loaded
+ * Fix WebpayObject#inspect when ActiveSupport 3.0 is loaded
=== 1.6.0 2012-02-01
* A whole bunch of releases between 1.5.0 and 1.6.0, but few changes, mainly the addition of:
@@ -54,7 +54,7 @@
=== 1.3.4 2011-01-07
* 1 major enhancement:
- * Rename to Stripe
+ * Rename to Webpay
=== 1.2 2010-06-06
View
@@ -1,6 +1,6 @@
The MIT License
-Copyright (c) 2011- Stripe, Inc. (https://stripe.com)
+Copyright (c) 2011- Webpay, Inc. (https://stripe.com)
@boucher
boucher Sep 13, 2012

You can't actually just remove our copyright over this library. You're welcome to add your own copyright of any additions you make.

@keikubo
keikubo Sep 14, 2012 Owner

Oops. Thanks for your comment. I'll update it as soon as possible. Of course, I respect your copyright, and I'll modify it as soon as possible.

UPDATE: 0b8a24d.
I just updated LICENSE, and updated webpay gem to 1.7.2.4 for using the proper license statement.
Thanks for your important notice about the license.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,9 +1,9 @@
-= Stripe Ruby bindings {<img src="https://gemnasium.com/stripe/stripe-ruby.png" alt="Dependency Status" />}[https://gemnasium.com/stripe/stripe-ruby]
+= Webpay Ruby bindings {<img src="https://gemnasium.com/stripe/stripe-ruby.png" alt="Dependency Status" />}[https://gemnasium.com/stripe/stripe-ruby]
== Installation
You don't need this source code unless you want to modify the gem. If
-you just want to use the Stripe Ruby bindings, you should run:
+you just want to use the Webpay Ruby bindings, you should run:
sudo gem install --source https://code.stripe.com stripe
View
@@ -1,4 +1,4 @@
-# Stripe Ruby bindings
+# Webpay Ruby bindings
# API spec at http://stripe.com/api/spec
require 'cgi'
require 'set'
@@ -43,7 +43,7 @@
require 'stripe/errors/invalid_request_error'
require 'stripe/errors/authentication_error'
-module Stripe
+module Webpay
@@ssl_bundle_path = File.join(File.dirname(__FILE__), 'data/ca-certificates.crt')
@@api_key = nil
@@api_base = 'https://api.stripe.com/v1'
@@ -79,11 +79,11 @@ def self.verify_ssl_certs
def self.request(method, url, api_key, params=nil, headers={})
api_key ||= @@api_key
- raise AuthenticationError.new('No API key provided. (HINT: set your API key using "Stripe.api_key = <API-KEY>". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.)') unless api_key
+ raise AuthenticationError.new('No API key provided. (HINT: set your API key using "Webpay.api_key = <API-KEY>". You can generate API keys from the Webpay web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.)') unless api_key
if !verify_ssl_certs
unless @no_verify
- $stderr.puts "WARNING: Running without SSL cert verification. Execute 'Stripe.verify_ssl_certs = true' to enable verification."
+ $stderr.puts "WARNING: Running without SSL cert verification. Execute 'Webpay.verify_ssl_certs = true' to enable verification."
@no_verify = true
end
ssl_opts = { :verify_ssl => false }
@@ -102,7 +102,7 @@ def self.request(method, url, api_key, params=nil, headers={})
uname = (@@uname ||= RUBY_PLATFORM =~ /linux|darwin/i ? `uname -a 2>/dev/null`.strip : nil)
lang_version = "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})"
ua = {
- :bindings_version => Stripe::VERSION,
+ :bindings_version => Webpay::VERSION,
:lang => 'ruby',
:lang_version => lang_version,
:platform => RUBY_PLATFORM,
@@ -125,7 +125,7 @@ def self.request(method, url, api_key, params=nil, headers={})
end
begin
- headers = { :x_stripe_client_user_agent => Stripe::JSON.dump(ua) }.merge(headers)
+ headers = { :x_stripe_client_user_agent => Webpay::JSON.dump(ua) }.merge(headers)
rescue => e
headers = {
:x_stripe_client_raw_user_agent => ua.inspect,
@@ -134,7 +134,7 @@ def self.request(method, url, api_key, params=nil, headers={})
end
headers = {
- :user_agent => "Stripe/v1 RubyBindings/#{Stripe::VERSION}",
+ :user_agent => "Webpay/v1 RubyBindings/#{Webpay::VERSION}",
:authorization => "Bearer #{api_key}"
}.merge(headers)
opts = {
@@ -173,7 +173,7 @@ def self.request(method, url, api_key, params=nil, headers={})
begin
# Would use :symbolize_names => true, but apparently there is
# some library out there that makes symbolize_names not work.
- resp = Stripe::JSON.load(rbody)
+ resp = Webpay::JSON.load(rbody)
rescue MultiJson::DecodeError
raise APIError.new("Invalid response object from API: #{rbody.inspect} (HTTP response code was #{rcode})", rcode, rbody)
end
@@ -190,10 +190,10 @@ def self.execute_request(opts)
def self.handle_api_error(rcode, rbody)
begin
- error_obj = Stripe::JSON.load(rbody)
+ error_obj = Webpay::JSON.load(rbody)
error_obj = Util.symbolize_names(error_obj)
- error = error_obj[:error] or raise StripeError.new # escape from parsing
- rescue MultiJson::DecodeError, StripeError
+ error = error_obj[:error] or raise WebpayError.new # escape from parsing
+ rescue MultiJson::DecodeError, WebpayError
raise APIError.new("Invalid response object from API: #{rbody.inspect} (HTTP response code was #{rcode})", rcode, rbody)
end
@@ -228,13 +228,13 @@ def self.api_error(error, rcode, rbody, error_obj)
def self.handle_restclient_error(e)
case e
when RestClient::ServerBrokeConnection, RestClient::RequestTimeout
- message = "Could not connect to Stripe (#{@@api_base}). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com."
+ message = "Could not connect to Webpay (#{@@api_base}). Please check your internet connection and try again. If this problem persists, you should check Webpay's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com."
when RestClient::SSLCertificateNotVerified
- message = "Could not verify Stripe's SSL certificate. Please make sure that your network is not intercepting certificates. (Try going to https://api.stripe.com/v1 in your browser.) If this problem persists, let us know at support@stripe.com."
+ message = "Could not verify Webpay's SSL certificate. Please make sure that your network is not intercepting certificates. (Try going to https://api.stripe.com/v1 in your browser.) If this problem persists, let us know at support@stripe.com."
when SocketError
- message = "Unexpected error communicating when trying to connect to Stripe. HINT: You may be seeing this message because your DNS is not working. To check, try running 'host stripe.com' from the command line."
+ message = "Unexpected error communicating when trying to connect to Webpay. HINT: You may be seeing this message because your DNS is not working. To check, try running 'host stripe.com' from the command line."
else
- message = "Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com."
+ message = "Unexpected error communicating with Webpay. If this problem persists, let us know at support@stripe.com."
end
message += "\n\n(Network error: #{e.message})"
raise APIConnectionError.new(message)
@@ -1,4 +1,4 @@
-module Stripe
+module Webpay
class Account < SingletonAPIResource
end
end
@@ -1,9 +1,9 @@
-module Stripe
+module Webpay
module APIOperations
module Create
module ClassMethods
def create(params={}, api_key=nil)
- response, api_key = Stripe.request(:post, self.url, api_key, params)
+ response, api_key = Webpay.request(:post, self.url, api_key, params)
Util.convert_to_stripe_object(response, api_key)
end
end
@@ -1,8 +1,8 @@
-module Stripe
+module Webpay
module APIOperations
module Delete
def delete
- response, api_key = Stripe.request(:delete, url, @api_key)
+ response, api_key = Webpay.request(:delete, url, @api_key)
refresh_from(response, api_key)
self
end
@@ -1,9 +1,9 @@
-module Stripe
+module Webpay
module APIOperations
module List
module ClassMethods
def all(filters={}, api_key=nil)
- response, api_key = Stripe.request(:get, url, api_key, filters)
+ response, api_key = Webpay.request(:get, url, api_key, filters)
Util.convert_to_stripe_object(response, api_key)
end
end
@@ -1,11 +1,11 @@
-module Stripe
+module Webpay
module APIOperations
module Update
def save
if @unsaved_values.length > 0
values = {}
@unsaved_values.each { |k| values[k] = @values[k] }
- response, api_key = Stripe.request(:post, url, @api_key, values)
+ response, api_key = Webpay.request(:post, url, @api_key, values)
refresh_from(response, api_key)
end
self
@@ -1,5 +1,5 @@
-module Stripe
- class APIResource < StripeObject
+module Webpay
+ class APIResource < WebpayObject
def self.class_name
self.name.split('::')[-1]
end
@@ -19,7 +19,7 @@ def url
end
def refresh
- response, api_key = Stripe.request(:get, url, @api_key)
+ response, api_key = Webpay.request(:get, url, @api_key)
refresh_from(response, api_key)
self
end
View
@@ -1,17 +1,17 @@
-module Stripe
+module Webpay
class Charge < APIResource
- include Stripe::APIOperations::List
- include Stripe::APIOperations::Create
- include Stripe::APIOperations::Update
+ include Webpay::APIOperations::List
+ include Webpay::APIOperations::Create
+ include Webpay::APIOperations::Update
def refund(params={})
- response, api_key = Stripe.request(:post, refund_url, @api_key, params)
+ response, api_key = Webpay.request(:post, refund_url, @api_key, params)
refresh_from(response, api_key)
self
end
def capture(params={})
- response, api_key = Stripe.request(:post, capture_url, @api_key, params)
+ response, api_key = Webpay.request(:post, capture_url, @api_key, params)
refresh_from(response, api_key)
self
end
@@ -1,7 +1,7 @@
-module Stripe
+module Webpay
class Coupon < APIResource
- include Stripe::APIOperations::Create
- include Stripe::APIOperations::Delete
- include Stripe::APIOperations::List
+ include Webpay::APIOperations::Create
+ include Webpay::APIOperations::Delete
+ include Webpay::APIOperations::List
end
end
@@ -1,9 +1,9 @@
-module Stripe
+module Webpay
class Customer < APIResource
- include Stripe::APIOperations::Create
- include Stripe::APIOperations::Delete
- include Stripe::APIOperations::Update
- include Stripe::APIOperations::List
+ include Webpay::APIOperations::Create
+ include Webpay::APIOperations::Delete
+ include Webpay::APIOperations::Update
+ include Webpay::APIOperations::List
def add_invoice_item(params)
InvoiceItem.create(params.merge(:customer => id), @api_key)
@@ -22,19 +22,19 @@ def charges
end
def cancel_subscription(params={})
- response, api_key = Stripe.request(:delete, subscription_url, @api_key, params)
+ response, api_key = Webpay.request(:delete, subscription_url, @api_key, params)
refresh_from({ :subscription => response }, api_key, true)
subscription
end
def update_subscription(params)
- response, api_key = Stripe.request(:post, subscription_url, @api_key, params)
+ response, api_key = Webpay.request(:post, subscription_url, @api_key, params)
refresh_from({ :subscription => response }, api_key, true)
subscription
end
def delete_discount
- Stripe.request(:delete, discount_url, @api_key)
+ Webpay.request(:delete, discount_url, @api_key)
refresh_from({ :discount => nil }, api_key, true)
end
@@ -1,4 +1,4 @@
-module Stripe
- class APIConnectionError < StripeError
+module Webpay
+ class APIConnectionError < WebpayError
end
end
@@ -1,4 +1,4 @@
-module Stripe
- class APIError < StripeError
+module Webpay
+ class APIError < WebpayError
end
end
@@ -1,4 +1,4 @@
-module Stripe
- class AuthenticationError < StripeError
+module Webpay
+ class AuthenticationError < WebpayError
end
end
@@ -1,5 +1,5 @@
-module Stripe
- class CardError < StripeError
+module Webpay
+ class CardError < WebpayError
attr_reader :param, :code
def initialize(message, param, code, http_status=nil, http_body=nil, json_body=nil)
@@ -1,5 +1,5 @@
-module Stripe
- class InvalidRequestError < StripeError
+module Webpay
+ class InvalidRequestError < WebpayError
attr_accessor :param
def initialize(message, param, http_status=nil, http_body=nil, json_body=nil)
@@ -1,5 +1,5 @@
-module Stripe
- class StripeError < StandardError
+module Webpay
+ class WebpayError < StandardError
attr_reader :message
attr_reader :http_status
attr_reader :http_body
View
@@ -1,5 +1,5 @@
-module Stripe
+module Webpay
class Event < APIResource
- include Stripe::APIOperations::List
+ include Webpay::APIOperations::List
end
end
View
@@ -1,15 +1,15 @@
-module Stripe
+module Webpay
class Invoice < APIResource
- include Stripe::APIOperations::List
- include Stripe::APIOperations::Update
+ include Webpay::APIOperations::List
+ include Webpay::APIOperations::Update
def self.upcoming(params)
- response, api_key = Stripe.request(:get, upcoming_url, @api_key, params)
+ response, api_key = Webpay.request(:get, upcoming_url, @api_key, params)
Util.convert_to_stripe_object(response, api_key)
end
def pay
- response, api_key = Stripe.request(:post, pay_url, @api_key)
+ response, api_key = Webpay.request(:post, pay_url, @api_key)
refresh_from(response, api_key)
self
end
@@ -1,8 +1,8 @@
-module Stripe
+module Webpay
class InvoiceItem < APIResource
- include Stripe::APIOperations::List
- include Stripe::APIOperations::Create
- include Stripe::APIOperations::Delete
- include Stripe::APIOperations::Update
+ include Webpay::APIOperations::List
+ include Webpay::APIOperations::Create
+ include Webpay::APIOperations::Delete
+ include Webpay::APIOperations::Update
end
end
View
@@ -1,4 +1,4 @@
-module Stripe
+module Webpay
module JSON
if MultiJson.respond_to?(:dump)
def self.dump(*args)
Oops, something went wrong.

0 comments on commit d836f33

Please sign in to comment.