All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kaltura.client.services.TransactionService Maven / Gradle / Ivy

Go to download

KalturaOttApiClient is a library of Java classes that can be used to interact with the Kaltura OTT REST API. More information about the REST API can be found at https://ott.developer.kaltura.com/ Many of the Java classes in this library are auto-generated from a schema that defines the objects that are used to interact with the API.

There is a newer version: 5.1.2.17630
Show newest version
// ===================================================================================================
//                           _  __     _ _
//                          | |/ /__ _| | |_ _  _ _ _ __ _
//                          | ' .
//
// @ignore
// ===================================================================================================
package com.kaltura.client.services;

import com.kaltura.client.enums.TransactionType;
import com.kaltura.client.types.ExternalReceipt;
import com.kaltura.client.types.Purchase;
import com.kaltura.client.types.PurchaseSession;
import com.kaltura.client.types.Transaction;
import com.kaltura.client.types.TransactionStatus;
import com.kaltura.client.utils.request.NullRequestBuilder;
import com.kaltura.client.utils.request.RequestBuilder;

/**
 * This class was generated using clients-generator\exec.php
 * against an XML schema provided by Kaltura.
 * 
 * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN.
 */

public class TransactionService {
	
	public static class GetPurchaseSessionIdTransactionBuilder extends RequestBuilder {
		
		public GetPurchaseSessionIdTransactionBuilder(PurchaseSession purchaseSession) {
			super(Long.class, "transaction", "getPurchaseSessionId");
			params.add("purchaseSession", purchaseSession);
		}
	}

	/**
	 * Retrieve the purchase session identifier
	 * 
	 * @param purchaseSession Purchase properties
	 */
    public static GetPurchaseSessionIdTransactionBuilder getPurchaseSessionId(PurchaseSession purchaseSession)  {
		return new GetPurchaseSessionIdTransactionBuilder(purchaseSession);
	}
	
	public static class PurchaseTransactionBuilder extends RequestBuilder {
		
		public PurchaseTransactionBuilder(Purchase purchase) {
			super(Transaction.class, "transaction", "purchase");
			params.add("purchase", purchase);
		}
	}

	/**
	 * Purchase specific product or subscription for a household. Upon successful
	  charge entitlements to use the requested product or subscription are granted.
	 * 
	 * @param purchase Purchase properties
	 */
    public static PurchaseTransactionBuilder purchase(Purchase purchase)  {
		return new PurchaseTransactionBuilder(purchase);
	}
	
	public static class SetWaiverTransactionBuilder extends RequestBuilder {
		
		public SetWaiverTransactionBuilder(int assetId, TransactionType transactionType) {
			super(Boolean.class, "transaction", "setWaiver");
			params.add("assetId", assetId);
			params.add("transactionType", transactionType);
		}
		
		public void assetId(String multirequestToken) {
			params.add("assetId", multirequestToken);
		}
		
		public void transactionType(String multirequestToken) {
			params.add("transactionType", multirequestToken);
		}
	}

	/**
	 * This method shall set the waiver flag on the user entitlement table and the
	  waiver date field to the current date.
	 * 
	 * @param assetId Asset identifier
	 * @param transactionType The transaction type
	 */
    public static SetWaiverTransactionBuilder setWaiver(int assetId, TransactionType transactionType)  {
		return new SetWaiverTransactionBuilder(assetId, transactionType);
	}
	
	public static class UpdateStatusTransactionBuilder extends NullRequestBuilder {
		
		public UpdateStatusTransactionBuilder(String paymentGatewayId, String externalTransactionId, String signature, TransactionStatus status) {
			super("transaction", "updateStatus");
			params.add("paymentGatewayId", paymentGatewayId);
			params.add("externalTransactionId", externalTransactionId);
			params.add("signature", signature);
			params.add("status", status);
		}
		
		public void paymentGatewayId(String multirequestToken) {
			params.add("paymentGatewayId", multirequestToken);
		}
		
		public void externalTransactionId(String multirequestToken) {
			params.add("externalTransactionId", multirequestToken);
		}
		
		public void signature(String multirequestToken) {
			params.add("signature", multirequestToken);
		}
	}

	/**
	 * Updates a pending purchase transaction state.
	 * 
	 * @param paymentGatewayId Payment gateway identifier
	 * @param externalTransactionId external transaction identifier
	 * @param signature Security signature to validate the caller is a payment gateway adapter
	 * application
	 * @param status Status properties
	 */
    public static UpdateStatusTransactionBuilder updateStatus(String paymentGatewayId, String externalTransactionId, String signature, TransactionStatus status)  {
		return new UpdateStatusTransactionBuilder(paymentGatewayId, externalTransactionId, signature, status);
	}
	
	public static class ValidateReceiptTransactionBuilder extends RequestBuilder {
		
		public ValidateReceiptTransactionBuilder(ExternalReceipt externalReceipt) {
			super(Transaction.class, "transaction", "validateReceipt");
			params.add("externalReceipt", externalReceipt);
		}
	}

	/**
	 * Verifies PPV/Subscription/Collection client purchase (such as InApp) and
	  entitles the user.
	 * 
	 * @param externalReceipt Receipt properties
	 */
    public static ValidateReceiptTransactionBuilder validateReceipt(ExternalReceipt externalReceipt)  {
		return new ValidateReceiptTransactionBuilder(externalReceipt);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy