Class: Ingenico::Connect::SDK::Merchant::Payments::PaymentsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Ingenico::Connect::SDK::Merchant::Payments::PaymentsClient
- Defined in:
- lib/ingenico/connect/sdk/merchant/payments/payments_client.rb
Overview
Payments client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#approve(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::PaymentApprovalResponse
Resource /{merchantId}/payments/{paymentId}/approve - Approve payment.
-
#cancel(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CancelPaymentResponse
Resource /{merchantId}/payments/{paymentId}/cancel - Cancel payment.
-
#cancelapproval(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CancelApprovalPaymentResponse
Resource /{merchantId}/payments/{paymentId}/cancelapproval - Undo capture payment.
-
#capture(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Capture::CaptureResponse
Resource /{merchantId}/payments/{paymentId}/capture - Capture payment.
-
#captures(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Capture::CapturesResponse
Resource /{merchantId}/payments/{paymentId}/captures - Get captures of payment.
-
#complete(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CompletePaymentResponse
Resource /{merchantId}/payments/{paymentId}/complete - Complete payment.
-
#create(body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CreatePaymentResponse
Resource /{merchantId}/payments - Create payment.
-
#devicefingerprint(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::DeviceFingerprintDetails
Resource /{merchantId}/payments/{paymentId}/devicefingerprint - Get Device Fingerprint details.
-
#dispute(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse
Resource /{merchantId}/payments/{paymentId}/dispute - Create dispute.
-
#disputes(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputesResponse
Resource /{merchantId}/payments/{paymentId}/disputes - Get disputes.
-
#find(query, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::FindPaymentsResponse
Resource /{merchantId}/payments - Find payments.
-
#get(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::PaymentResponse
Resource /{merchantId}/payments/{paymentId} - Get payment.
-
#initialize(parent, path_context) ⇒ PaymentsClient
constructor
A new instance of PaymentsClient.
-
#processchallenged(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::PaymentResponse
Resource /{merchantId}/payments/{paymentId}/processchallenged - Approves challenged payment.
-
#refund(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Refund::RefundResponse
Resource /{merchantId}/payments/{paymentId}/refund - Create refund.
-
#refunds(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Refund::RefundsResponse
Resource /{merchantId}/payments/{paymentId}/refunds - Get refunds of payment.
-
#third_party_status(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::ThirdPartyStatusResponse
Resource /{merchantId}/payments/{paymentId}/thirdpartystatus - Third party status poll.
-
#tokenize(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Token::CreateTokenResponse
Resource /{merchantId}/payments/{paymentId}/tokenize - Create a token from payment.
Constructor Details
#initialize(parent, path_context) ⇒ PaymentsClient
Returns a new instance of PaymentsClient.
37 38 39 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 37 def initialize(parent, path_context) super(parent, path_context) end |
Instance Method Details
#approve(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::PaymentApprovalResponse
Resource /{merchantId}/payments/{paymentId}/approve - Approve payment
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 266 def approve(payment_id, body, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/approve', path_context) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Payment::PaymentApprovalResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#cancel(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CancelPaymentResponse
Resource /{merchantId}/payments/{paymentId}/cancel - Cancel payment
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 453 def cancel(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/cancel', path_context) @communicator.post( uri, client_headers, nil, nil, Ingenico::Connect::SDK::Domain::Payment::CancelPaymentResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#cancelapproval(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CancelApprovalPaymentResponse
Resource /{merchantId}/payments/{paymentId}/cancelapproval - Undo capture payment
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 329 def cancelapproval(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/cancelapproval', path_context) @communicator.post( uri, client_headers, nil, nil, Ingenico::Connect::SDK::Domain::Payment::CancelApprovalPaymentResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#capture(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Capture::CaptureResponse
Resource /{merchantId}/payments/{paymentId}/capture - Capture payment
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 298 def capture(payment_id, body, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/capture', path_context) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Capture::CaptureResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#captures(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Capture::CapturesResponse
Resource /{merchantId}/payments/{paymentId}/captures - Get captures of payment
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 360 def captures(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/captures', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Capture::CapturesResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#complete(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CompletePaymentResponse
Resource /{merchantId}/payments/{paymentId}/complete - Complete payment
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 141 def complete(payment_id, body, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/complete', path_context) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Payment::CompletePaymentResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#create(body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::CreatePaymentResponse
Resource /{merchantId}/payments - Create payment
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 55 def create(body, context = nil) uri = instantiate_uri('/v1/{merchantId}/payments', nil) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Payment::CreatePaymentResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Payment::PaymentErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#devicefingerprint(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::DeviceFingerprintDetails
Resource /{merchantId}/payments/{paymentId}/devicefingerprint - Get Device Fingerprint details
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 546 def devicefingerprint(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/devicefingerprint', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Payment::DeviceFingerprintDetails, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#dispute(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse
Resource /{merchantId}/payments/{paymentId}/dispute - Create dispute
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 485 def dispute(payment_id, body, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/dispute', path_context) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Dispute::DisputeResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#disputes(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Dispute::DisputesResponse
Resource /{merchantId}/payments/{paymentId}/disputes - Get disputes
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 516 def disputes(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/disputes', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Dispute::DisputesResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#find(query, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::FindPaymentsResponse
Resource /{merchantId}/payments - Find payments
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 83 def find(query, context = nil) uri = instantiate_uri('/v1/{merchantId}/payments', nil) @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Payment::FindPaymentsResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::PaymentResponse
Resource /{merchantId}/payments/{paymentId} - Get payment
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 110 def get(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Payment::PaymentResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#processchallenged(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::PaymentResponse
Resource /{merchantId}/payments/{paymentId}/processchallenged - Approves challenged payment
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 234 def processchallenged(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/processchallenged', path_context) @communicator.post( uri, client_headers, nil, nil, Ingenico::Connect::SDK::Domain::Payment::PaymentResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#refund(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Refund::RefundResponse
Resource /{merchantId}/payments/{paymentId}/refund - Create refund
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 392 def refund(payment_id, body, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/refund', path_context) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Refund::RefundResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Refund::RefundErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#refunds(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Refund::RefundsResponse
Resource /{merchantId}/payments/{paymentId}/refunds - Get refunds of payment
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 423 def refunds(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/refunds', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Refund::RefundsResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#third_party_status(payment_id, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Payment::ThirdPartyStatusResponse
Resource /{merchantId}/payments/{paymentId}/thirdpartystatus - Third party status poll
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 172 def third_party_status(payment_id, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/thirdpartystatus', path_context) @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Payment::ThirdPartyStatusResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#tokenize(payment_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Token::CreateTokenResponse
Resource /{merchantId}/payments/{paymentId}/tokenize - Create a token from payment
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/ingenico/connect/sdk/merchant/payments/payments_client.rb', line 203 def tokenize(payment_id, body, context = nil) path_context = { 'paymentId'.freeze => payment_id, } uri = instantiate_uri('/v1/{merchantId}/payments/{paymentId}/tokenize', path_context) @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Token::CreateTokenResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |