Skip to content

Commit cb137ce

Browse files
authored
Merge pull request #169 from AuthorizeNet/future
Changes for Release 1.9.6
2 parents 0fc4bdc + fc94037 commit cb137ce

18 files changed

Lines changed: 104 additions & 25 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Gemfile.lock
22
.ruby-*
33
.idea
44
gemfiles/*.lock
5+
/coverage/

.simplecov

Lines changed: 0 additions & 14 deletions
This file was deleted.

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ script:
2424
- bundle exec rake spec:cim
2525
- bundle exec rake spec:reporting
2626
- bundle exec rake spec:testrunner
27+
28+
env:
29+
global:
30+
- API_LOGIN_ID=5KP3u95bQpv
31+
- API_TRANSACTION_KEY=346HZ32z3fP4hTG2
32+
- MD5_VALUE='MD5_TEST'
33+

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
+ Thanks for contributing to the Authorize.Net Ruby SDK.
2+
3+
+ Before you submit a pull request, we ask that you consider the following:
4+
5+
- Submit an issue to state the problem your pull request solves or the funtionality that it adds. We can then advise on the feasability of the pull request, and let you know if there are other possible solutions.
6+
- Part of the SDK is auto-generated based on the XML schema. Due to this auto-generation, we cannot merge contributions for request or response classes. You are welcome to open an issue to report problems or suggest improvements. Auto-generated classes include all classes in [lib/authorize_net/api/schema.rb](https://github.com/AuthorizeNet/sdk-ruby/tree/master/lib/authorize_net/api) and [lib/authorize_net/api/transaction.rb](https://github.com/AuthorizeNet/sdk-ruby/tree/master/lib/authorize_net/api) folders, except [lib/authorize_net/api/api_transaction.rb](https://github.com/AuthorizeNet/sdk-ruby/tree/master/lib/authorize_net/api).
7+
- Files marked as deprecated are no longer supported. Issues and pull requests for changes to these deprecated files will be closed.
8+
- Recent changes will be in [the future branch](https://github.com/AuthorizeNet/sdk-ruby/tree/future). Before submitting an issue or pull request, check the future branch first to see if a fix has already been merged.
9+
- **Always use the future branch for pull requests.** We will first merge pull requests to the future branch, before pushing to the master branch for the next release.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source 'https://rubygems.org'
2-
gem 'coveralls', require: false
2+
33
gemspec

MIGRATING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Migrating from Legacy Authorize.Net Classes
2+
3+
Authorize.Net no longer supports several legacy classes, including AIM, ARB and others listed below, as part of sdk-ruby. If you are using any of these, we recommend that you update your code to use the new Authorize.Net API classes under (sdk-ruby/lib/authorize_net/api).
4+
5+
**For details on the deprecation and replacement of legacy Authorize.Net APIs, visit https://developer.authorize.net/api/upgrade_guide/.**
6+
7+
## Full list of classes that are no longer supported
8+
| Class | New Feature | Sample Codes directory/repository |
9+
|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
10+
| AIM (Authorize.NET/AIM) | [PaymentTransactions](https://developer.authorize.net/api/reference/index.html#payment-transactions) | [sample-code-ruby/PaymentTransactions](https://github.com/AuthorizeNet/sample-code-ruby/tree/master/PaymentTransactions) |
11+
| ARB (Authorize.NET/ARB) | [RecurringBilling](https://developer.authorize.net/api/reference/index.html#recurring-billing) | [sample-code-ruby/Recurring Billing](https://github.com/AuthorizeNet/sample-code-ruby/tree/master/RecurringBilling) |
12+
| CIM (Authorize.NET/CIM) | [CustomerProfiles](https://developer.authorize.net/api/reference/index.html#customer-profiles) | [sample-code-ruby/CustomerProfiles](https://github.com/AuthorizeNet/sample-code-ruby/tree/master/CustomerProfiles) |
13+
| SIM (Authorize.NET/SIM) | [Accept Hosted](https://developer.authorize.net/content/developer/en_us/api/reference/features/accept_hosted.html) | Not available |
14+
| Reporting (Authorize.NET/Reporting) | [TransactionReporting](https://developer.authorize.net/api/reference/index.html#transaction-reporting) | [sample-code-ruby/TransactionReporting](https://github.com/AuthorizeNet/sample-code-ruby/tree/master/TransactionReporting) |
15+
16+
## Example
17+
#### New model sample code for (charge-credit-card)
18+
```Ruby
19+
require 'rubygems'
20+
require 'yaml'
21+
require 'authorizenet'
22+
require 'securerandom'
23+
24+
include AuthorizeNet::API
25+
26+
def charge_credit_card()
27+
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
28+
29+
# Set the request to operate in either the sandbox or production environment
30+
transaction = Transaction.new(config["api_login_id"], config["api_transaction_key"], :gateway => :sandbox)
31+
32+
# Create the payment transaction object
33+
request = CreateTransactionRequest.new
34+
35+
# Populate the payment data
36+
request.transactionRequest = TransactionRequestType.new()
37+
request.transactionRequest.amount = ((SecureRandom.random_number + 1 ) * 150 ).round(2)
38+
request.transactionRequest.payment = PaymentType.new
39+
request.transactionRequest.payment.creditCard = CreditCardType.new("4242424242424242","0220","123")
40+
request.transactionRequest.customer = CustomerDataType.new(CustomerTypeEnum::Individual,"CUST-1234","bmc@mail.com",DriversLicenseType.new("DrivLicenseNumber123","WA","05/05/1990"),"123456789")
41+
42+
# call the Transaction and get the response
43+
response = transaction.create_transaction(request)
44+
45+
return response
46+
end
47+
48+
if __FILE__ == $0
49+
charge_credit_card()
50+
end
51+
```

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Scrutinizer ][scrutinizer_badge]][scrutinizer]
77

88
Starting Release 1.8.6 November 2015 the Authorize.Net API has been [reorganized to be more merchant focused](https://developer.authorize.net/api/upgrade_guide/).
9-
AIM, ARB, CIM, Reporting and SIM have all been deprecated in favor of AuthorizeNet::API.
9+
AIM, ARB, CIM, Reporting and SIM have all been deprecated in favor of sdk-ruby/lib/authorize_net/api.
1010

1111
## Requirements
1212
* Ruby 2.2.2 or higher
@@ -17,6 +17,13 @@ AIM, ARB, CIM, Reporting and SIM have all been deprecated in favor of AuthorizeN
1717
* RSpec 2.1 or higher (to run rspec tests)
1818
* An Authorize.Net account (see _Registration & Configuration_ section below)
1919

20+
### Migrating from older versions
21+
Since August 2018, the Authorize.Net API has been reorganized to be more merchant focused. AuthorizeNetAIM, AuthorizeNetARB, AuthorizeNetCIM, Reporting and AuthorizeNetSIM classes have all been deprecated in favor of AuthorizeNet::API. To see the full list of mapping of new features corresponding to the deprecated features, you can see [MIGRATING.md](MIGRATING.md).
22+
23+
### Contribution
24+
- If you need information or clarification about any Authorize.Net features, please create an issue for it. Also you can search in the [Authorize.Net developer community](https://community.developer.authorize.net/).
25+
- Before creating pull requests, please read [the contributors guide](CONTRIBUTING.md).
26+
2027
### TLS 1.2
2128
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. It's important to make sure you have new enough versions of all required components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in your system or any libraries it uses.
2229

@@ -119,4 +126,4 @@ This repository is distributed under a proprietary license. See the provided [`L
119126
[coverage_badge]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/coverage.png?b=master
120127
[coverage]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master
121128
[scrutinizer_badge]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/quality-score.png?b=master
122-
[scrutinizer]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master
129+
[scrutinizer]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master

gemfiles/rails_42.gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "coveralls", require: false
65
gem "rails", "4.2.6"
76

87
gemspec path: "../"

gemfiles/rails_50.gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "coveralls", require: false
65
gem "rails", "~> 5.0", ">= 5.0.3"
76

87
gemspec path: "../"

gemfiles/rails_51.gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "coveralls", require: false
65
gem "rails", "~> 5.1", ">= 5.1.1"
76

87
gemspec path: "../"

0 commit comments

Comments
 (0)