Class: MastercardMerchantCheckout::Api::PostbackApi

Inherits:
Object
  • Object
show all
Includes:
MastercardCoreSdk::Client, MastercardCoreSdk::Core, MastercardCoreSdk::Exceptions, Tracker
Defined in:
lib/mastercard_merchant_checkout/api/postback_api.rb

Class Method Summary collapse

Class Method Details

.create(postback, api_config = nil) ⇒ nil

Postback Service This is the final step in the transaction and reports the result of their transactions to Masterpass. Postback is required for all transactions (abandoned transactions do not need to be reported). API URL: /masterpass/postback

Parameters:

  • postback

    This is the merchant’s transaction details.

  • api_config (defaults to: nil)

    Optional ApiConfig object specifying configuration : consumer key, private key, host URL.

Returns:

  • (nil)


19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mastercard_merchant_checkout/api/postback_api.rb', line 19

def self.create(postback, api_config = nil)
		 path = "/masterpass/postback"
service_request = ServiceRequest.new
 

service_request.body = postback
	 
service_request.content_type = "application/json"
api_client = ApiClient.new(api_config)
 api_client.api_tracker = SdkApiTracker.new
 api_client.error_handler = ErrorHandler.new
return api_client.call(path, service_request, "POST",nil)
end