File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'dotenv/load'
4+ require 'nexmo'
5+
6+ NEXMO_API_KEY = ENV [ 'NEXMO_API_KEY' ]
7+ NEXMO_API_SECRET = ENV [ 'NEXMO_API_SECRET' ]
8+ TO_NUMBER = ENV [ 'TO_NUMBER' ]
9+
10+ client = Nexmo ::Client . new (
11+ api_key : NEXMO_API_KEY ,
12+ api_secret : NEXMO_API_SECRET
13+ )
14+
15+ response = client . verify . psd2 (
16+ number : TO_NUMBER ,
17+ payee : 'AcmeInc' ,
18+ amount : 12.34
19+ )
20+
21+ if response
22+ # display the Verify PSD2 `request_id`
23+ puts response . request_id
24+ end
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'dotenv/load'
4+ require 'nexmo'
5+
6+ NEXMO_API_KEY = ENV [ 'NEXMO_API_KEY' ]
7+ NEXMO_API_SECRET = ENV [ 'NEXMO_API_SECRET' ]
8+ TO_NUMBER = ENV [ 'TO_NUMBER' ]
9+
10+ WORKFLOW_ID = ARGV [ 0 ]
11+ if WORKFLOW_ID . empty?
12+ puts 'Please supply the workflow_id'
13+ exit
14+ end
15+
16+ client = Nexmo ::Client . new (
17+ api_key : NEXMO_API_KEY ,
18+ api_secret : NEXMO_API_SECRET
19+ )
20+
21+ response = client . verify . psd2 (
22+ number : TO_NUMBER ,
23+ payee : 'AcmeInc' ,
24+ amount : 12.34 ,
25+ workflow_id : WORKFLOW_ID
26+ )
27+
28+ if response
29+ # display the Verify PSD2 `request_id`
30+ puts response . request_id
31+ end
You can’t perform that action at this time.
0 commit comments