processout 3.4.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +1 -1
  3. data/lib/processout/alternative_merchant_certificate.rb +5 -3
  4. data/lib/processout/apm_payment_processing_configuration.rb +81 -0
  5. data/lib/processout/apple_pay_alternative_merchant_certificates.rb +5 -3
  6. data/lib/processout/balances.rb +5 -3
  7. data/lib/processout/card.rb +45 -1
  8. data/lib/processout/card_contact.rb +11 -0
  9. data/lib/processout/card_create_request.rb +38 -2
  10. data/lib/processout/card_information.rb +1 -1
  11. data/lib/processout/card_scheme_details.rb +81 -0
  12. data/lib/processout/card_update_request.rb +37 -2
  13. data/lib/processout/customer.rb +8 -63
  14. data/lib/processout/device.rb +22 -0
  15. data/lib/processout/event.rb +1 -1
  16. data/lib/processout/export_layout.rb +4 -4
  17. data/lib/processout/export_layout_configuration_options.rb +1 -1
  18. data/lib/processout/gateway_configuration.rb +3 -3
  19. data/lib/processout/invoice.rb +163 -80
  20. data/lib/processout/invoice_device.rb +11 -0
  21. data/lib/processout/invoice_external_fraud_tools.rb +12 -0
  22. data/lib/processout/networking/request.rb +1 -1
  23. data/lib/processout/payment_processing_configuration.rb +93 -0
  24. data/lib/processout/payout.rb +1 -1
  25. data/lib/processout/product.rb +8 -6
  26. data/lib/processout/project.rb +2 -63
  27. data/lib/processout/project_sftp_settings_public.rb +1 -1
  28. data/lib/processout/refund.rb +1 -1
  29. data/lib/processout/submerchant.rb +92 -0
  30. data/lib/processout/submerchant_mapping.rb +103 -0
  31. data/lib/processout/token.rb +22 -7
  32. data/lib/processout/transaction.rb +17 -38
  33. data/lib/processout/transaction_operation.rb +11 -0
  34. data/lib/processout/unsupported_feature_bypass.rb +11 -0
  35. data/lib/processout/version.rb +1 -1
  36. data/lib/processout.rb +40 -46
  37. metadata +12 -13
  38. data/lib/processout/activity.rb +0 -206
  39. data/lib/processout/addon.rb +0 -401
  40. data/lib/processout/coupon.rb +0 -352
  41. data/lib/processout/discount.rb +0 -360
  42. data/lib/processout/plan.rb +0 -368
  43. data/lib/processout/subscription.rb +0 -910
@@ -15,12 +15,11 @@ module ProcessOut
15
15
  attr_reader :transaction_id
16
16
  attr_reader :customer
17
17
  attr_reader :customer_id
18
- attr_reader :subscription
19
- attr_reader :subscription_id
20
18
  attr_reader :token
21
19
  attr_reader :token_id
22
20
  attr_reader :details
23
21
  attr_reader :submerchant
22
+ attr_reader :submerchant_id
24
23
  attr_reader :url
25
24
  attr_reader :url_qrcode
26
25
  attr_reader :name
@@ -60,6 +59,7 @@ module ProcessOut
60
59
  attr_reader :verification
61
60
  attr_reader :auto_capture_at
62
61
  attr_reader :reference_id
62
+ attr_reader :payment_processing_config
63
63
 
64
64
 
65
65
  def id=(val)
@@ -126,26 +126,6 @@ module ProcessOut
126
126
  @customer_id = val
127
127
  end
128
128
 
129
- def subscription=(val)
130
- if val.nil?
131
- @subscription = val
132
- return
133
- end
134
-
135
- if val.instance_of? Subscription
136
- @subscription = val
137
- else
138
- obj = Subscription.new(@client)
139
- obj.fill_with_data(val)
140
- @subscription = obj
141
- end
142
-
143
- end
144
-
145
- def subscription_id=(val)
146
- @subscription_id = val
147
- end
148
-
149
129
  def token=(val)
150
130
  if val.nil?
151
131
  @token = val
@@ -202,6 +182,10 @@ module ProcessOut
202
182
 
203
183
  end
204
184
 
185
+ def submerchant_id=(val)
186
+ @submerchant_id = val
187
+ end
188
+
205
189
  def url=(val)
206
190
  @url = val
207
191
  end
@@ -454,6 +438,22 @@ module ProcessOut
454
438
  @reference_id = val
455
439
  end
456
440
 
441
+ def payment_processing_config=(val)
442
+ if val.nil?
443
+ @payment_processing_config = val
444
+ return
445
+ end
446
+
447
+ if val.instance_of? PaymentProcessingConfiguration
448
+ @payment_processing_config = val
449
+ else
450
+ obj = PaymentProcessingConfiguration.new(@client)
451
+ obj.fill_with_data(val)
452
+ @payment_processing_config = obj
453
+ end
454
+
455
+ end
456
+
457
457
 
458
458
  # Initializes the Invoice object
459
459
  # Params:
@@ -469,12 +469,11 @@ module ProcessOut
469
469
  self.transaction_id = data.fetch(:transaction_id, nil)
470
470
  self.customer = data.fetch(:customer, nil)
471
471
  self.customer_id = data.fetch(:customer_id, nil)
472
- self.subscription = data.fetch(:subscription, nil)
473
- self.subscription_id = data.fetch(:subscription_id, nil)
474
472
  self.token = data.fetch(:token, nil)
475
473
  self.token_id = data.fetch(:token_id, nil)
476
474
  self.details = data.fetch(:details, nil)
477
475
  self.submerchant = data.fetch(:submerchant, nil)
476
+ self.submerchant_id = data.fetch(:submerchant_id, nil)
478
477
  self.url = data.fetch(:url, nil)
479
478
  self.url_qrcode = data.fetch(:url_qrcode, nil)
480
479
  self.name = data.fetch(:name, nil)
@@ -514,6 +513,7 @@ module ProcessOut
514
513
  self.verification = data.fetch(:verification, nil)
515
514
  self.auto_capture_at = data.fetch(:auto_capture_at, nil)
516
515
  self.reference_id = data.fetch(:reference_id, nil)
516
+ self.payment_processing_config = data.fetch(:payment_processing_config, nil)
517
517
 
518
518
  end
519
519
 
@@ -532,12 +532,11 @@ module ProcessOut
532
532
  "transaction_id": self.transaction_id,
533
533
  "customer": self.customer,
534
534
  "customer_id": self.customer_id,
535
- "subscription": self.subscription,
536
- "subscription_id": self.subscription_id,
537
535
  "token": self.token,
538
536
  "token_id": self.token_id,
539
537
  "details": self.details,
540
538
  "submerchant": self.submerchant,
539
+ "submerchant_id": self.submerchant_id,
541
540
  "url": self.url,
542
541
  "url_qrcode": self.url_qrcode,
543
542
  "name": self.name,
@@ -577,6 +576,7 @@ module ProcessOut
577
576
  "verification": self.verification,
578
577
  "auto_capture_at": self.auto_capture_at,
579
578
  "reference_id": self.reference_id,
579
+ "payment_processing_config": self.payment_processing_config,
580
580
  }.to_json
581
581
  end
582
582
 
@@ -608,12 +608,6 @@ module ProcessOut
608
608
  if data.include? "customer_id"
609
609
  self.customer_id = data["customer_id"]
610
610
  end
611
- if data.include? "subscription"
612
- self.subscription = data["subscription"]
613
- end
614
- if data.include? "subscription_id"
615
- self.subscription_id = data["subscription_id"]
616
- end
617
611
  if data.include? "token"
618
612
  self.token = data["token"]
619
613
  end
@@ -626,6 +620,9 @@ module ProcessOut
626
620
  if data.include? "submerchant"
627
621
  self.submerchant = data["submerchant"]
628
622
  end
623
+ if data.include? "submerchant_id"
624
+ self.submerchant_id = data["submerchant_id"]
625
+ end
629
626
  if data.include? "url"
630
627
  self.url = data["url"]
631
628
  end
@@ -743,6 +740,9 @@ module ProcessOut
743
740
  if data.include? "reference_id"
744
741
  self.reference_id = data["reference_id"]
745
742
  end
743
+ if data.include? "payment_processing_config"
744
+ self.payment_processing_config = data["payment_processing_config"]
745
+ end
746
746
 
747
747
  self
748
748
  end
@@ -761,12 +761,11 @@ module ProcessOut
761
761
  self.transaction_id = data.fetch(:transaction_id, self.transaction_id)
762
762
  self.customer = data.fetch(:customer, self.customer)
763
763
  self.customer_id = data.fetch(:customer_id, self.customer_id)
764
- self.subscription = data.fetch(:subscription, self.subscription)
765
- self.subscription_id = data.fetch(:subscription_id, self.subscription_id)
766
764
  self.token = data.fetch(:token, self.token)
767
765
  self.token_id = data.fetch(:token_id, self.token_id)
768
766
  self.details = data.fetch(:details, self.details)
769
767
  self.submerchant = data.fetch(:submerchant, self.submerchant)
768
+ self.submerchant_id = data.fetch(:submerchant_id, self.submerchant_id)
770
769
  self.url = data.fetch(:url, self.url)
771
770
  self.url_qrcode = data.fetch(:url_qrcode, self.url_qrcode)
772
771
  self.name = data.fetch(:name, self.name)
@@ -806,10 +805,59 @@ module ProcessOut
806
805
  self.verification = data.fetch(:verification, self.verification)
807
806
  self.auto_capture_at = data.fetch(:auto_capture_at, self.auto_capture_at)
808
807
  self.reference_id = data.fetch(:reference_id, self.reference_id)
808
+ self.payment_processing_config = data.fetch(:payment_processing_config, self.payment_processing_config)
809
809
 
810
810
  self
811
811
  end
812
812
 
813
+ # Autheticate the invoice using the given source (customer or token)
814
+ # Params:
815
+ # +source+:: Source used to authenticate the payment. Can be a card, token or a gateway request.
816
+ # +options+:: +Hash+ of options
817
+ def authenticate(source, options = {})
818
+ self.prefill(options)
819
+
820
+ request = Request.new(@client)
821
+ path = "/invoices/:invoice_id/authenticate"
822
+ data = {
823
+ "device" => @device,
824
+ "incremental" => @incremental,
825
+ "synchronous" => options.fetch(:synchronous, nil),
826
+ "retry_drop_liability_shift" => options.fetch(:retry_drop_liability_shift, nil),
827
+ "capture_amount" => options.fetch(:capture_amount, nil),
828
+ "enable_three_d_s_2" => options.fetch(:enable_three_d_s_2, nil),
829
+ "allow_fallback_to_sale" => options.fetch(:allow_fallback_to_sale, nil),
830
+ "auto_capture_at" => options.fetch(:auto_capture_at, nil),
831
+ "metadata" => options.fetch(:metadata, nil),
832
+ "override_mac_blocking" => options.fetch(:override_mac_blocking, nil),
833
+ "external_three_d_s" => options.fetch(:external_three_d_s, nil),
834
+ "save_source" => options.fetch(:save_source, nil),
835
+ "provision_network_token" => options.fetch(:provision_network_token, nil),
836
+ "invoice_line_items" => options.fetch(:invoice_line_items, nil),
837
+ "transaction_link_id" => options.fetch(:transaction_link_id, nil),
838
+ "source" => source
839
+ }
840
+
841
+ response = Response.new(request.post(path, data, options))
842
+ return_values = Array.new
843
+
844
+ body = response.body
845
+ body = body.key?("transaction") ? body["transaction"] : nil
846
+ if !body.nil?
847
+ transaction = Transaction.new(@client)
848
+ return_values.push(transaction.fill_with_data(body))
849
+ end
850
+ body = response.body
851
+ body = body.key?("customer_action") ? body["customer_action"] : nil
852
+ if !body.nil?
853
+ customer_action = CustomerAction.new(@client)
854
+ return_values.push(customer_action.fill_with_data(body))
855
+ end
856
+
857
+
858
+ return_values
859
+ end
860
+
813
861
  # Create an incremental authorization
814
862
  # Params:
815
863
  # +amount+:: Amount to increment authorization by
@@ -828,9 +876,11 @@ module ProcessOut
828
876
  return_values = Array.new
829
877
 
830
878
  body = response.body
831
- body = body["transaction"]
832
- transaction = Transaction.new(@client)
833
- return_values.push(transaction.fill_with_data(body))
879
+ body = body.key?("transaction") ? body["transaction"] : nil
880
+ if !body.nil?
881
+ transaction = Transaction.new(@client)
882
+ return_values.push(transaction.fill_with_data(body))
883
+ end
834
884
 
835
885
 
836
886
  return_values[0]
@@ -858,6 +908,9 @@ module ProcessOut
858
908
  "override_mac_blocking" => options.fetch(:override_mac_blocking, nil),
859
909
  "external_three_d_s" => options.fetch(:external_three_d_s, nil),
860
910
  "save_source" => options.fetch(:save_source, nil),
911
+ "provision_network_token" => options.fetch(:provision_network_token, nil),
912
+ "invoice_line_items" => options.fetch(:invoice_line_items, nil),
913
+ "transaction_link_id" => options.fetch(:transaction_link_id, nil),
861
914
  "source" => source
862
915
  }
863
916
 
@@ -865,13 +918,17 @@ module ProcessOut
865
918
  return_values = Array.new
866
919
 
867
920
  body = response.body
868
- body = body["transaction"]
869
- transaction = Transaction.new(@client)
870
- return_values.push(transaction.fill_with_data(body))
921
+ body = body.key?("transaction") ? body["transaction"] : nil
922
+ if !body.nil?
923
+ transaction = Transaction.new(@client)
924
+ return_values.push(transaction.fill_with_data(body))
925
+ end
871
926
  body = response.body
872
- body = body["customer_action"]
873
- customer_action = CustomerAction.new(@client)
874
- return_values.push(customer_action.fill_with_data(body))
927
+ body = body.key?("customer_action") ? body["customer_action"] : nil
928
+ if !body.nil?
929
+ customer_action = CustomerAction.new(@client)
930
+ return_values.push(customer_action.fill_with_data(body))
931
+ end
875
932
 
876
933
 
877
934
  return_values
@@ -900,6 +957,8 @@ module ProcessOut
900
957
  "override_mac_blocking" => options.fetch(:override_mac_blocking, nil),
901
958
  "external_three_d_s" => options.fetch(:external_three_d_s, nil),
902
959
  "save_source" => options.fetch(:save_source, nil),
960
+ "provision_network_token" => options.fetch(:provision_network_token, nil),
961
+ "transaction_link_id" => options.fetch(:transaction_link_id, nil),
903
962
  "source" => source
904
963
  }
905
964
 
@@ -907,13 +966,17 @@ module ProcessOut
907
966
  return_values = Array.new
908
967
 
909
968
  body = response.body
910
- body = body["transaction"]
911
- transaction = Transaction.new(@client)
912
- return_values.push(transaction.fill_with_data(body))
969
+ body = body.key?("transaction") ? body["transaction"] : nil
970
+ if !body.nil?
971
+ transaction = Transaction.new(@client)
972
+ return_values.push(transaction.fill_with_data(body))
973
+ end
913
974
  body = response.body
914
- body = body["customer_action"]
915
- customer_action = CustomerAction.new(@client)
916
- return_values.push(customer_action.fill_with_data(body))
975
+ body = body.key?("customer_action") ? body["customer_action"] : nil
976
+ if !body.nil?
977
+ customer_action = CustomerAction.new(@client)
978
+ return_values.push(customer_action.fill_with_data(body))
979
+ end
917
980
 
918
981
 
919
982
  return_values
@@ -935,9 +998,11 @@ module ProcessOut
935
998
  return_values = Array.new
936
999
 
937
1000
  body = response.body
938
- body = body["customer"]
939
- customer = Customer.new(@client)
940
- return_values.push(customer.fill_with_data(body))
1001
+ body = body.key?("customer") ? body["customer"] : nil
1002
+ if !body.nil?
1003
+ customer = Customer.new(@client)
1004
+ return_values.push(customer.fill_with_data(body))
1005
+ end
941
1006
 
942
1007
 
943
1008
  return_values[0]
@@ -960,9 +1025,11 @@ module ProcessOut
960
1025
  return_values = Array.new
961
1026
 
962
1027
  body = response.body
963
- body = body["customer"]
964
- customer = Customer.new(@client)
965
- return_values.push(customer.fill_with_data(body))
1028
+ body = body.key?("customer") ? body["customer"] : nil
1029
+ if !body.nil?
1030
+ customer = Customer.new(@client)
1031
+ return_values.push(customer.fill_with_data(body))
1032
+ end
966
1033
 
967
1034
 
968
1035
  return_values[0]
@@ -980,6 +1047,7 @@ module ProcessOut
980
1047
  path = "/invoices/" + CGI.escape(@id) + "/payout"
981
1048
  data = {
982
1049
  "force_gateway_configuration_id" => options.fetch(:force_gateway_configuration_id, nil),
1050
+ "metadata" => options.fetch(:metadata, nil),
983
1051
  "gateway_configuration_id" => gateway_configuration_id,
984
1052
  "source" => source
985
1053
  }
@@ -988,9 +1056,11 @@ module ProcessOut
988
1056
  return_values = Array.new
989
1057
 
990
1058
  body = response.body
991
- body = body["transaction"]
992
- transaction = Transaction.new(@client)
993
- return_values.push(transaction.fill_with_data(body))
1059
+ body = body.key?("transaction") ? body["transaction"] : nil
1060
+ if !body.nil?
1061
+ transaction = Transaction.new(@client)
1062
+ return_values.push(transaction.fill_with_data(body))
1063
+ end
994
1064
 
995
1065
 
996
1066
  return_values[0]
@@ -1014,9 +1084,11 @@ module ProcessOut
1014
1084
  return_values = Array.new
1015
1085
 
1016
1086
  body = response.body
1017
- body = body["native_apm"]
1018
- native_apm_transaction_details = NativeAPMTransactionDetails.new(@client)
1019
- return_values.push(native_apm_transaction_details.fill_with_data(body))
1087
+ body = body.key?("native_apm") ? body["native_apm"] : nil
1088
+ if !body.nil?
1089
+ native_apm_transaction_details = NativeAPMTransactionDetails.new(@client)
1090
+ return_values.push(native_apm_transaction_details.fill_with_data(body))
1091
+ end
1020
1092
 
1021
1093
 
1022
1094
  return_values[0]
@@ -1040,13 +1112,17 @@ module ProcessOut
1040
1112
  return_values = Array.new
1041
1113
 
1042
1114
  body = response.body
1043
- body = body["transaction"]
1044
- transaction = Transaction.new(@client)
1045
- return_values.push(transaction.fill_with_data(body))
1115
+ body = body.key?("transaction") ? body["transaction"] : nil
1116
+ if !body.nil?
1117
+ transaction = Transaction.new(@client)
1118
+ return_values.push(transaction.fill_with_data(body))
1119
+ end
1046
1120
  body = response.body
1047
- body = body["native_apm"]
1048
- native_apm_response = NativeAPMResponse.new(@client)
1049
- return_values.push(native_apm_response.fill_with_data(body))
1121
+ body = body.key?("native_apm") ? body["native_apm"] : nil
1122
+ if !body.nil?
1123
+ native_apm_response = NativeAPMResponse.new(@client)
1124
+ return_values.push(native_apm_response.fill_with_data(body))
1125
+ end
1050
1126
 
1051
1127
 
1052
1128
  return_values
@@ -1070,9 +1146,11 @@ module ProcessOut
1070
1146
  return_values = Array.new
1071
1147
 
1072
1148
  body = response.body
1073
- body = body["customer_action"]
1074
- customer_action = CustomerAction.new(@client)
1075
- return_values.push(customer_action.fill_with_data(body))
1149
+ body = body.key?("customer_action") ? body["customer_action"] : nil
1150
+ if !body.nil?
1151
+ customer_action = CustomerAction.new(@client)
1152
+ return_values.push(customer_action.fill_with_data(body))
1153
+ end
1076
1154
 
1077
1155
 
1078
1156
  return_values[0]
@@ -1094,9 +1172,11 @@ module ProcessOut
1094
1172
  return_values = Array.new
1095
1173
 
1096
1174
  body = response.body
1097
- body = body["transaction"]
1098
- transaction = Transaction.new(@client)
1099
- return_values.push(transaction.fill_with_data(body))
1175
+ body = body.key?("transaction") ? body["transaction"] : nil
1176
+ if !body.nil?
1177
+ transaction = Transaction.new(@client)
1178
+ return_values.push(transaction.fill_with_data(body))
1179
+ end
1100
1180
 
1101
1181
 
1102
1182
  return_values[0]
@@ -1119,9 +1199,11 @@ module ProcessOut
1119
1199
  return_values = Array.new
1120
1200
 
1121
1201
  body = response.body
1122
- body = body["transaction"]
1123
- transaction = Transaction.new(@client)
1124
- return_values.push(transaction.fill_with_data(body))
1202
+ body = body.key?("transaction") ? body["transaction"] : nil
1203
+ if !body.nil?
1204
+ transaction = Transaction.new(@client)
1205
+ return_values.push(transaction.fill_with_data(body))
1206
+ end
1125
1207
 
1126
1208
 
1127
1209
  return_values[0]
@@ -1174,6 +1256,7 @@ module ProcessOut
1174
1256
  "metadata" => @metadata,
1175
1257
  "details" => @details,
1176
1258
  "submerchant" => @submerchant,
1259
+ "submerchant_id" => @submerchant_id,
1177
1260
  "reference_id" => @reference_id,
1178
1261
  "exemption_reason_3ds2" => @exemption_reason_3ds2,
1179
1262
  "sca_exemption_reason" => @sca_exemption_reason,
@@ -1208,7 +1291,7 @@ module ProcessOut
1208
1291
  return_values = Array.new
1209
1292
 
1210
1293
  body = response.body
1211
- body = body["invoice"]
1294
+ body = body.key?("invoice") ? body["invoice"] : nil
1212
1295
 
1213
1296
 
1214
1297
  return_values.push(self.fill_with_data(body))
@@ -1235,7 +1318,7 @@ module ProcessOut
1235
1318
  return_values = Array.new
1236
1319
 
1237
1320
  body = response.body
1238
- body = body["invoice"]
1321
+ body = body.key?("invoice") ? body["invoice"] : nil
1239
1322
 
1240
1323
 
1241
1324
  obj = Invoice.new(@client)
@@ -1285,7 +1368,7 @@ module ProcessOut
1285
1368
  return_values = Array.new
1286
1369
 
1287
1370
  body = response.body
1288
- body = body["invoice"]
1371
+ body = body.key?("invoice") ? body["invoice"] : nil
1289
1372
 
1290
1373
 
1291
1374
  obj = Invoice.new(@client)
@@ -1316,7 +1399,7 @@ module ProcessOut
1316
1399
  return_values = Array.new
1317
1400
 
1318
1401
  body = response.body
1319
- body = body["invoice"]
1402
+ body = body.key?("invoice") ? body["invoice"] : nil
1320
1403
 
1321
1404
 
1322
1405
  return_values.push(self.fill_with_data(body))
@@ -9,6 +9,7 @@ module ProcessOut
9
9
  class InvoiceDevice
10
10
 
11
11
  attr_reader :channel
12
+ attr_reader :platform
12
13
  attr_reader :ip_address
13
14
  attr_reader :id
14
15
 
@@ -17,6 +18,10 @@ module ProcessOut
17
18
  @channel = val
18
19
  end
19
20
 
21
+ def platform=(val)
22
+ @platform = val
23
+ end
24
+
20
25
  def ip_address=(val)
21
26
  @ip_address = val
22
27
  end
@@ -34,6 +39,7 @@ module ProcessOut
34
39
  @client = client
35
40
 
36
41
  self.channel = data.fetch(:channel, nil)
42
+ self.platform = data.fetch(:platform, nil)
37
43
  self.ip_address = data.fetch(:ip_address, nil)
38
44
  self.id = data.fetch(:id, nil)
39
45
 
@@ -48,6 +54,7 @@ module ProcessOut
48
54
  def to_json(options)
49
55
  {
50
56
  "channel": self.channel,
57
+ "platform": self.platform,
51
58
  "ip_address": self.ip_address,
52
59
  "id": self.id,
53
60
  }.to_json
@@ -63,6 +70,9 @@ module ProcessOut
63
70
  if data.include? "channel"
64
71
  self.channel = data["channel"]
65
72
  end
73
+ if data.include? "platform"
74
+ self.platform = data["platform"]
75
+ end
66
76
  if data.include? "ip_address"
67
77
  self.ip_address = data["ip_address"]
68
78
  end
@@ -81,6 +91,7 @@ module ProcessOut
81
91
  return self
82
92
  end
83
93
  self.channel = data.fetch(:channel, self.channel)
94
+ self.platform = data.fetch(:platform, self.platform)
84
95
  self.ip_address = data.fetch(:ip_address, self.ip_address)
85
96
  self.id = data.fetch(:id, self.id)
86
97
 
@@ -11,6 +11,7 @@ module ProcessOut
11
11
  attr_reader :forter
12
12
  attr_reader :ravelin
13
13
  attr_reader :signifyd
14
+ attr_reader :riskified
14
15
 
15
16
 
16
17
  def forter=(val)
@@ -28,6 +29,11 @@ module ProcessOut
28
29
 
29
30
  end
30
31
 
32
+ def riskified=(val)
33
+ @riskified = val
34
+
35
+ end
36
+
31
37
 
32
38
  # Initializes the InvoiceExternalFraudTools object
33
39
  # Params:
@@ -39,6 +45,7 @@ module ProcessOut
39
45
  self.forter = data.fetch(:forter, nil)
40
46
  self.ravelin = data.fetch(:ravelin, nil)
41
47
  self.signifyd = data.fetch(:signifyd, nil)
48
+ self.riskified = data.fetch(:riskified, nil)
42
49
 
43
50
  end
44
51
 
@@ -53,6 +60,7 @@ module ProcessOut
53
60
  "forter": self.forter,
54
61
  "ravelin": self.ravelin,
55
62
  "signifyd": self.signifyd,
63
+ "riskified": self.riskified,
56
64
  }.to_json
57
65
  end
58
66
 
@@ -72,6 +80,9 @@ module ProcessOut
72
80
  if data.include? "signifyd"
73
81
  self.signifyd = data["signifyd"]
74
82
  end
83
+ if data.include? "riskified"
84
+ self.riskified = data["riskified"]
85
+ end
75
86
 
76
87
  self
77
88
  end
@@ -86,6 +97,7 @@ module ProcessOut
86
97
  self.forter = data.fetch(:forter, self.forter)
87
98
  self.ravelin = data.fetch(:ravelin, self.ravelin)
88
99
  self.signifyd = data.fetch(:signifyd, self.signifyd)
100
+ self.riskified = data.fetch(:riskified, self.riskified)
89
101
 
90
102
  self
91
103
  end
@@ -13,7 +13,7 @@ module ProcessOut
13
13
  req.basic_auth @client.project_id, @client.project_secret
14
14
  req.content_type = "application/json"
15
15
  req["API-Version"] = "1.4.0.0"
16
- req["User-Agent"] = "ProcessOut Ruby-Bindings/3.4.0"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/6.0.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -0,0 +1,93 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class PaymentProcessingConfiguration
10
+
11
+ attr_reader :bypass_unsupported_split_payments
12
+ attr_reader :apm_payment_config
13
+
14
+
15
+ def bypass_unsupported_split_payments=(val)
16
+ @bypass_unsupported_split_payments = val
17
+ end
18
+
19
+ def apm_payment_config=(val)
20
+ if val.nil?
21
+ @apm_payment_config = val
22
+ return
23
+ end
24
+
25
+ if val.instance_of? APMPaymentProcessingConfiguration
26
+ @apm_payment_config = val
27
+ else
28
+ obj = APMPaymentProcessingConfiguration.new(@client)
29
+ obj.fill_with_data(val)
30
+ @apm_payment_config = obj
31
+ end
32
+
33
+ end
34
+
35
+
36
+ # Initializes the PaymentProcessingConfiguration object
37
+ # Params:
38
+ # +client+:: +ProcessOut+ client instance
39
+ # +data+:: data that can be used to fill the object
40
+ def initialize(client, data = {})
41
+ @client = client
42
+
43
+ self.bypass_unsupported_split_payments = data.fetch(:bypass_unsupported_split_payments, nil)
44
+ self.apm_payment_config = data.fetch(:apm_payment_config, nil)
45
+
46
+ end
47
+
48
+ # Create a new PaymentProcessingConfiguration using the current client
49
+ def new(data = {})
50
+ PaymentProcessingConfiguration.new(@client, data)
51
+ end
52
+
53
+ # Overrides the JSON marshaller to only send the fields we want
54
+ def to_json(options)
55
+ {
56
+ "bypass_unsupported_split_payments": self.bypass_unsupported_split_payments,
57
+ "apm_payment_config": self.apm_payment_config,
58
+ }.to_json
59
+ end
60
+
61
+ # Fills the object with data coming from the API
62
+ # Params:
63
+ # +data+:: +Hash+ of data coming from the API
64
+ def fill_with_data(data)
65
+ if data.nil?
66
+ return self
67
+ end
68
+ if data.include? "bypass_unsupported_split_payments"
69
+ self.bypass_unsupported_split_payments = data["bypass_unsupported_split_payments"]
70
+ end
71
+ if data.include? "apm_payment_config"
72
+ self.apm_payment_config = data["apm_payment_config"]
73
+ end
74
+
75
+ self
76
+ end
77
+
78
+ # Prefills the object with the data passed as parameters
79
+ # Params:
80
+ # +data+:: +Hash+ of data
81
+ def prefill(data)
82
+ if data.nil?
83
+ return self
84
+ end
85
+ self.bypass_unsupported_split_payments = data.fetch(:bypass_unsupported_split_payments, self.bypass_unsupported_split_payments)
86
+ self.apm_payment_config = data.fetch(:apm_payment_config, self.apm_payment_config)
87
+
88
+ self
89
+ end
90
+
91
+
92
+ end
93
+ end