Class: EasyPost::Services::BetaReferralCustomer
- Defined in:
- lib/easypost/services/beta_referral_customer.rb
Instance Method Summary collapse
-
#add_payment_method(stripe_customer_id, payment_method_reference, priority = 'primary') ⇒ Object
Add a Stripe payment method to a ReferralCustomer Customer.
-
#refund_by_amount(amount) ⇒ Object
Refund a ReferralCustomer Customer’s wallet by a specified amount.
-
#refund_by_payment_log(payment_log_id) ⇒ Object
Refund a ReferralCustomer Customer’s wallet for a specified payment log entry.
Methods inherited from Service
Constructor Details
This class inherits a constructor from EasyPost::Services::Service
Instance Method Details
#add_payment_method(stripe_customer_id, payment_method_reference, priority = 'primary') ⇒ Object
Add a Stripe payment method to a ReferralCustomer Customer. This function requires the ReferralCustomer Customer’s API key.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/easypost/services/beta_referral_customer.rb', line 5 def add_payment_method(stripe_customer_id, payment_method_reference, priority = 'primary') wrapped_params = { payment_method: { stripe_customer_id: stripe_customer_id, payment_method_reference: payment_method_reference, priority: priority.downcase, }, } response = @client.make_request( :post, 'referral_customers/payment_method', wrapped_params, 'beta', ) EasyPost::InternalUtilities::Json.convert_json_to_object(response) end |
#refund_by_amount(amount) ⇒ Object
Refund a ReferralCustomer Customer’s wallet by a specified amount. Refund will be issued to the user’s original payment method. This function requires the ReferralCustomer Customer’s API key.
25 26 27 28 29 30 31 32 |
# File 'lib/easypost/services/beta_referral_customer.rb', line 25 def refund_by_amount(amount) params = { refund_amount: amount, } response = @client.make_request(:post, 'referral_customers/refunds', params, 'beta') EasyPost::InternalUtilities::Json.convert_json_to_object(response) end |
#refund_by_payment_log(payment_log_id) ⇒ Object
Refund a ReferralCustomer Customer’s wallet for a specified payment log entry. Refund will be issued to the user’s original payment method. This function requires the ReferralCustomer Customer’s API key.
36 37 38 39 40 41 42 43 |
# File 'lib/easypost/services/beta_referral_customer.rb', line 36 def refund_by_payment_log(payment_log_id) params = { payment_log_id: payment_log_id, } response = @client.make_request(:post, 'referral_customers/refunds', params, 'beta') EasyPost::InternalUtilities::Json.convert_json_to_object(response) end |