Class: ShopeePayService::Base
- Inherits:
-
Object
- Object
- ShopeePayService::Base
- Defined in:
- app/services/shopee_pay_service/base.rb
Direct Known Subclasses
CreateInvoice, GetInvoice, InvalidateInvoice, RefundInvoice, ValidateSignature
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/shopee_pay_service/base.rb', line 23 def execute resp = api_call raise Error, { 'debug_msg' => 'invalid_signature' } unless valid_signature?(resp) parsed_body = JSON.parse(resp.body).with_indifferent_access raise Error, parsed_body if parsed_body['errcode'] != 0 parsed_body rescue Faraday::TimeoutError, Faraday::ConnectionFailed @reservation.errors.add(:base, 'Connection time out, please try again') false end |