Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/zai_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 2 additions & 15 deletions lib/zai_payment/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/zai_payment/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ZaiPayment
VERSION = '2.8.5'
VERSION = '2.8.6'
end
8 changes: 4 additions & 4 deletions spec/zai_payment/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down