Class: Stripe::GiftCards::Transaction
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::GiftCards::Transaction
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/gift_cards/transaction.rb
Overview
A gift card transaction represents a single transaction on a referenced gift card. A transaction is in one of three states, ‘confirmed`, `held` or `canceled`. A `confirmed` transaction is one that has added/deducted funds. A `held` transaction has created a temporary hold on funds, which can then be cancelled or confirmed. A `held` transaction can be confirmed into a `confirmed` transaction, or canceled into a `canceled` transaction. A `canceled` transaction has no effect on a gift card’s balance.
Constant Summary collapse
- OBJECT_NAME =
"gift_cards.transaction"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.cancel(id, params = {}, opts = {}) ⇒ Object
Cancel a gift card transaction.
-
.confirm(id, params = {}, opts = {}) ⇒ Object
Confirm a gift card transaction.
-
.create(params = {}, opts = {}) ⇒ Object
Create a gift card transaction.
-
.list(filters = {}, opts = {}) ⇒ Object
List gift card transactions for a gift card.
- .object_name ⇒ Object
-
.update(id, params = {}, opts = {}) ⇒ Object
Update a gift card transaction.
Instance Method Summary collapse
-
#cancel(params = {}, opts = {}) ⇒ Object
Cancel a gift card transaction.
-
#confirm(params = {}, opts = {}) ⇒ Object
Confirm a gift card transaction.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Class Method Details
.cancel(id, params = {}, opts = {}) ⇒ Object
Cancel a gift card transaction
33 34 35 36 37 38 39 40 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 33 def self.cancel(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.confirm(id, params = {}, opts = {}) ⇒ Object
Confirm a gift card transaction
53 54 55 56 57 58 59 60 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 53 def self.confirm(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
Create a gift card transaction
63 64 65 66 67 68 69 70 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 63 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/gift_cards/transactions", params: params, opts: opts ) end |
.list(filters = {}, opts = {}) ⇒ Object
List gift card transactions for a gift card
73 74 75 76 77 78 79 80 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 73 def self.list(filters = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/gift_cards/transactions", params: filters, opts: opts ) end |
.object_name ⇒ Object
18 19 20 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 18 def self.object_name "gift_cards.transaction" end |
.update(id, params = {}, opts = {}) ⇒ Object
Update a gift card transaction
83 84 85 86 87 88 89 90 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 83 def self.update(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/gift_cards/transactions/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts ) end |
Instance Method Details
#cancel(params = {}, opts = {}) ⇒ Object
Cancel a gift card transaction
23 24 25 26 27 28 29 30 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 23 def cancel(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#confirm(params = {}, opts = {}) ⇒ Object
Confirm a gift card transaction
43 44 45 46 47 48 49 50 |
# File 'lib/stripe/resources/gift_cards/transaction.rb', line 43 def confirm(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |