Skip to content

Commit 65281d5

Browse files
Upadted README.md, added CONTRIBUTING.md and MIGRATING.md
1 parent 0fc4bdc commit 65281d5

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

CONTRIBUTING.md

+9
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 files inside[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.

MIGRATING.md

+51
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-dotnet. 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-csharp/PaymentTransactions](https://github.com/AuthorizeNet/sample-code-csharp/tree/master/PaymentTransactions) |
11+
| ARB (Authorize.NET/ARB) | [RecurringBilling](https://developer.authorize.net/api/reference/index.html#recurring-billing) | [sample-code-csharp/Recurring Billing](https://github.com/AuthorizeNet/sample-code-csharp/tree/master/RecurringBilling) |
12+
| CIM (Authorize.NET/CIM) | [CustomerProfiles](https://developer.authorize.net/api/reference/index.html#customer-profiles) | [sample-code-csharp/CustomerProfiles](https://github.com/AuthorizeNet/sample-code-csharp/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 Accept Application](https://github.com/AuthorizeNet/accept-sample-app) |
15+
16+
## Example
17+
#### Corresponding new model code (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","[email protected]",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

+7
Original file line numberDiff line numberDiff line change
@@ -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 `sdk-ruby/lib/authorize_net/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

0 commit comments

Comments
 (0)