class MastercardMasterpassMerchant::Api::PrecheckoutDataApi

Public Class Methods

create(oauth_token, precheckout_data_request, api_config = nil) click to toggle source

Precheckout Data Service. MasterPass provides merchants with the ability to request a paired consumer's data (card alias, shipping addresses, reward program, and profile information) prior to the actual MasterPass checkout. This gives the merchant the ability to provide the consumer the opportunity to preselect their checkout options before completing the checkout. If, for any reason, the precheckout call gets rejected at MasterPass (merchant requests data that the consumer did not originally consent to, if the pairing has been deleted by the user, if the Long Access token has expired, and so on), the merchant has to request pairing again. @param oauth_token Long access token, which is used to retrieve precheckout data. @param precheckout_data_request PreCheckout Data Request. @param api_config Optional ApiConfig object specifying configuration : consumer key, private key, host URL. @return [PrecheckoutDataResponse]

# File lib/mastercard_masterpass_merchant/api/precheckout_data_api.rb, line 21
def self.create(oauth_token, precheckout_data_request, api_config = nil)
             path = "/masterpass/v6/precheckout"
            service_request = ServiceRequest.new
 
       service_request.headers["oauth_token"] = oauth_token
     
       service_request.body = precheckout_data_request
     
       service_request.content_type = "application/xml"
       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",PrecheckoutDataResponse)
end