Class: Killbill::Plugin::Api::PaymentGatewayApi
- Defined in:
- lib/killbill/gen/api/payment_gateway_api.rb
Instance Method Summary collapse
- #build_form_descriptor(account, paymentMethodId, customFields, properties, context) ⇒ Object
- #build_form_descriptor_with_payment_control(account, paymentMethodId, customFields, properties, paymentOptions, context) ⇒ Object
-
#initialize(real_java_api) ⇒ PaymentGatewayApi
constructor
A new instance of PaymentGatewayApi.
- #process_notification(notification, pluginName, properties, context) ⇒ Object
- #process_notification_with_payment_control(notification, pluginName, properties, paymentOptions, context) ⇒ Object
Constructor Details
#initialize(real_java_api) ⇒ PaymentGatewayApi
Returns a new instance of PaymentGatewayApi.
37 38 39 |
# File 'lib/killbill/gen/api/payment_gateway_api.rb', line 37 def initialize(real_java_api) @real_java_api = real_java_api end |
Instance Method Details
#build_form_descriptor(account, paymentMethodId, customFields, properties, context) ⇒ Object
43 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 76 77 78 79 |
# File 'lib/killbill/gen/api/payment_gateway_api.rb', line 43 def build_form_descriptor(account, paymentMethodId, customFields, properties, context) # conversion for account [type = org.killbill.billing.account.api.Account] account = account.to_java unless account.nil? # conversion for paymentMethodId [type = java.util.UUID] paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil? # conversion for customFields [type = java.lang.Iterable] tmp = java.util.ArrayList.new (customFields || []).each do |m| # conversion for m [type = org.killbill.billing.payment.api.PluginProperty] m = m.to_java unless m.nil? tmp.add(m) end customFields = tmp # conversion for properties [type = java.lang.Iterable] tmp = java.util.ArrayList.new (properties || []).each do |m| # conversion for m [type = org.killbill.billing.payment.api.PluginProperty] m = m.to_java unless m.nil? tmp.add(m) end properties = tmp # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? begin res = @real_java_api.build_form_descriptor(account, paymentMethodId, customFields, properties, context) # conversion for res [type = org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor] res = Killbill::Plugin::Model::HostedPaymentPageFormDescriptor.new.to_ruby(res) unless res.nil? return res rescue Java::org.killbill.billing.payment.api.PaymentApiException => e raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e) end end |
#build_form_descriptor_with_payment_control(account, paymentMethodId, customFields, properties, paymentOptions, context) ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/killbill/gen/api/payment_gateway_api.rb', line 82 def build_form_descriptor_with_payment_control(account, paymentMethodId, customFields, properties, paymentOptions, context) # conversion for account [type = org.killbill.billing.account.api.Account] account = account.to_java unless account.nil? # conversion for paymentMethodId [type = java.util.UUID] paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil? # conversion for customFields [type = java.lang.Iterable] tmp = java.util.ArrayList.new (customFields || []).each do |m| # conversion for m [type = org.killbill.billing.payment.api.PluginProperty] m = m.to_java unless m.nil? tmp.add(m) end customFields = tmp # conversion for properties [type = java.lang.Iterable] tmp = java.util.ArrayList.new (properties || []).each do |m| # conversion for m [type = org.killbill.billing.payment.api.PluginProperty] m = m.to_java unless m.nil? tmp.add(m) end properties = tmp # conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions] paymentOptions = paymentOptions.to_java unless paymentOptions.nil? # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? begin res = @real_java_api.build_form_descriptor_with_payment_control(account, paymentMethodId, customFields, properties, paymentOptions, context) # conversion for res [type = org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor] res = Killbill::Plugin::Model::HostedPaymentPageFormDescriptor.new.to_ruby(res) unless res.nil? return res rescue Java::org.killbill.billing.payment.api.PaymentApiException => e raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e) end end |
#process_notification(notification, pluginName, properties, context) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/killbill/gen/api/payment_gateway_api.rb', line 124 def process_notification(notification, pluginName, properties, context) # conversion for notification [type = java.lang.String] notification = notification.to_s unless notification.nil? # conversion for pluginName [type = java.lang.String] pluginName = pluginName.to_s unless pluginName.nil? # conversion for properties [type = java.lang.Iterable] tmp = java.util.ArrayList.new (properties || []).each do |m| # conversion for m [type = org.killbill.billing.payment.api.PluginProperty] m = m.to_java unless m.nil? tmp.add(m) end properties = tmp # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? begin res = @real_java_api.process_notification(notification, pluginName, properties, context) # conversion for res [type = org.killbill.billing.payment.plugin.api.GatewayNotification] res = Killbill::Plugin::Model::GatewayNotification.new.to_ruby(res) unless res.nil? return res rescue Java::org.killbill.billing.payment.api.PaymentApiException => e raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e) end end |
#process_notification_with_payment_control(notification, pluginName, properties, paymentOptions, context) ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/killbill/gen/api/payment_gateway_api.rb', line 154 def process_notification_with_payment_control(notification, pluginName, properties, paymentOptions, context) # conversion for notification [type = java.lang.String] notification = notification.to_s unless notification.nil? # conversion for pluginName [type = java.lang.String] pluginName = pluginName.to_s unless pluginName.nil? # conversion for properties [type = java.lang.Iterable] tmp = java.util.ArrayList.new (properties || []).each do |m| # conversion for m [type = org.killbill.billing.payment.api.PluginProperty] m = m.to_java unless m.nil? tmp.add(m) end properties = tmp # conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions] paymentOptions = paymentOptions.to_java unless paymentOptions.nil? # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? begin res = @real_java_api.process_notification_with_payment_control(notification, pluginName, properties, paymentOptions, context) # conversion for res [type = org.killbill.billing.payment.plugin.api.GatewayNotification] res = Killbill::Plugin::Model::GatewayNotification.new.to_ruby(res) unless res.nil? return res rescue Java::org.killbill.billing.payment.api.PaymentApiException => e raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e) end end |