Module: PaymentGateway
- Included in:
- TessituraRest
- Defined in:
- lib/tessitura_rest/payment_gateway/payment_gateway.rb
Instance Method Summary collapse
- #authorize_payment(amount, store_card, payload, payment_id, return_url, constituent_id, shopper_ip, address, options = {}) ⇒ Object
- #finalize_payment(payload, payment_id, store_account, options = {}) ⇒ Object
- #reversal_request(amount, reference_number, payment_id, options = {}) ⇒ Object
Instance Method Details
#authorize_payment(amount, store_card, payload, payment_id, return_url, constituent_id, shopper_ip, address, options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tessitura_rest/payment_gateway/payment_gateway.rb', line 2 def (amount, store_card, payload, payment_id, return_url, constituent_id, shopper_ip, address, = {}) parameters = { 'Amount': amount, 'StoreAccount': store_card, 'Card': { 'TessituraMerchantServicesData': payload, }, 'PaymentId': payment_id, 'ConstituentId': constituent_id, 'TransactionOrigin': 'webapi', 'PaymentMethodId': 606, 'ReturnUrl': return_url, 'IsECommerce': true, 'ShopperIp': shopper_ip, 'BillingAddress': { 'PostalCode': address.postal_code, 'Street1': address.street1, 'AddressId': address.id, 'Country': address.country_iso2_code, }, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint('PaymentGateway/Authorization/Authorize'), ) end |
#finalize_payment(payload, payment_id, store_account, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/tessitura_rest/payment_gateway/payment_gateway.rb', line 28 def finalize_payment(payload, payment_id, store_account, = {}) parameters = { 'PaymentId': payment_id, 'RedirectResult': payload, 'StoreAccount': store_account, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint('PaymentGateway/Authorization/Finalize'), ) end |
#reversal_request(amount, reference_number, payment_id, options = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/tessitura_rest/payment_gateway/payment_gateway.rb', line 39 def reversal_request(amount, reference_number, payment_id, = {}) parameters = { 'Amount': amount, 'PaymentId': payment_id, 'TransactionOrigin': 'webapi', 'PaymentMethodId': 606, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("PaymentGateway/Authorization/#{reference_number}/Reverse"), ) end |