iyzipay-zebramo 1.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +123 -0
- data/Rakefile +5 -0
- data/contributors +2 -0
- data/iyzipay.gemspec +24 -0
- data/lib/Iyzipay.rb +16 -0
- data/lib/iyzipay/http_client.rb +19 -0
- data/lib/iyzipay/iyzipay_resource.rb +59 -0
- data/lib/iyzipay/model.rb +49 -0
- data/lib/iyzipay/model/address.rb +17 -0
- data/lib/iyzipay/model/api_test.rb +10 -0
- data/lib/iyzipay/model/approval.rb +17 -0
- data/lib/iyzipay/model/basic_bkm.rb +17 -0
- data/lib/iyzipay/model/basic_bkm_initialize.rb +24 -0
- data/lib/iyzipay/model/basic_payment.rb +27 -0
- data/lib/iyzipay/model/basic_payment_post_auth.rb +20 -0
- data/lib/iyzipay/model/basic_payment_pre_auth.rb +27 -0
- data/lib/iyzipay/model/basic_threeds_initialize.rb +27 -0
- data/lib/iyzipay/model/basic_threeds_initialize_pre_auth.rb +27 -0
- data/lib/iyzipay/model/basic_threeds_payment.rb +18 -0
- data/lib/iyzipay/model/basket.rb +26 -0
- data/lib/iyzipay/model/basket_item_type.rb +8 -0
- data/lib/iyzipay/model/bin_number.rb +17 -0
- data/lib/iyzipay/model/bkm.rb +17 -0
- data/lib/iyzipay/model/bkm_initialize.rb +24 -0
- data/lib/iyzipay/model/bounced_bank_transfer_list.rb +17 -0
- data/lib/iyzipay/model/buyer.rb +25 -0
- data/lib/iyzipay/model/cancel.rb +18 -0
- data/lib/iyzipay/model/checkout_form.rb +17 -0
- data/lib/iyzipay/model/checkout_form_initialize.rb +31 -0
- data/lib/iyzipay/model/checkout_form_initialize_pre_auth.rb +30 -0
- data/lib/iyzipay/model/cross_booking_from_sub_merchant.rb +20 -0
- data/lib/iyzipay/model/cross_booking_to_sub_merchant.rb +20 -0
- data/lib/iyzipay/model/currency.rb +11 -0
- data/lib/iyzipay/model/disapproval.rb +17 -0
- data/lib/iyzipay/model/installment_details.rb +19 -0
- data/lib/iyzipay/model/installment_info.rb +18 -0
- data/lib/iyzipay/model/installment_prices.rb +19 -0
- data/lib/iyzipay/model/locale.rb +8 -0
- data/lib/iyzipay/model/payment.rb +47 -0
- data/lib/iyzipay/model/payment_card.rb +22 -0
- data/lib/iyzipay/model/payment_channel.rb +14 -0
- data/lib/iyzipay/model/payment_group.rb +9 -0
- data/lib/iyzipay/model/payment_post_auth.rb +20 -0
- data/lib/iyzipay/model/payment_pre_auth.rb +47 -0
- data/lib/iyzipay/model/payout_completed_transaction_list.rb +17 -0
- data/lib/iyzipay/model/pecco_initialize.rb +27 -0
- data/lib/iyzipay/model/pecco_payment.rb +17 -0
- data/lib/iyzipay/model/refund.rb +20 -0
- data/lib/iyzipay/model/refund_charged_from_merchant.rb +20 -0
- data/lib/iyzipay/model/sub_merchant.rb +72 -0
- data/lib/iyzipay/model/sub_merchant_type.rb +9 -0
- data/lib/iyzipay/model/threeds_initialize.rb +32 -0
- data/lib/iyzipay/model/threeds_initialize_pre_auth.rb +32 -0
- data/lib/iyzipay/model/threeds_payment.rb +34 -0
- data/lib/iyzipay/options.rb +7 -0
- data/lib/iyzipay/pki_builder.rb +101 -0
- data/lib/iyzipay/version.rb +3 -0
- data/spec/api_test_spec.rb +25 -0
- data/spec/approval_spec.rb +30 -0
- data/spec/bin_number_spec.rb +30 -0
- data/spec/bkm_spec.rb +105 -0
- data/spec/cancel_spec.rb +31 -0
- data/spec/card_storage_spec.rb +0 -0
- data/spec/checkout_form_spec.rb +103 -0
- data/spec/disapproval_spec.rb +30 -0
- data/spec/installment_spec.rb +31 -0
- data/spec/payment_spec.rb +276 -0
- data/spec/pecco_spec.rb +105 -0
- data/spec/refund_spec.rb +33 -0
- data/spec/retrieve_transactions_spec.rb +45 -0
- data/spec/spec_helper.rb +80 -0
- data/spec/sub_merchant_spec.rb +179 -0
- data/spec/threeds_payment_spec.rb +226 -0
- metadata +178 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicBkmInitialize < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/bkm/initialize", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:connectorName, request[:connectorName]).
|
13
|
+
append_price(:price, request[:price]).
|
14
|
+
append(:callbackUrl, request[:callbackUrl]).
|
15
|
+
append(:buyerEmail, request[:buyerEmail]).
|
16
|
+
append(:buyerId, request[:buyerId]).
|
17
|
+
append(:buyerIp, request[:buyerIp]).
|
18
|
+
append(:posOrderId, request[:posOrderId]).
|
19
|
+
append_array(:installmentDetails, InstallmentDetails.to_pki_string(request[:installmentDetails])).
|
20
|
+
get_request_string
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicPayment < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/auth", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append_price(:paidPrice, request[:paidPrice]).
|
14
|
+
append(:installment, request[:installment]).
|
15
|
+
append(:buyerEmail, request[:buyerEmail]).
|
16
|
+
append(:buyerId, request[:buyerId]).
|
17
|
+
append(:buyerIp, request[:buyerIp]).
|
18
|
+
append(:posOrderId, request[:posOrderId]).
|
19
|
+
append(:paymentCard, PaymentCard.to_pki_string(request[:paymentCard])).
|
20
|
+
append(:currency, request[:currency]).
|
21
|
+
append(:connectorName, request[:connectorName]).
|
22
|
+
append(:callbackUrl, request[:callbackUrl]).
|
23
|
+
get_request_string
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicPaymentPostAuth < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/postauth", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:paymentId, request[:paymentId]).
|
13
|
+
append(:ip, request[:ip]).
|
14
|
+
append_price(:paidPrice, request[:paidPrice]).
|
15
|
+
append(:currency, request[:currency]).
|
16
|
+
get_request_string
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicPaymentPreAuth < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/preauth", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append_price(:paidPrice, request[:paidPrice]).
|
14
|
+
append(:installment, request[:installment]).
|
15
|
+
append(:buyerEmail, request[:buyerEmail]).
|
16
|
+
append(:buyerId, request[:buyerId]).
|
17
|
+
append(:buyerIp, request[:buyerIp]).
|
18
|
+
append(:posOrderId, request[:posOrderId]).
|
19
|
+
append(:paymentCard, PaymentCard.to_pki_string(request[:paymentCard])).
|
20
|
+
append(:currency, request[:currency]).
|
21
|
+
append(:connectorName, request[:connectorName]).
|
22
|
+
append(:callbackUrl, request[:callbackUrl]).
|
23
|
+
get_request_string
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicThreedsInitialize < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/initialize3ds", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append_price(:paidPrice, request[:paidPrice]).
|
14
|
+
append(:installment, request[:installment]).
|
15
|
+
append(:buyerEmail, request[:buyerEmail]).
|
16
|
+
append(:buyerId, request[:buyerId]).
|
17
|
+
append(:buyerIp, request[:buyerIp]).
|
18
|
+
append(:posOrderId, request[:posOrderId]).
|
19
|
+
append(:paymentCard, PaymentCard.to_pki_string(request[:paymentCard])).
|
20
|
+
append(:currency, request[:currency]).
|
21
|
+
append(:connectorName, request[:connectorName]).
|
22
|
+
append(:callbackUrl, request[:callbackUrl]).
|
23
|
+
get_request_string
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicThreedsInitializePreAuth < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/initialize3ds/preauth", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append_price(:paidPrice, request[:paidPrice]).
|
14
|
+
append(:installment, request[:installment]).
|
15
|
+
append(:buyerEmail, request[:buyerEmail]).
|
16
|
+
append(:buyerId, request[:buyerId]).
|
17
|
+
append(:buyerIp, request[:buyerIp]).
|
18
|
+
append(:posOrderId, request[:posOrderId]).
|
19
|
+
append(:paymentCard, PaymentCard.to_pki_string(request[:paymentCard])).
|
20
|
+
append(:currency, request[:currency]).
|
21
|
+
append(:connectorName, request[:connectorName]).
|
22
|
+
append(:callbackUrl, request[:callbackUrl]).
|
23
|
+
get_request_string
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BasicThreedsPayment < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyziconnect/auth3ds", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:paymentId, request[:paymentId]).
|
13
|
+
append(:conversationData, request[:conversationData]).
|
14
|
+
get_request_string
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class Basket
|
4
|
+
def self.to_pki_string(request)
|
5
|
+
unless request.nil?
|
6
|
+
basket_items = Array.new
|
7
|
+
request.each do |item|
|
8
|
+
item_pki = PkiBuilder.new.
|
9
|
+
append(:id, item[:id]).
|
10
|
+
append_price(:price, item[:price]).
|
11
|
+
append(:name, item[:name]).
|
12
|
+
append(:category1, item[:category1]).
|
13
|
+
append(:category2, item[:category2]).
|
14
|
+
append(:itemType, item[:itemType]).
|
15
|
+
append(:subMerchantKey, item[:subMerchantKey]).
|
16
|
+
append_price(:subMerchantPrice, item[:subMerchantPrice]).
|
17
|
+
append(:ip, item[:ip]).
|
18
|
+
get_request_string
|
19
|
+
basket_items << item_pki
|
20
|
+
end
|
21
|
+
basket_items
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BinNumber < IyzipayResource
|
4
|
+
|
5
|
+
def retrieve(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/bin/check", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:binNumber, request[:binNumber]).
|
13
|
+
get_request_string
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class Bkm < IyzipayResource
|
4
|
+
|
5
|
+
def retrieve(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/bkm/auth/ecom/detail", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:token, request[:token]).
|
13
|
+
get_request_string
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BkmInitialize < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/bkm/initialize/ecom", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append(:basketId, request[:basketId]).
|
14
|
+
append(:paymentGroup, request[:paymentGroup]).
|
15
|
+
append(:buyer, Buyer.to_pki_string(request[:buyer])).
|
16
|
+
append(:shippingAddress, Address.to_pki_string(request[:shippingAddress])).
|
17
|
+
append(:billingAddress, Address.to_pki_string(request[:billingAddress])).
|
18
|
+
append_array(:basketItems, Basket.to_pki_string(request[:basketItems])).
|
19
|
+
append(:callbackUrl, request[:callbackUrl]).
|
20
|
+
get_request_string
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class BouncedBankTransferList < IyzipayResource
|
4
|
+
|
5
|
+
def retrieve(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/reporting/settlement/bounced", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:date, request[:date]).
|
13
|
+
get_request_string
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class Buyer
|
4
|
+
def self.to_pki_string(request)
|
5
|
+
unless request.nil?
|
6
|
+
PkiBuilder.new.
|
7
|
+
append(:id, request[:id]).
|
8
|
+
append(:name, request[:name]).
|
9
|
+
append(:surname, request[:surname]).
|
10
|
+
append(:identityNumber, request[:identityNumber]).
|
11
|
+
append(:email, request[:email]).
|
12
|
+
append(:gsmNumber, request[:gsmNumber]).
|
13
|
+
append(:registrationDate, request[:registrationDate]).
|
14
|
+
append(:lastLoginDate, request[:lastLoginDate]).
|
15
|
+
append(:registrationAddress, request[:registrationAddress]).
|
16
|
+
append(:city, request[:city]).
|
17
|
+
append(:country, request[:country]).
|
18
|
+
append(:zipCode, request[:zipCode]).
|
19
|
+
append(:ip, request[:ip]).
|
20
|
+
get_request_string
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class Cancel < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/cancel", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:paymentId, request[:paymentId]).
|
13
|
+
append(:ip, request[:ip]).
|
14
|
+
get_request_string
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class CheckoutForm < IyzipayResource
|
4
|
+
|
5
|
+
def retrieve(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/checkoutform/auth/ecom/detail", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:token, request[:token]).
|
13
|
+
get_request_string
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class CheckoutFormInitialize < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/checkoutform/initialize/ecom", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append(:basketId, request[:basketId]).
|
14
|
+
append(:paymentGroup, request[:paymentGroup]).
|
15
|
+
append(:buyer, Buyer.to_pki_string(request[:buyer])).
|
16
|
+
append(:shippingAddress, Address.to_pki_string(request[:shippingAddress])).
|
17
|
+
append(:billingAddress, Address.to_pki_string(request[:billingAddress])).
|
18
|
+
append_array(:basketItems, Basket.to_pki_string(request[:basketItems])).
|
19
|
+
append(:callbackUrl, request[:callbackUrl]).
|
20
|
+
append(:paymentSource, request[:paymentSource]).
|
21
|
+
append(:currency, request[:currency]).
|
22
|
+
append(:posOrderId, request[:posOrderId]).
|
23
|
+
append_price(:paidPrice, request[:paidPrice]).
|
24
|
+
append(:forceThreeDS, request[:forceThreeDS]).
|
25
|
+
append(:cardUserKey, request[:cardUserKey]).
|
26
|
+
append_array(:enabledInstallments, request[:enabledInstallments]).
|
27
|
+
get_request_string
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class CheckoutFormInitializePreAuth < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/payment/iyzipos/checkoutform/initialize/preauth/ecom", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append_price(:price, request[:price]).
|
13
|
+
append(:basketId, request[:basketId]).
|
14
|
+
append(:paymentGroup, request[:paymentGroup]).
|
15
|
+
append(:buyer, Buyer.to_pki_string(request[:buyer])).
|
16
|
+
append(:shippingAddress, Address.to_pki_string(request[:shippingAddress])).
|
17
|
+
append(:billingAddress, Address.to_pki_string(request[:billingAddress])).
|
18
|
+
append_array(:basketItems, Basket.to_pki_string(request[:basketItems])).
|
19
|
+
append(:callbackUrl, request[:callbackUrl]).
|
20
|
+
append(:paymentSource, request[:paymentSource]).
|
21
|
+
append(:posOrderId, request[:posOrderId]).
|
22
|
+
append_price(:paidPrice, request[:paidPrice]).
|
23
|
+
append(:forceThreeDS, request[:forceThreeDS]).
|
24
|
+
append(:cardUserKey, request[:cardUserKey]).
|
25
|
+
append_array(:enabledInstallments, request[:enabledInstallments]).
|
26
|
+
get_request_string
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Iyzipay
|
2
|
+
module Model
|
3
|
+
class CrossBookingFromSubMerchant < IyzipayResource
|
4
|
+
|
5
|
+
def create(request = {}, options)
|
6
|
+
pki_string = to_pki_string(request)
|
7
|
+
HttpClient.post("#{options.base_url}/crossbooking/receive", get_http_header(pki_string, options), request.to_json)
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_pki_string(request)
|
11
|
+
PkiBuilder.new.append_super(super).
|
12
|
+
append(:subMerchantKey, request[:subMerchantKey]).
|
13
|
+
append_price(:price, request[:price]).
|
14
|
+
append(:reason, request[:reason]).
|
15
|
+
append(:currency, request[:currency]).
|
16
|
+
get_request_string
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|