Module: XapoTools
- Defined in:
- lib/xapo_tools.rb
Defined Under Namespace
Classes: MicroPayment
Class Method Summary collapse
-
.micro_payment_config ⇒ Object
Micro payment button configuration options.
-
.micro_payment_customization ⇒ Object
Micro payment button customization options.
Class Method Details
.micro_payment_config ⇒ Object
Micro payment button configuration options.
This function is intended to be a helper for creating empty micro payments buttons configuration but also serves for documenting. A hash with the intended fields would give the same results.
Params:
+sender_user_id+ (str): The id of the user sending the payment.
+sender_user_email+ (str, optional): The email of the user sending
the payment.
+sender_user_cellphone+ (str, optional): The celphone number of the user
sending the payment.
+receiver_user_id+ (str): The id of the user receiving the payment.
+receiver_user_email+ (str): The email of the user receiving the payment.
+pay_object_id+ (str): A payment identifier in the TPA context.
+amount_BIT+ (float, optional): The amount of bitcoins to be payed by the
widget. If not specified here, it must be entered on payment basis.
+pay_type+ (str): The string representing the type of operation
("Tip", "Pay", "Deposit" or "Donate").
+reference_code+ (str, optional): A custom tag to be tracked by the TPA. It's
sent back to the TPA in the specified callback (see customization).
+end_mpayment_uri+ (str, optional): The callback URL to notify a successful
micro payment. The callback will be called with parameters
"reference_code" and "request_UID".
+redirect_uri+ (str, optional): redirect URL after a successful OAuth flow.
The URL must accept a "code" parameter if access is granted or
"error" and "error_description" in case of denial.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/xapo_tools.rb', line 39 def micro_payment_config return Hash[ :sender_user_id => "", :sender_user_email => "", :sender_user_cellphone => "", :receiver_user_id => "", :receiver_user_email => "", :pay_object_id => "", :amount_BIT => 0, :timestamp => XapoUtils., :pay_type => "", :reference_code => "", :end_mpayment_uri => "", :redirect_uri => "", ] end |
.micro_payment_customization ⇒ Object
Micro payment button customization options.
This function is intended to be a helper for creating empty micro payments buttons customization but also serves for documenting. A hash with the intended fields would give the same results.
Params:
+login_cellphone_header_title+ (str, optional): Text to appear in the login
screen. Default: "Support content creators by sending them bits.
New users receive 50 bits to get started!"
+predefined_pay_values+ (str, optional): A string of comma separated
amount values, e.g. "1,5,10".
+button_css+ (str, optional): optional CSS button customization ("red" | "grey").
70 71 72 73 74 75 76 |
# File 'lib/xapo_tools.rb', line 70 def micro_payment_customization return Hash[ :login_cellphone_header_title => "", :predefined_pay_values => "", :button_css => "" ] end |