class Stripetease::API::Charges

Overview

To charge a credit or a debit card, you create a Charge object. You can retrieve and refund individual charges as well as list all charges. Charges are identified by a unique, random ID.

Defined in:

stripetease/api/charges.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(session : Session) #

[View source]

Instance Method Detail

def capture(id : String, amount : Int32 | Nil = nil, receipt_email : String | Nil = nil, statement_descriptor : String | Nil = nil, statement_descriptor_suffix : String | Nil = nil, application_fee_amount : Int32 | Nil = nil, transfer_data : Hash | Nil = nil, transfer_group : String | Nil = nil) #

Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.


[View source]
def create(amount : Int32, currency : String, customer : String | Nil = nil, description : String | Nil = nil, metadata : Hash | Nil = nil, receipt_email : String | Nil = nil, shipping : Hash | Nil = nil, source : String | Nil = nil, statement_descriptor : String | Nil = nil, application_fee_amount : Int32 | Nil = nil, capture : Bool | Nil = nil, on_behalf_of : String | Nil = nil, radar_options : Hash | Nil = nil, transfer_data : Hash | Nil = nil, transfer_group : String | Nil = nil) #

To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).


[View source]
def get(id : String) #

Retrieves the details of a charge that has previously been created.


[View source]
def update(id : String, customer : String | Nil = nil, description : String | Nil = nil, metadata : Hash | Nil = nil, receipt_email : String | Nil = nil, shipping : Hash | Nil = nil, fraud_details : Hash | Nil = nil, transfer_group : String | Nil = nil) #

Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.


[View source]