Sha256: c8cc69a8af52c7d4f32116e75632cb877d4cb8b78cff0b4955634e33f04e5a55
Contents?: true
Size: 747 Bytes
Versions: 7
Compression:
Stored size: 747 Bytes
Contents
module Workarea class Payment module Authorize class Paypal include OperationImplementation def complete! response = Workarea::Paypal.gateway.capture(tender.paypal_id) if response.success? && response.params['status'] == 'PENDING' transaction.action = 'authorize' else transaction.action = 'purchase' end transaction.response = response end def cancel! return unless transaction.success? transaction.cancellation = Workarea::Paypal.gateway.refund( transaction.response.params['id'], amount: transaction.amount ) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems