Class: Iyzipay::Model::PayWithIyzicoInitialize
- Inherits:
-
IyzipayResource
- Object
- IyzipayResource
- Iyzipay::Model::PayWithIyzicoInitialize
- Defined in:
- lib/iyzipay/model/pay_with_iyzico_initialize.rb
Constant Summary
Constants inherited from IyzipayResource
IyzipayResource::AUTHORIZATION_HEADER_NAME, IyzipayResource::AUTHORIZATION_HEADER_STRING, IyzipayResource::RANDOM_CHARS, IyzipayResource::RANDOM_HEADER_NAME, IyzipayResource::RANDOM_STRING_SIZE
Instance Method Summary collapse
Methods inherited from IyzipayResource
#calculate_hash, #format_header_string, #get_http_header, #get_plain_http_header, #json_decode, #prepare_authorization_string, #random_string
Instance Method Details
#create(request = {}, options) ⇒ Object
5 6 7 8 |
# File 'lib/iyzipay/model/pay_with_iyzico_initialize.rb', line 5 def create(request = {}, ) pki_string = to_pki_string(request) HttpClient.post("#{.base_url}/payment/pay-with-iyzico/initialize", get_http_header(pki_string, ), request.to_json) end |
#to_pki_string(request) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/iyzipay/model/pay_with_iyzico_initialize.rb', line 10 def to_pki_string(request) PkiBuilder.new.append_super(super). append_price(:price, request[:price]). append(:basketId, request[:basketId]). append(:paymentGroup, request[:paymentGroup]). append(:buyer, Buyer.to_pki_string(request[:buyer])). append(:shippingAddress, Address.to_pki_string(request[:shippingAddress])). append(:billingAddress, Address.to_pki_string(request[:billingAddress])). append_array(:basketItems, Basket.to_pki_string(request[:basketItems])). append(:callbackUrl, request[:callbackUrl]). append(:paymentSource, request[:paymentSource]). append(:currency, request[:currency]). append(:posOrderId, request[:posOrderId]). append_price(:paidPrice, request[:paidPrice]). append(:forceThreeDS, request[:forceThreeDS]). append(:cardUserKey, request[:cardUserKey]). append_array(:enabledInstallments, request[:enabledInstallments]). get_request_string end |