Class: Stripe::GiftCards::TransactionService::CreateParams

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/gift_cards/transaction_service.rb

Defined Under Namespace

Classes: CreatedBy

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(amount: nil, confirm: nil, created_by: nil, currency: nil, description: nil, expand: nil, gift_card: nil, metadata: nil, transfer_group: nil) ⇒ CreateParams

Returns a new instance of CreateParams.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 91

def initialize(
  amount: nil,
  confirm: nil,
  created_by: nil,
  currency: nil,
  description: nil,
  expand: nil,
  gift_card: nil,
  metadata: nil,
  transfer_group: nil
)
  @amount = amount
  @confirm = confirm
  @created_by = created_by
  @currency = currency
  @description = description
  @expand = expand
  @gift_card = gift_card
  @metadata = 
  @transfer_group = transfer_group
end

Instance Attribute Details

#amountObject

The amount of the transaction. A negative amount deducts funds, and a positive amount adds funds.



65
66
67
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 65

def amount
  @amount
end

#confirmObject

Whether this is a confirmed transaction. A confirmed transaction immediately deducts from/adds to the ‘amount_available` on the gift card. Otherwise, it creates a held transaction that increments the `amount_held` on the gift card.



68
69
70
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 68

def confirm
  @confirm
end

#created_byObject

Related objects which created this transaction.



71
72
73
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 71

def created_by
  @created_by
end

#currencyObject

The currency of the transaction. This must match the currency of the gift card.



74
75
76
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 74

def currency
  @currency
end

#descriptionObject

An arbitrary string attached to the object. Often useful for displaying to users.



77
78
79
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 77

def description
  @description
end

#expandObject

Specifies which fields in the response should be expanded.



80
81
82
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 80

def expand
  @expand
end

#gift_cardObject

The gift card to create a new transaction on.



83
84
85
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 83

def gift_card
  @gift_card
end

#metadataObject

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



86
87
88
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 86

def 
  @metadata
end

#transfer_groupObject

A string that identifies this transaction as part of a group. See the [Connect documentation](stripe.com/docs/connect/separate-charges-and-transfers) for details.



89
90
91
# File 'lib/stripe/services/gift_cards/transaction_service.rb', line 89

def transfer_group
  @transfer_group
end