Class: Stripe::Issuing::Authorization::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/issuing/authorization.rb

Constant Summary collapse

RESOURCE_CLASS =
Authorization

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResourceTestHelpers

custom_method, #initialize, resource_url, #resource_url

Methods included from APIOperations::Request

included

Constructor Details

This class inherits a constructor from Stripe::APIResourceTestHelpers

Class Method Details

.capture(authorization, params = {}, opts = {}) ⇒ Object

Capture a test-mode authorization.



1370
1371
1372
1373
1374
1375
1376
1377
# File 'lib/stripe/resources/issuing/authorization.rb', line 1370

def self.capture(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.create(params = {}, opts = {}) ⇒ Object

Create a test-mode authorization.



1390
1391
1392
1393
1394
1395
1396
1397
# File 'lib/stripe/resources/issuing/authorization.rb', line 1390

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/test_helpers/issuing/authorizations",
    params: params,
    opts: opts
  )
end

.expire(authorization, params = {}, opts = {}) ⇒ Object

Expire a test-mode Authorization.



1400
1401
1402
1403
1404
1405
1406
1407
# File 'lib/stripe/resources/issuing/authorization.rb', line 1400

def self.expire(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.finalize_amount(authorization, params = {}, opts = {}) ⇒ Object

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.



1420
1421
1422
1423
1424
1425
1426
1427
# File 'lib/stripe/resources/issuing/authorization.rb', line 1420

def self.finalize_amount(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/finalize_amount", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.increment(authorization, params = {}, opts = {}) ⇒ Object

Increment a test-mode Authorization.



1440
1441
1442
1443
1444
1445
1446
1447
# File 'lib/stripe/resources/issuing/authorization.rb', line 1440

def self.increment(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.resource_classObject



1365
1366
1367
# File 'lib/stripe/resources/issuing/authorization.rb', line 1365

def self.resource_class
  "Authorization"
end

.respond(authorization, params = {}, opts = {}) ⇒ Object

Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.



1460
1461
1462
1463
1464
1465
1466
1467
# File 'lib/stripe/resources/issuing/authorization.rb', line 1460

def self.respond(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/fraud_challenges/respond", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.reverse(authorization, params = {}, opts = {}) ⇒ Object

Reverse a test-mode Authorization.



1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/stripe/resources/issuing/authorization.rb', line 1480

def self.reverse(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

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

Capture a test-mode authorization.



1380
1381
1382
1383
1384
1385
1386
1387
# File 'lib/stripe/resources/issuing/authorization.rb', line 1380

def capture(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Expire a test-mode Authorization.



1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/stripe/resources/issuing/authorization.rb', line 1410

def expire(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.



1430
1431
1432
1433
1434
1435
1436
1437
# File 'lib/stripe/resources/issuing/authorization.rb', line 1430

def finalize_amount(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/finalize_amount", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Increment a test-mode Authorization.



1450
1451
1452
1453
1454
1455
1456
1457
# File 'lib/stripe/resources/issuing/authorization.rb', line 1450

def increment(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.



1470
1471
1472
1473
1474
1475
1476
1477
# File 'lib/stripe/resources/issuing/authorization.rb', line 1470

def respond(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/fraud_challenges/respond", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Reverse a test-mode Authorization.



1490
1491
1492
1493
1494
1495
1496
1497
# File 'lib/stripe/resources/issuing/authorization.rb', line 1490

def reverse(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end