Module: Drip::Client::Purchases
- Included in:
- Drip::Client
- Defined in:
- lib/drip/client/purchases.rb
Instance Method Summary collapse
-
#create_purchase(email, amount, options = {}) ⇒ Object
Public: Create a purchase.
Instance Method Details
#create_purchase(email, amount, options = {}) ⇒ Object
Public: Create a purchase.
email - Required. The String email address of the subscriber. amount - Required. The total amount of the purchase in cents. options - Required. A Hash of additional order options. Refer to the
Drip API docs for the required schema.
Returns a Drip::Response. See developer.drip.com/#orders
DEPRECATED: The beta Purchase endpoint has been deprecated and this method now sends requests to the Order creation endpoint. Please use ‘create_or_update_order` instead
15 16 17 18 19 20 |
# File 'lib/drip/client/purchases.rb', line 15 def create_purchase(email, amount, = {}) warn "[DEPRECATED] `create_purchase` is deprecated. Please use `create_or_update_order` instead." data = .merge({ amount: amount, email: email }) post "#{account_id}/orders", generate_resource("orders", data) end |