22 lines
482 B
Ruby
22 lines
482 B
Ruby
module BtcpayManager
|
|
class CreateInvoice < BtcpayManagerService
|
|
def initialize(amount:, currency:, redirect_url:)
|
|
@amount = amount
|
|
@currency = currency
|
|
@redirect_url = redirect_url
|
|
end
|
|
|
|
def call
|
|
post "/invoices", {
|
|
amount: @amount.to_s,
|
|
currency: @currency,
|
|
checkout: {
|
|
redirectURL: @redirect_url,
|
|
redirectAutomatically: true,
|
|
requiresRefundEmail: false
|
|
}
|
|
}
|
|
end
|
|
end
|
|
end
|