Difference between revisions of "CreatePurchase"
Jump to navigation
Jump to search
(6 intermediate revisions by 3 users not shown) | |||
Line 18: | Line 18: | ||
{{Api_Parameter| | {{Api_Parameter| | ||
ParamName=productType | ParamName=productType | ||
− | |ParamType= | + | |ParamType=[[ProductType]] |
|ParamRequired=required | |ParamRequired=required | ||
|ParamDescription=This use case deals with subscriptions. | |ParamDescription=This use case deals with subscriptions. | ||
Line 26: | Line 26: | ||
|ParamType=int | |ParamType=int | ||
|ParamRequired=required | |ParamRequired=required | ||
− | |ParamDescription= | + | |ParamDescription=[[PricingModel]] Id |
}} | }} | ||
{{Api_Parameter| | {{Api_Parameter| | ||
Line 51: | Line 51: | ||
|ParamRequired=required | |ParamRequired=required | ||
|ParamDescription=This parameter makes sense only with paypal an ewallet payment methods. | |ParamDescription=This parameter makes sense only with paypal an ewallet payment methods. | ||
+ | }} | ||
+ | '''NEW IN 8.2!''' | ||
+ | {{Api_Parameter| | ||
+ | ParamName=TrackId | ||
+ | |ParamType=String | ||
+ | |ParamRequired=optional | ||
+ | |ParamDescription=Recommendation Id | ||
+ | }} | ||
+ | {{Api_Parameter| | ||
+ | ParamName=UxReference | ||
+ | |ParamType=String | ||
+ | |ParamRequired=optional | ||
+ | |ParamDescription=Recommendation Reference | ||
}} | }} | ||
Line 68: | Line 81: | ||
|Exceptions= | |Exceptions= | ||
− | * [[AuthenticationRequired]] --> If user Anonymous | + | * 30 - [[AuthenticationRequired]] --> If user Anonymous |
− | * [[UserPurchasePinValueNoMatch]] --> if user pin doesn't match or sent empty | + | * 62 - [[UserPurchasePinValueNoMatch]] --> if user pin doesn't match or sent empty |
− | * [[InvalidPaymentType]] --> if paymentType = Unknown or PaymentType not in product payment types | + | * 100 - [[InvalidPaymentType]] --> if paymentType = Unknown or PaymentType not in product payment types |
− | * [[UserDoesNotHaveMandatorySubscription]] --> If mandatory subscription is active, User has not purchase it, and user is trying to buy a product != MandatorySubscription | + | * 113 - [[UserDoesNotHaveMandatorySubscription]] --> If mandatory subscription is active, User has not purchase it, and user is trying to buy a product != MandatorySubscription |
− | * [[InvalidReturnOrCancelURL]] --> if paymentType = Paypal, webpay or worldpay and returnUrl or cancelURl empty or null | + | * 130 - [[InvalidReturnOrCancelURL]] --> if paymentType = Paypal, webpay or worldpay and returnUrl or cancelURl empty or null |
− | * [[InsufficientBalance]] --> if (paymentType = eWallet) && (User.eWallet < Price) | + | * 87 - [[InsufficientBalance]] --> if (paymentType = eWallet) && (User.eWallet < Price) |
− | * [[ProductDoesNotExist]] --> if (product = null or product.ID <= 0) | + | * 109 - [[ProductDoesNotExist]] --> if (product = null or product.ID <= 0) |
− | * [[UserAlreadyHasProduct]] --> if product has been already bought | + | * 23 - [[UserAlreadyHasProduct]] --> if product has been already bought |
− | * [[InvalidPricingModelForThisProduct]] --> if pricingModel is not in the list of Available pricing models for this product | + | * 82 - [[InvalidPricingModelForThisProduct]] --> if pricingModel is not in the list of Available pricing models for this product |
− | * [[PendingProductCanNotBePurchased]] --> if product.CanWatch == -2 (Pending purchase) | + | * 150 - [[PendingProductCanNotBePurchased]] --> if product.CanWatch == -2 (Pending purchase) |
− | * [[ProductNotAvailableYet]] --> if (dateStart > DateTime.Now) Commercialization window has not begun | + | * 122 - [[ProductNotAvailableYet]] --> if (dateStart > DateTime.Now) Commercialization window has not begun |
− | * [[ProductExpired]] --> if (dateEnd < DateTime.Now) Commercialization window has finished | + | * 123 - [[ProductExpired]] --> if (dateEnd < DateTime.Now) Commercialization window has finished |
− | * [[UserCantAcquire]] --> if canAquire = false (in this poing status != available in stock or no DeviceAvailability for current deviceType) | + | * 96 - [[UserCantAcquire]] --> if canAquire = false (in this poing status != available in stock or no DeviceAvailability for current deviceType) |
− | * [[SubscriptionNotAvailableForPurchaseType]] --> if (ProductType == Subscription and PurchaseType.ProvisioningOnly) | + | * 153 - [[SubscriptionNotAvailableForPurchaseType]] --> if (ProductType == Subscription and PurchaseType.ProvisioningOnly) |
− | * [[WebpayIsntAvailableForRecurringPayment]] --> if paymentType = WebPay && PricingModel.IsRecurring | + | * 146 - [[WebpayIsntAvailableForRecurringPayment]] --> if paymentType = WebPay && PricingModel.IsRecurring |
− | * [[NoCreditsRegistered]] --> if productType == credit and productId doesn't exist | + | * 47 - [[NoCreditsRegistered]] --> if productType == credit and productId doesn't exist |
− | * [[InvalidProductForInstance]] --> if productType == credit and credit belongs to other instance | + | * 55 - [[InvalidProductForInstance]] --> if productType == credit and credit belongs to other instance |
− | * [[InvalidPricingModel]] --> if (pricingModel == null | + | * 86 - [[InvalidPricingModel]] --> if (pricingModel == null OR pricingModel.ID == 0) && (productType != ProductType.Credit) |
− | * [[InvalidPricingModelForThisProduct]] --> if pricingModel.instance != current instance | + | * 82 -[[InvalidPricingModelForThisProduct]] --> if pricingModel.instance != current instance |
− | * [[GenericError]] --> CreateInternalPurchase or createExternalPurchase SQL exception | + | * 128 - [[GenericError]] --> CreateInternalPurchase or createExternalPurchase SQL exception |
− | * [[PurchaseProcessFailed]] --> if PaymentType == Billing && OB synchronous mode && sync error | + | * 85 - [[PurchaseProcessFailed]] --> if PaymentType == Billing && OB synchronous mode && sync error |
− | * [[InvalidTransactionId]] --> if PaymentType == eWallet and error with transactionID | + | * 48 - [[InvalidTransactionId]] --> if PaymentType == eWallet and error with transactionID |
− | * [[PurchaseNotFound]] --> if PaymentType == eWallet and error with purchase | + | * 164 - [[PurchaseNotFound]] --> if PaymentType == eWallet and error with purchase |
− | * [[InvalidInstance]] --> if instance != purchaseInstance (Can`t happen) | + | * 39 - [[InvalidInstance]] --> if instance != purchaseInstance (Can`t happen) |
− | * [[InvalidDeviceType]] --> if purchaseDeviceType != currentDeviceType (Can`t happen) | + | * 15 - [[InvalidDeviceType]] --> if purchaseDeviceType != currentDeviceType (Can`t happen) |
− | * [[InvalidUser]] --> if purchaseUser != currentUser (Can`t happen) | + | * 36 - [[InvalidUser]] --> if purchaseUser != currentUser (Can`t happen) |
− | * [[UserRightInsertUpdateError]] --> Error insert userRights in BBDD | + | * 108 -[[UserRightInsertUpdateError]] --> Error insert userRights in BBDD |
|Cache= | |Cache= | ||
Line 112: | Line 125: | ||
{{!}} Initial method design | {{!}} Initial method design | ||
{{!}} Harley Cabral | {{!}} Harley Cabral | ||
+ | {{!}}- valign="top" | ||
+ | ! 3.2 | ||
+ | {{!}} Enabled TVOD purchase of Series | ||
+ | {{!}} Pedro Caamaño | ||
{{!}}} | {{!}}} | ||
|SeeAlso= | |SeeAlso= | ||
}} | }} |
Latest revision as of 13:08, 10 August 2020
Description
Create a purchase for product
Parameters
- token (String, required)
- A valid token for identifying the API session context and logged user.
- productId (int, required)
- Product Id of the subscription to be purchased
- productType (ProductType, required)
- This use case deals with subscriptions.
- pricingModelId (int, required)
- PricingModel Id
- paymentType (PaymentType, required)
- pin (String, required)
- User purchase PIN
- returnURL (String, required)
- This parameter makes sense only with paypal an ewallet payment methods.
- cancelURL (String, required)
- This parameter makes sense only with paypal an ewallet payment methods.
NEW IN 8.2!
- TrackId (String, optional)
- Recommendation Id
- UxReference (String, optional)
- Recommendation Reference
Returns
Returns a JSON with a PurchaseResponse object containing information that Purchase has been created with success.
Example:
{
- "Offset": 0,
- "Limit": 100,
- "Count": 6,
- "Content": [
- PurchaseResponse object
- ]
}
Exceptions
- 30 - AuthenticationRequired --> If user Anonymous
- 62 - UserPurchasePinValueNoMatch --> if user pin doesn't match or sent empty
- 100 - InvalidPaymentType --> if paymentType = Unknown or PaymentType not in product payment types
- 113 - UserDoesNotHaveMandatorySubscription --> If mandatory subscription is active, User has not purchase it, and user is trying to buy a product != MandatorySubscription
- 130 - InvalidReturnOrCancelURL --> if paymentType = Paypal, webpay or worldpay and returnUrl or cancelURl empty or null
- 87 - InsufficientBalance --> if (paymentType = eWallet) && (User.eWallet < Price)
- 109 - ProductDoesNotExist --> if (product = null or product.ID <= 0)
- 23 - UserAlreadyHasProduct --> if product has been already bought
- 82 - InvalidPricingModelForThisProduct --> if pricingModel is not in the list of Available pricing models for this product
- 150 - PendingProductCanNotBePurchased --> if product.CanWatch == -2 (Pending purchase)
- 122 - ProductNotAvailableYet --> if (dateStart > DateTime.Now) Commercialization window has not begun
- 123 - ProductExpired --> if (dateEnd < DateTime.Now) Commercialization window has finished
- 96 - UserCantAcquire --> if canAquire = false (in this poing status != available in stock or no DeviceAvailability for current deviceType)
- 153 - SubscriptionNotAvailableForPurchaseType --> if (ProductType == Subscription and PurchaseType.ProvisioningOnly)
- 146 - WebpayIsntAvailableForRecurringPayment --> if paymentType = WebPay && PricingModel.IsRecurring
- 47 - NoCreditsRegistered --> if productType == credit and productId doesn't exist
- 55 - InvalidProductForInstance --> if productType == credit and credit belongs to other instance
- 86 - InvalidPricingModel --> if (pricingModel == null OR pricingModel.ID == 0) && (productType != ProductType.Credit)
- 82 -InvalidPricingModelForThisProduct --> if pricingModel.instance != current instance
- 128 - GenericError --> CreateInternalPurchase or createExternalPurchase SQL exception
- 85 - PurchaseProcessFailed --> if PaymentType == Billing && OB synchronous mode && sync error
- 48 - InvalidTransactionId --> if PaymentType == eWallet and error with transactionID
- 164 - PurchaseNotFound --> if PaymentType == eWallet and error with purchase
- 39 - InvalidInstance --> if instance != purchaseInstance (Can`t happen)
- 15 - InvalidDeviceType --> if purchaseDeviceType != currentDeviceType (Can`t happen)
- 36 - InvalidUser --> if purchaseUser != currentUser (Can`t happen)
- 108 -UserRightInsertUpdateError --> Error insert userRights in BBDD
Caching
This method is not cached.
Known issues
None
Version history
API Version Number | Change description | Changes author |
---|---|---|
1.0 | Initial method design | Harley Cabral |
3.2 | Enabled TVOD purchase of Series | Pedro Caamaño |