|
| 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 | +``` |
0 commit comments