vaulted_billing 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,76 @@
1
1
  # VaultedBilling
2
2
 
3
- A generic interface to integrate with multiple vault-style Gateways (Authorize.net CIM, NMI Customer Vault, etc.)
3
+ VaultedBilling is an abstraction library for use when working with "vaulted" payment processors. These processors store your customer's data - being their credit card number, verification number, name, address, and more - on their systems to alleviate your need for expensive software auditing, hardware security, and more. In nearly all cases, these processors provide you a unique customer and/or payment token in exchange for your actual customer payment information. Then, all current and future interactions with the payment processor on behalf of the customer are made using their identifiers, rather than credit card details.
4
4
 
5
+ Since you only store identifiers on your end, you are only responsible for: 1) the responsible reception, 2) responsible retransmission, and 3) no local storage of card details, when it comes to PCI compliance. Those items are solved with the following:
6
+
7
+ 1. Get an SSL certificate from a trusted provider and use HTTPS when collecting card information,
8
+ 2. Use a verified SSL connection when contacting your payment processor for storage or queries, and
9
+ 3. Do not log a full credit card number or verification code (CVV) to your application or server log files, your database (even temporarily), or anywhere else. Instead, collect and immediately re-transmit to your processor for storage.
10
+
11
+ ## Supported Services
12
+
13
+ VaultedBilling supports the following payment providers:
14
+
15
+ * [Authorize.net Customer Information Manager](http://www.authorize.net/solutions/merchantsolutions/merchantservices/cim/)
16
+ * [Network Merchant Inc. Customer Vault](https://www.nmi.com/newsmedia/index.php?ann_id=14)
17
+
18
+ VaultedBilling also supports the following fictitious payment provider for testing purposes:
19
+
20
+ * Bogus
21
+
22
+ ## Installation
23
+
24
+ VaultedBilling should be installed as a RubyGem dependency:
25
+
26
+ gem install vaulted_billing
27
+
28
+ If your application uses [Bundler](http://gembundler.com/), then add the following to your Gemfile:
29
+
30
+ gem 'vaulted_billing'
31
+
32
+ ## Usage
33
+
34
+ Simple (not particularly clean or recommended) example:
35
+
36
+ require 'vaulted_billing'
37
+
38
+ bogus = VaultedBilling::Gateways::Bogus.new(:username => 'Foo', :password => 'Bar')
39
+ customer = VaultedBilling::Customer.new(:email => "foo@example.com")
40
+ credit_card = VaultedBilling::CreditCard.new({
41
+ :card_number => '4111111111111111',
42
+ :cvv_number => '123',
43
+ :expires_on => Date.today + 1.year
44
+ })
45
+
46
+ bogus.add_customer(customer).tap do |customer_response|
47
+ if customer_response.success?
48
+ # normally, you'd store the vault_id on your local customer object,
49
+ # because you use this when referencing that customer in the future.
50
+ # But, for now, we'll just:
51
+ customer.vault_id = customer_response.vault_id
52
+
53
+ bogus.add_customer_credit_card(customer, credit_card).tap do |credit_response|
54
+ if response.success?
55
+ # Again, same as above, but for the credit card information:
56
+ credit_card.vault_id = credit_response.vault_id
57
+
58
+ puts "Wow! We stored a the payment credentials successfully!"
59
+
60
+ if bogus.purchase(customer, credit_card, 10.00).success?
61
+ puts "OMG WE'RE RICH!"
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+
68
+ ### Real world example
69
+
70
+ TODO: Real world example coming soon.
71
+
72
+ ## Testing
73
+
74
+ When you're manually testing your application - meaning Development mode - it is often best to actually have a "sandbox" or "test" account with your payment processor. In this mode, you should use those credentials with VaultedBilling and indicate to VaultedBilling that the processor is in test mode, either by setting it in the VaultedBilling::Configuration (see Configuration) or when you instantiate your Gateway. You should note that all gateways, except for the Bogus gateway, attempt to open network connections when in use. So, if you are testing with them (which is suggested), you should look into an HTTP mocking library like [VCR](https://github.com/myronmarston/vcr) with [WebMock](https://github.com/bblimke/webmock).
75
+
76
+ Strictly for testing interaction with the VaultedBilling library, there is a "Bogus" gateway provided. This processor will always successfully store customer and credit card information and return their identifiers. It will also always respond successfully to transaction (authorize, capture, refund, void, etc.) requests. This processor does not attempt to make network requests to any 3rd parties. It is not recommended that you solely test against this gateway, as you will find that your actual payment processor may have quirks which are unique and cannot be easily replicated.