Sha256: b809899f1bdb0def1097a362f664a792c89eb3a2c375e1fd0b432d46532ae8b3

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

module Iyzipay
  module Model
    class BasicThreedsInitializePreAuth < IyzipayResource

      def create(request = {}, options)
        pki_string = to_pki_string(request)
        HttpClient.post("#{options.base_url}/payment/iyziconnect/initialize3ds/preauth", get_http_header(pki_string, options), request.to_json)
      end

      def to_pki_string(request)
        PkiBuilder.new.append_super(super).
            append_price(:price, request[:price]).
            append_price(:paidPrice, request[:paidPrice]).
            append(:installment, request[:installment]).
            append(:buyerEmail, request[:buyerEmail]).
            append(:buyerId, request[:buyerId]).
            append(:buyerIp, request[:buyerIp]).
            append(:posOrderId, request[:posOrderId]).
            append(:paymentCard, PaymentCard.to_pki_string(request[:paymentCard])).
            append(:connectorName, request[:connectorName]).
            append(:callbackUrl, request[:callbackUrl]).
            get_request_string
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iyzipay-1.0.31 lib/iyzipay/model/basic_threeds_initialize_pre_auth.rb
iyzipay-1.0.29 lib/iyzipay/model/basic_threeds_initialize_pre_auth.rb