Sha256: d258ad0db1cb11cdcc5c91ffd96ff191a44ddebe153fb4eaa07e0df6278ec0d0

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

module PayPal
  module ExpressCheckout
    module Response
      class Payment < PayPal::ExpressCheckout::Response::Base
        mapping(
          :status         => :PAYMENTINFO_0_PAYMENTSTATUS,
          :amount         => :PAYMENTINFO_0_AMT,
          :fees           => :PAYMENTINFO_0_FEEAMT,
          :transaction_id => :PAYMENTINFO_0_TRANSACTIONID,
          :seller_id      => :PAYMENTINFO_0_SECUREMERCHANTACCOUNTID,
          :reference      => [:PROFILEREFERENCE, :PAYMENTREQUEST_0_CUSTOM, :PAYMENTREQUEST_0_INVNUM]
        )

        def completed?
          params[:PAYMENTINFO_0_PAYMENTSTATUS] == "Completed"
        end

        def approved?
          params[:PAYMENTINFO_0_ACK] == "Success"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paypal-payment-0.1.2 lib/paypal/express_checkout/response/payment.rb