Skip to content

Commit

Permalink
Mark XML stuff as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Jan 19, 2024
1 parent 844488e commit fa0cfa6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ transaction.merchant_authorize # this will charge the card without user interact
XML Transactions
================

XML API is [deprecated](https://mailchi.mp/datatrans/basic-authdynamic-sign_reminder) by Datatrans. After June 3rd, 2024 all merchants will have to use JSON API.
> [!IMPORTANT]
>
> Datatrans will stop supporting the XML API on June 3rd, 2024. The support in this gem will be removed in the next major release. Please use the [JSON API](#json-transactions) instead.
If you have already a credit card alias or an authorized transaction you can
use the convenient XML methods to process payments.
Expand Down
7 changes: 7 additions & 0 deletions lib/datatrans/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,22 @@ def url(what, options = {})
case what
when :web_authorize_url
warn "DEPRECATION WARNING: Support for the payment page is deprecated and will be removed in the next major version. Please use the JSON API instead."

subdomain = SUBDOMAINS[:payment_page]
path = "/upp/jsp/upStart.jsp"
when :xml_authorize_url
warn "DEPRECATION WARNING: Support for the XML API is deprecated and will be removed in the next major version. Please use the JSON API instead."

subdomain = SUBDOMAINS[:server_to_server_api]
path = "/upp/jsp/XML_authorize.jsp"
when :xml_settlement_url
warn "DEPRECATION WARNING: Support for the XML API is deprecated and will be removed in the next major version. Please use the JSON API instead."

subdomain = SUBDOMAINS[:server_to_server_api]
path = "/upp/jsp/XML_processor.jsp"
when :xml_status_url
warn "DEPRECATION WARNING: Support for the XML API is deprecated and will be removed in the next major version. Please use the JSON API instead."

subdomain = SUBDOMAINS[:server_to_server_api]
path = "/upp/jsp/XML_status.jsp"
when :init_transaction
Expand Down
2 changes: 2 additions & 0 deletions lib/datatrans/xml/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class Transaction
attr_reader :response, :params, :datatrans

def initialize(datatrans, params)
warn "DEPRECATION WARNING: Support for the XML API is deprecated and will be removed in the next major version. Please use the JSON API instead."

@datatrans = datatrans
@params = params.symbolize_keys
end
Expand Down
2 changes: 2 additions & 0 deletions lib/datatrans/xml/transaction/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def post(url, options = {})
end

def initialize(datatrans, params)
warn "DEPRECATION WARNING: Support for the XML API is deprecated and will be removed in the next major version. Please use the JSON API instead."

@datatrans = datatrans
@params = params
end
Expand Down
2 changes: 2 additions & 0 deletions lib/datatrans/xml/transaction/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ class Response
attr_reader :params, :datatrans

def initialize(datatrans, params)
warn "DEPRECATION WARNING: Support for the XML API is deprecated and will be removed in the next major version. Please use the JSON API instead."

@datatrans = datatrans
@params = params
end
Expand Down

0 comments on commit fa0cfa6

Please sign in to comment.