Class: WorldpayCnp::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/worldpay_cnp/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ WorldpayCnp::Client

Initializes a new Client object

Parameters:

  • options (Hash)


10
11
12
# File 'lib/worldpay_cnp/client.rb', line 10

def initialize(**options)
  @config = Configuration.new(**options)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/worldpay_cnp/client.rb', line 4

def config
  @config
end

Instance Method Details

#create_transaction(data) ⇒ Object



14
15
16
# File 'lib/worldpay_cnp/client.rb', line 14

def create_transaction(data)
  api_client.perform_post(@config.api_url, build_request_body(data))
end