Class: Stripe::PaymentRecordService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/payment_record_service.rb

Defined Under Namespace

Classes: ReportPaymentAttemptCanceledParams, ReportPaymentAttemptFailedParams, ReportPaymentAttemptGuaranteedParams, ReportPaymentAttemptParams, ReportPaymentParams, RetrieveParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#report_payment(params = {}, opts = {}) ⇒ Object

Report a new Payment Record. You may report a Payment Record as it is

initialized and later report updates through the other report_* methods, or report Payment
Records in a terminal state directly, through this method.


493
494
495
496
497
498
499
500
501
# File 'lib/stripe/services/payment_record_service.rb', line 493

def report_payment(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/payment_records/report_payment",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#report_payment_attempt(id, params = {}, opts = {}) ⇒ Object

Report a new payment attempt on the specified Payment Record. A new payment

attempt can only be specified if all other payment attempts are canceled or failed.


505
506
507
508
509
510
511
512
513
# File 'lib/stripe/services/payment_record_service.rb', line 505

def report_payment_attempt(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_payment_attempt", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#report_payment_attempt_canceled(id, params = {}, opts = {}) ⇒ Object

Report that the most recent payment attempt on the specified Payment Record

was canceled.


517
518
519
520
521
522
523
524
525
# File 'lib/stripe/services/payment_record_service.rb', line 517

def report_payment_attempt_canceled(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_payment_attempt_canceled", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#report_payment_attempt_failed(id, params = {}, opts = {}) ⇒ Object

Report that the most recent payment attempt on the specified Payment Record

failed or errored.


529
530
531
532
533
534
535
536
537
# File 'lib/stripe/services/payment_record_service.rb', line 529

def report_payment_attempt_failed(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_payment_attempt_failed", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#report_payment_attempt_guaranteed(id, params = {}, opts = {}) ⇒ Object

Report that the most recent payment attempt on the specified Payment Record

was guaranteed.


541
542
543
544
545
546
547
548
549
# File 'lib/stripe/services/payment_record_service.rb', line 541

def report_payment_attempt_guaranteed(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/payment_records/%<id>s/report_payment_attempt_guaranteed", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Retrieves a Payment Record with the given ID



552
553
554
555
556
557
558
559
560
# File 'lib/stripe/services/payment_record_service.rb', line 552

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/payment_records/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end