diff --git a/Gemfile.lock b/Gemfile.lock index f80b114..2bba06a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - zai_payment (2.8.5) + zai_payment (2.8.6) base64 (~> 0.3.0) faraday (~> 2.0) openssl (~> 3.3) diff --git a/changelog.md b/changelog.md index 133cf41..b488225 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,17 @@ ## [Released] +## [2.8.6] - 2025-12-12 + +### Fixed +- **Production API Endpoints**: Fixed incorrect production URL configuration 🔧 + - Corrected `core_base` endpoint to use `https://secure.api.promisepay.com` (was incorrectly set to assemblypay.com) + - Corrected `va_base` endpoint to use `https://au-0000.api.assemblypay.com` (was incorrectly set to promisepay.com) + - Removed deprecated `webhook_base_endpoint` method from Config class + - Production environment now uses correct endpoints for core API and virtual accounts + - Ensures proper routing of production API requests to Zai servers + +**Full Changelog**: https://github.com/Sentia/zai-payment/compare/v2.8.5...v2.8.6 + ## [2.8.5] - 2025-12-12 ### Fixed diff --git a/lib/zai_payment.rb b/lib/zai_payment.rb index d2fd483..40a5529 100644 --- a/lib/zai_payment.rb +++ b/lib/zai_payment.rb @@ -46,7 +46,7 @@ def token_type = auth.token_type # --- Resource accessors --- # @return [ZaiPayment::Resources::Webhook] webhook resource instance def webhooks - @webhooks ||= Resources::Webhook.new(client: Client.new(base_endpoint: config.webhook_base_endpoint)) + @webhooks ||= Resources::Webhook.new(client: Client.new(base_endpoint: :va_base)) end # @return [ZaiPayment::Resources::User] user resource instance diff --git a/lib/zai_payment/config.rb b/lib/zai_payment/config.rb index 6efad42..1db26fa 100644 --- a/lib/zai_payment/config.rb +++ b/lib/zai_payment/config.rb @@ -31,26 +31,13 @@ def endpoints } when :production { - core_base: 'https://au-0000.api.assemblypay.com', - va_base: 'https://secure.api.promisepay.com', + core_base: 'https://secure.api.promisepay.com', + va_base: 'https://au-0000.api.assemblypay.com', auth_base: 'https://au-0000.auth.assemblypay.com' } else raise "Unknown environment: #{environment}" end end - - # Returns the appropriate webhook base endpoint based on environment - # Production uses core_base, prelive uses va_base - def webhook_base_endpoint - case environment.to_sym - when :production - :core_base - when :prelive - :va_base - else - raise "Unknown environment: #{environment}" - end - end end end diff --git a/lib/zai_payment/version.rb b/lib/zai_payment/version.rb index 52611f7..8caa5ed 100644 --- a/lib/zai_payment/version.rb +++ b/lib/zai_payment/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ZaiPayment - VERSION = '2.8.5' + VERSION = '2.8.6' end diff --git a/spec/zai_payment/config_spec.rb b/spec/zai_payment/config_spec.rb index e32d629..091b2c4 100644 --- a/spec/zai_payment/config_spec.rb +++ b/spec/zai_payment/config_spec.rb @@ -157,8 +157,8 @@ it 'returns production endpoints' do expect(config.endpoints).to eq( - core_base: 'https://au-0000.api.assemblypay.com', - va_base: 'https://secure.api.promisepay.com', + core_base: 'https://secure.api.promisepay.com', + va_base: 'https://au-0000.api.assemblypay.com', auth_base: 'https://au-0000.auth.assemblypay.com' ) end @@ -169,8 +169,8 @@ it 'returns production endpoints' do expect(config.endpoints).to eq( - core_base: 'https://au-0000.api.assemblypay.com', - va_base: 'https://secure.api.promisepay.com', + core_base: 'https://secure.api.promisepay.com', + va_base: 'https://au-0000.api.assemblypay.com', auth_base: 'https://au-0000.auth.assemblypay.com' ) end