Module: Klarna::API::Methods::Reservation
- Included in:
- Klarna::API::Methods
- Defined in:
- lib/klarna/api/methods/reservation.rb
Instance Method Summary collapse
-
#activate_reservation(reservation_id, pno, ocr, goods_list, reference, reference_code, order_id_1, order_id_2, client_ip, shipping_address, invoicing_address, shipment_type, email, phone, cell_phone, currency_code, country_code, language_code, pno_encoding, pclass, annual_salary = nil, flags = nil) ⇒ Object
Activate purchases which have been previously reserved with the reserve_amount function.
-
#cancel_reservation(reservation_id) ⇒ Object
Cancel a reservation.
-
#change_reservation(reservation_id, new_amount) ⇒ Object
Change a reservation.
-
#make_reservation_address(first_name, last_name, street_address, zip, city, country_code, house_number = nil) ⇒ Object
(also: #mk_reservation_address)
Create addresses for arguments such as the
activate_reservation
function. -
#reserve_amount(pno_or_cellphone, amount, goods_list, reference, reference_code, order_id_1, order_id_2, client_ip, shipping_address, invoicing_address, email, phone, cell_phone, currency_code, country_code, language_code, pno_encoding, pclass, annual_salary = nil, flags = nil) ⇒ Object
Reserve a purchase amount for a specific customer.
-
#reserve_ocr_numbers(number_of_ocrs) ⇒ Object
Reserves one or more OCR numbers for your store.
-
#split_reservation(reservation_id, split_amount, order_id_1, order_id_2, flags = nil) ⇒ Object
Split a reservation due to for example outstanding articles.
Instance Method Details
#activate_reservation(reservation_id, pno, ocr, goods_list, reference, reference_code, order_id_1, order_id_2, client_ip, shipping_address, invoicing_address, shipment_type, email, phone, cell_phone, currency_code, country_code, language_code, pno_encoding, pclass, annual_salary = nil, flags = nil) ⇒ Object
Activate purchases which have been previously reserved with the reserve_amount function.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/klarna/api/methods/reservation.rb', line 44 def activate_reservation(reservation_id, pno, ocr, goods_list, reference, reference_code, order_id_1, order_id_2, client_ip, shipping_address, invoicing_address, shipment_type, email, phone, cell_phone, currency_code, country_code, language_code, pno_encoding, pclass, annual_salary = nil, flags = nil) # params = [ # reservation_id, # pno, # (ocr || KRED_DEFAULT_OCR), # goods_list, # reference, # reference_code, # order_id_1, # order_id_2, # shipping_address, # invoicing_address, # shipment_type, # email, # phone, # cell_phone, # client_ip, # flags, # currency_code, # country_code, # language_code, # self.store_id, # self.digest(pno, goods_list), # pno_encoding, # (pclass || KRED_DEFAULT_PCLASS), # (annual_salary || KRED_DEFAULT_YSALARY) # ] # self.call(:activate_reservation, *params) raise NotImplementedError end |
#cancel_reservation(reservation_id) ⇒ Object
Cancel a reservation.
79 80 81 82 83 84 85 86 87 |
# File 'lib/klarna/api/methods/reservation.rb', line 79 def cancel_reservation(reservation_id) # params = [ # reservation_id, # self.store_id, # self.digest(reservation_id) # ] # self.call(:cancel_reservation, *params) raise NotImplementedError end |
#change_reservation(reservation_id, new_amount) ⇒ Object
Change a reservation.
107 108 109 110 111 112 113 114 115 116 |
# File 'lib/klarna/api/methods/reservation.rb', line 107 def change_reservation(reservation_id, new_amount) # params = [ # reservation_id, # new_amount, # self.store_id, # self.digest(reservation_id, new_amount) # ] # self.call(:change_reservation, *params) raise NotImplementedError end |
#make_reservation_address(first_name, last_name, street_address, zip, city, country_code, house_number = nil) ⇒ Object Also known as: mk_reservation_address
Create addresses for arguments such as the activate_reservation
function.
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/klarna/api/methods/reservation.rb', line 132 def make_reservation_address(first_name, last_name, street_address, zip, city, country_code, house_number = nil) # { # :fname => first_name, # :lname => last_name, # :street => street_address, # :zip => zip, # :city => city, # :country => ::Klarna::API.id_for(:country, country_code), # :house_number => house_number # }.with_indifferent_access raise NotImplementedError end |
#reserve_amount(pno_or_cellphone, amount, goods_list, reference, reference_code, order_id_1, order_id_2, client_ip, shipping_address, invoicing_address, email, phone, cell_phone, currency_code, country_code, language_code, pno_encoding, pclass, annual_salary = nil, flags = nil) ⇒ Object
Reserve a purchase amount for a specific customer. The reservation is valid, by default, for 7 days. Pass cellphone no. instead of Pno for SMS payments.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/klarna/api/methods/reservation.rb', line 11 def reserve_amount(pno_or_cellphone, amount, goods_list, reference, reference_code, order_id_1, order_id_2, client_ip, shipping_address, invoicing_address, email, phone, cell_phone, currency_code, country_code, language_code, pno_encoding, pclass, annual_salary = nil, flags = nil) # params = [ # pno_or_cellphone, # amount, # reference, # reference_code, # order_id_1, # order_id_2, # shipping_address, # invoicing_address, # email, # phone, # cell_phone, # client_ip, # flags, # currency_code, # country_code, # language_code, # self.store_id, # self.digest(pno_or_cellphone, amount), # pno_encoding, # (pclass || KRED_DEFAULT_PCLASS), # (annual_salary || KRED_DEFAULT_YSALARY), # goods_list # ] # self.call(:reserve_amount, *params) raise NotImplementedError end |
#reserve_ocr_numbers(number_of_ocrs) ⇒ Object
Reserves one or more OCR numbers for your store.
120 121 122 123 124 125 126 127 128 |
# File 'lib/klarna/api/methods/reservation.rb', line 120 def reserve_ocr_numbers(number_of_ocrs) # params = [ # number_of_ocrs, # self.store_id, # self.digest(number_of_ocrs) # ] # self.call(:reserve_ocr_nums, *params) raise NotImplementedError end |
#split_reservation(reservation_id, split_amount, order_id_1, order_id_2, flags = nil) ⇒ Object
Split a reservation due to for example outstanding articles.
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/klarna/api/methods/reservation.rb', line 91 def split_reservation(reservation_id, split_amount, order_id_1, order_id_2, flags = nil) # params = [ # reservation_id, # split_amount, # order_id_1, # order_id_2, # flags.to_i, # self.store_id, # self.digest(reservation_id, split_amount) # ] # self.call(:split_reservation, *params) raise NotImplementedError end |