dk_payment_gateway 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +8 -4
- data/EXAMPLES.md +44 -45
- data/Gemfile +7 -7
- data/Gemfile.lock +100 -0
- data/INSTALLATION.md +1 -1
- data/QUICK_START.md +2 -3
- data/README.md +1 -2
- data/dk_payment_gateway.gemspec +21 -20
- data/examples/README.md +15 -2
- data/examples/generate_qr.rb +1 -1
- data/examples/intra_transfer.rb +1 -1
- data/examples/simple_payment.rb +2 -2
- data/lib/dk_payment_gateway/authentication.rb +38 -39
- data/lib/dk_payment_gateway/client.rb +25 -26
- data/lib/dk_payment_gateway/configuration.rb +2 -0
- data/lib/dk_payment_gateway/errors.rb +1 -2
- data/lib/dk_payment_gateway/intra_transaction.rb +32 -33
- data/lib/dk_payment_gateway/pull_payment.rb +37 -38
- data/lib/dk_payment_gateway/qr_payment.rb +26 -27
- data/lib/dk_payment_gateway/signature.rb +16 -17
- data/lib/dk_payment_gateway/transaction_status.rb +33 -34
- data/lib/dk_payment_gateway/utils.rb +32 -33
- data/lib/dk_payment_gateway/version.rb +1 -1
- metadata +22 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 870dfb0045a54e93075e048fdfc328e54e4386bba4c159feae71df0f0deea86a
|
|
4
|
+
data.tar.gz: d9d0b197757af3f2e6317b2ad888c0dad06870d093b1a07fe624c742970855f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a72ab18fa11e482260d218100febc0f3a91c9e6b28e802e957ccd1b2c1fea7d089e779c2182f0ef233a5adde60cef200d118b29c4f24863dea5a2e12a8d5ce0
|
|
7
|
+
data.tar.gz: d4770b2f045bfc9947b713940f104dd2c0b6011c1f052ca5156af868d55250c8d24d07229464860bd03b2b7ddb9f47a02a733d08094f8f74d09cab53eb891c15
|
data/DEVELOPMENT.md
CHANGED
|
@@ -90,7 +90,7 @@ bundle exec rubocop -a
|
|
|
90
90
|
Create a `.env.test` file:
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
DK_BASE_URL=
|
|
93
|
+
DK_BASE_URL=https://internal-gateway.uat.digitalkidu.bt/api/dkpg
|
|
94
94
|
DK_API_KEY=your_test_api_key
|
|
95
95
|
DK_USERNAME=your_test_username
|
|
96
96
|
DK_PASSWORD=your_test_password
|
|
@@ -206,7 +206,7 @@ def sign_request(request_body, timestamp, nonce)
|
|
|
206
206
|
puts "Request Body: #{request_body.inspect}"
|
|
207
207
|
puts "Timestamp: #{timestamp}"
|
|
208
208
|
puts "Nonce: #{nonce}"
|
|
209
|
-
|
|
209
|
+
|
|
210
210
|
# ... rest of method
|
|
211
211
|
end
|
|
212
212
|
```
|
|
@@ -252,11 +252,13 @@ gem push dk_payment_gateway-0.1.0.gem
|
|
|
252
252
|
### Issue: Authentication Fails
|
|
253
253
|
|
|
254
254
|
**Check:**
|
|
255
|
+
|
|
255
256
|
- Credentials are correct
|
|
256
257
|
- API key is valid
|
|
257
258
|
- Network connectivity to API endpoint
|
|
258
259
|
|
|
259
260
|
**Debug:**
|
|
261
|
+
|
|
260
262
|
```ruby
|
|
261
263
|
begin
|
|
262
264
|
client.authenticate!
|
|
@@ -269,11 +271,13 @@ end
|
|
|
269
271
|
### Issue: Signature Validation Fails
|
|
270
272
|
|
|
271
273
|
**Check:**
|
|
274
|
+
|
|
272
275
|
- Private key is correctly fetched
|
|
273
276
|
- Request body is properly serialized
|
|
274
277
|
- Timestamp is in correct format
|
|
275
278
|
|
|
276
279
|
**Debug:**
|
|
280
|
+
|
|
277
281
|
```ruby
|
|
278
282
|
# Enable signature debugging
|
|
279
283
|
signature = DkPaymentGateway::Signature.new(private_key)
|
|
@@ -338,7 +342,7 @@ RSpec.describe "Payment" do
|
|
|
338
342
|
stub_request(:post, /.*\/v1\/account_auth\/pull-payment/)
|
|
339
343
|
.to_return(status: 200, body: mock_response.to_json)
|
|
340
344
|
end
|
|
341
|
-
|
|
345
|
+
|
|
342
346
|
it "processes payment" do
|
|
343
347
|
# Test implementation
|
|
344
348
|
end
|
|
@@ -374,7 +378,7 @@ Use environment variables for sensitive data:
|
|
|
374
378
|
## Support
|
|
375
379
|
|
|
376
380
|
For development questions or issues:
|
|
381
|
+
|
|
377
382
|
- Check existing issues on GitHub
|
|
378
383
|
- Review documentation
|
|
379
384
|
- Contact the development team
|
|
380
|
-
|
data/EXAMPLES.md
CHANGED
|
@@ -19,7 +19,7 @@ This document provides comprehensive examples for all API operations supported b
|
|
|
19
19
|
require 'dk_payment_gateway'
|
|
20
20
|
|
|
21
21
|
DkPaymentGateway.configure do |config|
|
|
22
|
-
config.base_url = "
|
|
22
|
+
config.base_url = "https://internal-gateway.uat.digitalkidu.bt/api/dkpg"
|
|
23
23
|
config.api_key = "98cf3639-df33-4587-9d36-dae9d2bb974c"
|
|
24
24
|
config.username = "your_username"
|
|
25
25
|
config.password = "your_password"
|
|
@@ -46,7 +46,7 @@ client.authenticate!
|
|
|
46
46
|
# export DK_CLIENT_SECRET="your_client_secret"
|
|
47
47
|
|
|
48
48
|
DkPaymentGateway.configure do |config|
|
|
49
|
-
config.base_url = ENV['DK_BASE_URL'] || "
|
|
49
|
+
config.base_url = ENV['DK_BASE_URL'] || "https://internal-gateway.uat.digitalkidu.bt/api/dkpg"
|
|
50
50
|
config.api_key = ENV['DK_API_KEY']
|
|
51
51
|
config.username = ENV['DK_USERNAME']
|
|
52
52
|
config.password = ENV['DK_PASSWORD']
|
|
@@ -82,18 +82,18 @@ begin
|
|
|
82
82
|
remitter_account_name: "Customer Name",
|
|
83
83
|
remitter_bank_id: "1040"
|
|
84
84
|
)
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
puts "Authorization successful!"
|
|
87
87
|
puts "Transaction ID: #{auth_response['bfs_txn_id']}"
|
|
88
88
|
puts "STAN: #{auth_response['stan_number']}"
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
# Store the transaction ID for the debit request
|
|
91
91
|
bfs_txn_id = auth_response['bfs_txn_id']
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
# Step 3: Customer receives OTP and provides it
|
|
94
94
|
# In a real application, you would collect this from the user
|
|
95
95
|
otp = "123456" # Customer's OTP
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
# Step 4: Complete the payment with OTP
|
|
98
98
|
debit_response = client.pull_payment.debit(
|
|
99
99
|
request_id: "REQ_#{Time.now.to_i}_#{SecureRandom.hex(4)}",
|
|
@@ -101,7 +101,7 @@ begin
|
|
|
101
101
|
bfs_remitter_otp: otp,
|
|
102
102
|
bfs_order_no: "ORD123456"
|
|
103
103
|
)
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
if debit_response['code'] == '00'
|
|
106
106
|
puts "Payment completed successfully!"
|
|
107
107
|
puts "Transaction ID: #{debit_response['bfs_txn_id']}"
|
|
@@ -109,7 +109,7 @@ begin
|
|
|
109
109
|
else
|
|
110
110
|
puts "Payment failed: #{debit_response['description']}"
|
|
111
111
|
end
|
|
112
|
-
|
|
112
|
+
|
|
113
113
|
rescue DkPaymentGateway::TransactionError => e
|
|
114
114
|
puts "Transaction error: #{e.message}"
|
|
115
115
|
puts "Error code: #{e.response_code}"
|
|
@@ -148,14 +148,14 @@ begin
|
|
|
148
148
|
source_account_name: "Rinzin Jamtsho",
|
|
149
149
|
source_account_number: "100100365856"
|
|
150
150
|
)
|
|
151
|
-
|
|
151
|
+
|
|
152
152
|
puts "Account inquiry successful!"
|
|
153
153
|
puts "Inquiry ID: #{inquiry_response['inquiry_id']}"
|
|
154
154
|
puts "Beneficiary Name: #{inquiry_response['account_name']}"
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
# Step 2: Proceed with fund transfer
|
|
157
157
|
inquiry_id = inquiry_response['inquiry_id']
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
transfer_response = client.intra_transaction.fund_transfer(
|
|
160
160
|
request_id: "TXN_#{Time.now.to_i}_#{SecureRandom.hex(4)}",
|
|
161
161
|
inquiry_id: inquiry_id,
|
|
@@ -170,10 +170,10 @@ begin
|
|
|
170
170
|
bene_bank_code: "1060",
|
|
171
171
|
narration: "Salary payment for October 2025"
|
|
172
172
|
)
|
|
173
|
-
|
|
173
|
+
|
|
174
174
|
puts "Transfer initiated successfully!"
|
|
175
175
|
puts "Transaction Status ID: #{transfer_response['txn_status_id']}"
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
rescue DkPaymentGateway::TransactionError => e
|
|
178
178
|
puts "Transfer failed: #{e.message}"
|
|
179
179
|
puts "Error code: #{e.response_code}"
|
|
@@ -203,7 +203,7 @@ transfers.each do |transfer|
|
|
|
203
203
|
bene_account_number: transfer[:account],
|
|
204
204
|
source_account_number: "100100365856"
|
|
205
205
|
)
|
|
206
|
-
|
|
206
|
+
|
|
207
207
|
# Step 2: Fund transfer
|
|
208
208
|
result = client.intra_transaction.fund_transfer(
|
|
209
209
|
request_id: "TXN_#{Time.now.to_i}_#{SecureRandom.hex(4)}",
|
|
@@ -218,15 +218,15 @@ transfers.each do |transfer|
|
|
|
218
218
|
bene_bank_code: "1060",
|
|
219
219
|
narration: transfer[:narration]
|
|
220
220
|
)
|
|
221
|
-
|
|
221
|
+
|
|
222
222
|
results << { account: transfer[:account], status: "success", txn_id: result['txn_status_id'] }
|
|
223
223
|
puts "✓ Transfer to #{transfer[:account]}: Success"
|
|
224
|
-
|
|
224
|
+
|
|
225
225
|
rescue DkPaymentGateway::Error => e
|
|
226
226
|
results << { account: transfer[:account], status: "failed", error: e.message }
|
|
227
227
|
puts "✗ Transfer to #{transfer[:account]}: Failed - #{e.message}"
|
|
228
228
|
end
|
|
229
|
-
|
|
229
|
+
|
|
230
230
|
# Add delay between requests to avoid rate limiting
|
|
231
231
|
sleep 1
|
|
232
232
|
end
|
|
@@ -251,12 +251,12 @@ begin
|
|
|
251
251
|
mcc_code: "5411", # Grocery store
|
|
252
252
|
remarks: "Payment to Merchant Store"
|
|
253
253
|
)
|
|
254
|
-
|
|
254
|
+
|
|
255
255
|
# Save QR code image
|
|
256
256
|
filename = "static_qr_#{Time.now.to_i}.png"
|
|
257
257
|
client.qr_payment.save_qr_image(qr_response['image'], filename)
|
|
258
258
|
puts "Static QR code saved to #{filename}"
|
|
259
|
-
|
|
259
|
+
|
|
260
260
|
rescue DkPaymentGateway::Error => e
|
|
261
261
|
puts "QR generation failed: #{e.message}"
|
|
262
262
|
end
|
|
@@ -275,13 +275,13 @@ begin
|
|
|
275
275
|
mcc_code: "5812", # Restaurant
|
|
276
276
|
remarks: "Invoice #INV-2025-001"
|
|
277
277
|
)
|
|
278
|
-
|
|
278
|
+
|
|
279
279
|
# Save QR code image
|
|
280
280
|
filename = "invoice_qr_#{Time.now.to_i}.png"
|
|
281
281
|
client.qr_payment.save_qr_image(qr_response['image'], filename)
|
|
282
282
|
puts "Dynamic QR code saved to #{filename}"
|
|
283
283
|
puts "Amount: BTN 250.50"
|
|
284
|
-
|
|
284
|
+
|
|
285
285
|
rescue DkPaymentGateway::Error => e
|
|
286
286
|
puts "QR generation failed: #{e.message}"
|
|
287
287
|
end
|
|
@@ -298,14 +298,14 @@ begin
|
|
|
298
298
|
transaction_id: "test_txn_update23567",
|
|
299
299
|
bene_account_number: "100100365856"
|
|
300
300
|
)
|
|
301
|
-
|
|
301
|
+
|
|
302
302
|
puts "Transaction Status:"
|
|
303
303
|
puts "Status: #{status['status']['status_desc']}"
|
|
304
304
|
puts "Amount: BTN #{status['status']['amount']}"
|
|
305
305
|
puts "Timestamp: #{status['status']['txn_ts']}"
|
|
306
306
|
puts "Debit Account: #{status['status']['debit_account']}"
|
|
307
307
|
puts "Credit Account: #{status['status']['credit_account']}"
|
|
308
|
-
|
|
308
|
+
|
|
309
309
|
rescue DkPaymentGateway::TransactionError => e
|
|
310
310
|
puts "Status check failed: #{e.message}"
|
|
311
311
|
end
|
|
@@ -321,7 +321,7 @@ begin
|
|
|
321
321
|
transaction_date: "2025-09-18",
|
|
322
322
|
bene_account_number: "100100365856"
|
|
323
323
|
)
|
|
324
|
-
|
|
324
|
+
|
|
325
325
|
if status.is_a?(Array)
|
|
326
326
|
status.each do |txn|
|
|
327
327
|
puts "Transaction found:"
|
|
@@ -330,7 +330,7 @@ begin
|
|
|
330
330
|
puts " Date: #{txn['txn_ts']}"
|
|
331
331
|
end
|
|
332
332
|
end
|
|
333
|
-
|
|
333
|
+
|
|
334
334
|
rescue DkPaymentGateway::TransactionError => e
|
|
335
335
|
puts "Status check failed: #{e.message}"
|
|
336
336
|
end
|
|
@@ -346,11 +346,11 @@ class PaymentProcessor
|
|
|
346
346
|
@client = DkPaymentGateway.client
|
|
347
347
|
@client.authenticate!
|
|
348
348
|
end
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
def process_order_payment(order)
|
|
351
351
|
# Step 1: Initiate payment authorization
|
|
352
352
|
stan = DkPaymentGateway::PullPayment.generate_stan("0201")
|
|
353
|
-
|
|
353
|
+
|
|
354
354
|
auth_response = @client.pull_payment.authorize(
|
|
355
355
|
transaction_datetime: Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
356
356
|
stan_number: stan,
|
|
@@ -365,14 +365,14 @@ class PaymentProcessor
|
|
|
365
365
|
remitter_account_name: order[:customer_name],
|
|
366
366
|
remitter_bank_id: order[:customer_bank_id]
|
|
367
367
|
)
|
|
368
|
-
|
|
368
|
+
|
|
369
369
|
# Store transaction ID
|
|
370
370
|
order[:bfs_txn_id] = auth_response['bfs_txn_id']
|
|
371
|
-
|
|
371
|
+
|
|
372
372
|
# Return transaction ID to customer for OTP entry
|
|
373
373
|
auth_response
|
|
374
374
|
end
|
|
375
|
-
|
|
375
|
+
|
|
376
376
|
def complete_payment(order, otp)
|
|
377
377
|
debit_response = @client.pull_payment.debit(
|
|
378
378
|
request_id: "ORD_#{order[:order_id]}_#{Time.now.to_i}",
|
|
@@ -380,7 +380,7 @@ class PaymentProcessor
|
|
|
380
380
|
bfs_remitter_otp: otp,
|
|
381
381
|
bfs_order_no: order[:order_id]
|
|
382
382
|
)
|
|
383
|
-
|
|
383
|
+
|
|
384
384
|
if debit_response['code'] == '00'
|
|
385
385
|
# Payment successful - update order status
|
|
386
386
|
update_order_status(order[:order_id], 'paid')
|
|
@@ -392,26 +392,26 @@ class PaymentProcessor
|
|
|
392
392
|
false
|
|
393
393
|
end
|
|
394
394
|
end
|
|
395
|
-
|
|
395
|
+
|
|
396
396
|
private
|
|
397
|
-
|
|
397
|
+
|
|
398
398
|
def calculate_fee(amount)
|
|
399
399
|
# Example fee calculation
|
|
400
400
|
[amount * 0.01, 5.0].max # 1% with minimum 5 BTN
|
|
401
401
|
end
|
|
402
|
-
|
|
402
|
+
|
|
403
403
|
def merchant_account
|
|
404
404
|
"110158212197"
|
|
405
405
|
end
|
|
406
|
-
|
|
406
|
+
|
|
407
407
|
def merchant_name
|
|
408
408
|
"My E-commerce Store"
|
|
409
409
|
end
|
|
410
|
-
|
|
410
|
+
|
|
411
411
|
def update_order_status(order_id, status)
|
|
412
412
|
# Update in database
|
|
413
413
|
end
|
|
414
|
-
|
|
414
|
+
|
|
415
415
|
def send_confirmation_email(order)
|
|
416
416
|
# Send email
|
|
417
417
|
end
|
|
@@ -451,22 +451,22 @@ end
|
|
|
451
451
|
def safe_payment_operation
|
|
452
452
|
client = DkPaymentGateway.client
|
|
453
453
|
client.authenticate!
|
|
454
|
-
|
|
454
|
+
|
|
455
455
|
# Your payment logic here
|
|
456
|
-
|
|
456
|
+
|
|
457
457
|
rescue DkPaymentGateway::ConfigurationError => e
|
|
458
458
|
log_error("Configuration issue", e)
|
|
459
459
|
notify_admin("Payment gateway configuration error: #{e.message}")
|
|
460
|
-
|
|
460
|
+
|
|
461
461
|
rescue DkPaymentGateway::AuthenticationError => e
|
|
462
462
|
log_error("Authentication failed", e)
|
|
463
463
|
# Retry authentication or notify admin
|
|
464
|
-
|
|
464
|
+
|
|
465
465
|
rescue DkPaymentGateway::InvalidParameterError => e
|
|
466
466
|
log_error("Invalid parameters", e)
|
|
467
467
|
# Return user-friendly error message
|
|
468
468
|
{ error: "Invalid payment details", details: e.response_detail }
|
|
469
|
-
|
|
469
|
+
|
|
470
470
|
rescue DkPaymentGateway::TransactionError => e
|
|
471
471
|
log_error("Transaction failed", e)
|
|
472
472
|
# Handle based on error code
|
|
@@ -478,14 +478,13 @@ rescue DkPaymentGateway::TransactionError => e
|
|
|
478
478
|
else
|
|
479
479
|
{ error: "Transaction failed", code: e.response_code }
|
|
480
480
|
end
|
|
481
|
-
|
|
481
|
+
|
|
482
482
|
rescue DkPaymentGateway::NetworkError => e
|
|
483
483
|
log_error("Network error", e)
|
|
484
484
|
# Retry logic or queue for later
|
|
485
|
-
|
|
485
|
+
|
|
486
486
|
rescue DkPaymentGateway::Error => e
|
|
487
487
|
log_error("General payment gateway error", e)
|
|
488
488
|
{ error: "Payment processing error" }
|
|
489
489
|
end
|
|
490
490
|
```
|
|
491
|
-
|
data/Gemfile
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
source
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
5
|
# Specify your gem's dependencies in dk_payment_gateway.gemspec
|
|
6
6
|
gemspec
|
|
7
7
|
|
|
8
|
-
gem
|
|
9
|
-
gem
|
|
10
|
-
gem
|
|
11
|
-
gem
|
|
12
|
-
gem
|
|
13
|
-
|
|
8
|
+
gem 'dotenv', '>= 3.1.8'
|
|
9
|
+
gem 'rake', '~> 13.0'
|
|
10
|
+
gem 'rspec', '~> 3.0'
|
|
11
|
+
gem 'rubocop', '~> 1.21'
|
|
12
|
+
gem 'vcr', '~> 6.1'
|
|
13
|
+
gem 'webmock', '~> 3.18'
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
dk_payment_gateway (1.0.1)
|
|
5
|
+
faraday (~> 2.0)
|
|
6
|
+
jwt (~> 2.7)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
addressable (2.8.7)
|
|
12
|
+
public_suffix (>= 2.0.2, < 7.0)
|
|
13
|
+
ast (2.4.3)
|
|
14
|
+
base64 (0.3.0)
|
|
15
|
+
bigdecimal (3.3.1)
|
|
16
|
+
crack (1.0.1)
|
|
17
|
+
bigdecimal
|
|
18
|
+
rexml
|
|
19
|
+
diff-lcs (1.6.2)
|
|
20
|
+
dotenv (3.1.8)
|
|
21
|
+
faraday (2.14.0)
|
|
22
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
23
|
+
json
|
|
24
|
+
logger
|
|
25
|
+
faraday-net_http (3.4.1)
|
|
26
|
+
net-http (>= 0.5.0)
|
|
27
|
+
hashdiff (1.2.1)
|
|
28
|
+
json (2.15.2)
|
|
29
|
+
jwt (2.10.2)
|
|
30
|
+
base64
|
|
31
|
+
language_server-protocol (3.17.0.5)
|
|
32
|
+
lint_roller (1.1.0)
|
|
33
|
+
logger (1.7.0)
|
|
34
|
+
net-http (0.7.0)
|
|
35
|
+
uri
|
|
36
|
+
parallel (1.27.0)
|
|
37
|
+
parser (3.3.10.0)
|
|
38
|
+
ast (~> 2.4.1)
|
|
39
|
+
racc
|
|
40
|
+
prism (1.6.0)
|
|
41
|
+
public_suffix (6.0.2)
|
|
42
|
+
racc (1.8.1)
|
|
43
|
+
rainbow (3.1.1)
|
|
44
|
+
rake (13.3.1)
|
|
45
|
+
regexp_parser (2.11.3)
|
|
46
|
+
rexml (3.4.4)
|
|
47
|
+
rspec (3.13.2)
|
|
48
|
+
rspec-core (~> 3.13.0)
|
|
49
|
+
rspec-expectations (~> 3.13.0)
|
|
50
|
+
rspec-mocks (~> 3.13.0)
|
|
51
|
+
rspec-core (3.13.6)
|
|
52
|
+
rspec-support (~> 3.13.0)
|
|
53
|
+
rspec-expectations (3.13.5)
|
|
54
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
55
|
+
rspec-support (~> 3.13.0)
|
|
56
|
+
rspec-mocks (3.13.6)
|
|
57
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
58
|
+
rspec-support (~> 3.13.0)
|
|
59
|
+
rspec-support (3.13.6)
|
|
60
|
+
rubocop (1.81.7)
|
|
61
|
+
json (~> 2.3)
|
|
62
|
+
language_server-protocol (~> 3.17.0.2)
|
|
63
|
+
lint_roller (~> 1.1.0)
|
|
64
|
+
parallel (~> 1.10)
|
|
65
|
+
parser (>= 3.3.0.2)
|
|
66
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
67
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
68
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
69
|
+
ruby-progressbar (~> 1.7)
|
|
70
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
71
|
+
rubocop-ast (1.47.1)
|
|
72
|
+
parser (>= 3.3.7.2)
|
|
73
|
+
prism (~> 1.4)
|
|
74
|
+
ruby-progressbar (1.13.0)
|
|
75
|
+
unicode-display_width (3.2.0)
|
|
76
|
+
unicode-emoji (~> 4.1)
|
|
77
|
+
unicode-emoji (4.1.0)
|
|
78
|
+
uri (1.1.0)
|
|
79
|
+
vcr (6.3.1)
|
|
80
|
+
base64
|
|
81
|
+
webmock (3.26.1)
|
|
82
|
+
addressable (>= 2.8.0)
|
|
83
|
+
crack (>= 0.3.2)
|
|
84
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
85
|
+
|
|
86
|
+
PLATFORMS
|
|
87
|
+
arm64-darwin-24
|
|
88
|
+
ruby
|
|
89
|
+
|
|
90
|
+
DEPENDENCIES
|
|
91
|
+
dk_payment_gateway!
|
|
92
|
+
dotenv (>= 3.1.8)
|
|
93
|
+
rake (~> 13.0)
|
|
94
|
+
rspec (~> 3.0)
|
|
95
|
+
rubocop (~> 1.21)
|
|
96
|
+
vcr (~> 6.1)
|
|
97
|
+
webmock (~> 3.18)
|
|
98
|
+
|
|
99
|
+
BUNDLED WITH
|
|
100
|
+
2.7.2
|
data/INSTALLATION.md
CHANGED
|
@@ -426,7 +426,7 @@ end
|
|
|
426
426
|
```ruby
|
|
427
427
|
# config/environments/development.rb
|
|
428
428
|
DkPaymentGateway.configure do |config|
|
|
429
|
-
config.base_url = "
|
|
429
|
+
config.base_url = "https://internal-gateway.uat.digitalkidu.bt/api/dkpg"
|
|
430
430
|
# ... UAT credentials
|
|
431
431
|
end
|
|
432
432
|
```
|
data/QUICK_START.md
CHANGED
|
@@ -21,7 +21,7 @@ require 'dk_payment_gateway'
|
|
|
21
21
|
|
|
22
22
|
# Configure
|
|
23
23
|
DkPaymentGateway.configure do |config|
|
|
24
|
-
config.base_url = "
|
|
24
|
+
config.base_url = "https://internal-gateway.uat.digitalkidu.bt/api/dkpg"
|
|
25
25
|
config.api_key = "your_api_key"
|
|
26
26
|
config.username = "your_username"
|
|
27
27
|
config.password = "your_password"
|
|
@@ -149,7 +149,7 @@ end
|
|
|
149
149
|
Create a `.env` file:
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
|
-
DK_BASE_URL=
|
|
152
|
+
DK_BASE_URL=https://internal-gateway.uat.digitalkidu.bt/api/dkpg
|
|
153
153
|
DK_API_KEY=your_api_key
|
|
154
154
|
DK_USERNAME=your_username
|
|
155
155
|
DK_PASSWORD=your_password
|
|
@@ -183,4 +183,3 @@ end
|
|
|
183
183
|
## Support
|
|
184
184
|
|
|
185
185
|
For issues and questions, please refer to the documentation or contact support.
|
|
186
|
-
|
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Configure the gem with your API credentials:
|
|
|
33
33
|
|
|
34
34
|
```ruby
|
|
35
35
|
DkPaymentGateway.configure do |config|
|
|
36
|
-
config.base_url = "
|
|
36
|
+
config.base_url = "https://internal-gateway.uat.digitalkidu.bt/api/dkpg"
|
|
37
37
|
config.api_key = "98cf3639-df33-4587-9d36-dae9d2bb974c"
|
|
38
38
|
config.username = "your_username"
|
|
39
39
|
config.password = "your_password"
|
|
@@ -293,4 +293,3 @@ Bug reports and pull requests are welcome on GitHub.
|
|
|
293
293
|
## License
|
|
294
294
|
|
|
295
295
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
296
|
-
|
data/dk_payment_gateway.gemspec
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
3
|
+
require_relative 'lib/dk_payment_gateway/version'
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name =
|
|
6
|
+
spec.name = 'dk_payment_gateway'
|
|
7
7
|
spec.version = DkPaymentGateway::VERSION
|
|
8
|
-
spec.authors = [
|
|
9
|
-
spec.email = [
|
|
8
|
+
spec.authors = ['Tashi Dendup']
|
|
9
|
+
spec.email = ['tashii.dendupp@gmail.com']
|
|
10
10
|
|
|
11
|
-
spec.summary =
|
|
12
|
-
spec.description =
|
|
13
|
-
spec.homepage =
|
|
14
|
-
spec.license =
|
|
15
|
-
spec.required_ruby_version =
|
|
11
|
+
spec.summary = 'Ruby client for DK Payment Gateway API'
|
|
12
|
+
spec.description = 'A Ruby gem for integrating with Digital Kidu Payment Gateway API, supporting pull payments, intra-bank transactions, QR generation, and transaction status verification.'
|
|
13
|
+
spec.homepage = 'https://github.com/dcplbt/dk_payment_gateway'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
spec.required_ruby_version = '>= 2.7.0'
|
|
16
16
|
|
|
17
|
-
spec.metadata[
|
|
18
|
-
spec.metadata[
|
|
19
|
-
spec.metadata[
|
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
18
|
+
spec.metadata['source_code_uri'] = 'https://github.com/dcplbt/dk_payment_gateway'
|
|
19
|
+
spec.metadata['changelog_uri'] = 'https://github.com/dcplbt/dk_payment_gateway/blob/main/CHANGELOG.md'
|
|
20
20
|
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
|
22
22
|
spec.files = Dir.chdir(__dir__) do
|
|
@@ -24,17 +24,18 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
|
-
spec.bindir =
|
|
27
|
+
spec.bindir = 'exe'
|
|
28
28
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
29
|
-
spec.require_paths = [
|
|
29
|
+
spec.require_paths = ['lib']
|
|
30
30
|
|
|
31
31
|
# Runtime dependencies
|
|
32
|
-
spec.add_dependency
|
|
33
|
-
spec.add_dependency
|
|
32
|
+
spec.add_dependency 'faraday', '~> 2.0'
|
|
33
|
+
spec.add_dependency 'jwt', '~> 2.7'
|
|
34
34
|
|
|
35
35
|
# Development dependencies
|
|
36
|
-
spec.add_development_dependency
|
|
37
|
-
spec.add_development_dependency
|
|
38
|
-
spec.add_development_dependency
|
|
39
|
-
spec.add_development_dependency
|
|
36
|
+
spec.add_development_dependency 'dotenv', '>= 3.1.8'
|
|
37
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
38
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
39
|
+
spec.add_development_dependency 'vcr', '~> 6.1'
|
|
40
|
+
spec.add_development_dependency 'webmock', '~> 3.18'
|
|
40
41
|
end
|