Module: RockRMS::Client::PaymentDetail
- Included in:
- RockRMS::Client
- Defined in:
- lib/rock_rms/resources/payment_detail.rb
Instance Method Summary collapse
- #create_payment_detail(payment_type: nil, foreign_key: nil, card_type: nil, last_4: nil, currency_type_value_id: nil) ⇒ Object
- #delete_payment_detail(id) ⇒ Object
- #list_payment_details(options = {}) ⇒ Object
- #update_payment_detail(id, foreign_key: nil, card_type: nil, last_4: nil, currency_type_value_id: nil) ⇒ Object
Instance Method Details
#create_payment_detail(payment_type: nil, foreign_key: nil, card_type: nil, last_4: nil, currency_type_value_id: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rock_rms/resources/payment_detail.rb', line 9 def create_payment_detail( payment_type: nil, foreign_key: nil, card_type: nil, last_4: nil, currency_type_value_id: nil ) = { 'CurrencyTypeValueId' => currency_type_value_id || cast_payment_type(payment_type), 'CreditCardTypeValueId' => cast_card_type(card_type), 'ForeignKey' => foreign_key } ['AccountNumberMasked'] = "************#{last_4}" if last_4 post(payment_detail_path, ) end |
#delete_payment_detail(id) ⇒ Object
38 39 40 |
# File 'lib/rock_rms/resources/payment_detail.rb', line 38 def delete_payment_detail(id) delete(payment_detail_path(id)) end |
#list_payment_details(options = {}) ⇒ Object
4 5 6 7 |
# File 'lib/rock_rms/resources/payment_detail.rb', line 4 def list_payment_details( = {}) res = get(payment_detail_path, ) Response::PaymentDetail.format(res) end |
#update_payment_detail(id, foreign_key: nil, card_type: nil, last_4: nil, currency_type_value_id: nil) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rock_rms/resources/payment_detail.rb', line 27 def update_payment_detail(id, foreign_key: nil, card_type: nil, last_4: nil, currency_type_value_id: nil) = {} ['CreditCardTypeValueId'] = cast_card_type(card_type) if card_type ['ForeignKey'] = foreign_key if foreign_key ['AccountNumberMasked'] = "************#{last_4}" if last_4 ['CurrencyTypeValueId'] = currency_type_value_id if currency_type_value_id patch(payment_detail_path(id), ) end |