TicketUserServices

<back to all web services

GiftCardPurchaseRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdmin, MobileAppRequired permission:Tickets.Add
The following routes are available for this service:
POST/GiftCard/Purchase
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class GiftCardPurchaseRequest
    {
        public Integer giftCardTypeId = null;
        public Integer amountMinor = null;
        public String purchasePaymentReference = null;
        public Integer purchaseOwnerId = null;
        public String buyerName = null;
        public String buyerPhone = null;
        public String buyerEmail = null;
        public String recipientName = null;
        public String idempotencyKey = null;
        public String paymentMethodId = null;
        public String paymentId = null;
        public PaymentRequestCreditCard cardInfo = null;
        public Borgun3DFinalRequest borgun3DFinalInfo = null;
        public BorgunApplePayFinalInfo applePayInfo = null;
        
        public Integer getGiftCardTypeId() { return giftCardTypeId; }
        public GiftCardPurchaseRequest setGiftCardTypeId(Integer value) { this.giftCardTypeId = value; return this; }
        public Integer getAmountMinor() { return amountMinor; }
        public GiftCardPurchaseRequest setAmountMinor(Integer value) { this.amountMinor = value; return this; }
        public String getPurchasePaymentReference() { return purchasePaymentReference; }
        public GiftCardPurchaseRequest setPurchasePaymentReference(String value) { this.purchasePaymentReference = value; return this; }
        public Integer getPurchaseOwnerId() { return purchaseOwnerId; }
        public GiftCardPurchaseRequest setPurchaseOwnerId(Integer value) { this.purchaseOwnerId = value; return this; }
        public String getBuyerName() { return buyerName; }
        public GiftCardPurchaseRequest setBuyerName(String value) { this.buyerName = value; return this; }
        public String getBuyerPhone() { return buyerPhone; }
        public GiftCardPurchaseRequest setBuyerPhone(String value) { this.buyerPhone = value; return this; }
        public String getBuyerEmail() { return buyerEmail; }
        public GiftCardPurchaseRequest setBuyerEmail(String value) { this.buyerEmail = value; return this; }
        public String getRecipientName() { return recipientName; }
        public GiftCardPurchaseRequest setRecipientName(String value) { this.recipientName = value; return this; }
        public String getIdempotencyKey() { return idempotencyKey; }
        public GiftCardPurchaseRequest setIdempotencyKey(String value) { this.idempotencyKey = value; return this; }
        public String getPaymentMethodId() { return paymentMethodId; }
        public GiftCardPurchaseRequest setPaymentMethodId(String value) { this.paymentMethodId = value; return this; }
        public String getPaymentId() { return paymentId; }
        public GiftCardPurchaseRequest setPaymentId(String value) { this.paymentId = value; return this; }
        public PaymentRequestCreditCard getCardInfo() { return cardInfo; }
        public GiftCardPurchaseRequest setCardInfo(PaymentRequestCreditCard value) { this.cardInfo = value; return this; }
        public Borgun3DFinalRequest getBorgun3DFinalInfo() { return borgun3DFinalInfo; }
        public GiftCardPurchaseRequest setBorgun3DFinalInfo(Borgun3DFinalRequest value) { this.borgun3DFinalInfo = value; return this; }
        public BorgunApplePayFinalInfo getApplePayInfo() { return applePayInfo; }
        public GiftCardPurchaseRequest setApplePayInfo(BorgunApplePayFinalInfo value) { this.applePayInfo = value; return this; }
    }

    public static class PaymentRequestCreditCard
    {
        public PaymentMethodCreditCardInfo paymentMethod = null;
        public BigDecimal amount = null;
        public String currency = null;
        public String orderId = null;
        public Date transActionDate = null;
        public Boolean saveCardToToken = null;
        
        public PaymentMethodCreditCardInfo getPaymentMethod() { return paymentMethod; }
        public PaymentRequestCreditCard setPaymentMethod(PaymentMethodCreditCardInfo value) { this.paymentMethod = value; return this; }
        public BigDecimal getAmount() { return amount; }
        public PaymentRequestCreditCard setAmount(BigDecimal value) { this.amount = value; return this; }
        public String getCurrency() { return currency; }
        public PaymentRequestCreditCard setCurrency(String value) { this.currency = value; return this; }
        public String getOrderId() { return orderId; }
        public PaymentRequestCreditCard setOrderId(String value) { this.orderId = value; return this; }
        public Date getTransActionDate() { return transActionDate; }
        public PaymentRequestCreditCard setTransActionDate(Date value) { this.transActionDate = value; return this; }
        public Boolean isSaveCardToToken() { return saveCardToToken; }
        public PaymentRequestCreditCard setSaveCardToToken(Boolean value) { this.saveCardToToken = value; return this; }
    }

    public static class PaymentMethodCreditCardInfo
    {
        public String paymentType = null;
        public String token = null;
        public String pan = null;
        public String expYear = null;
        public String expMonth = null;
        public String cvc = null;
        
        public String getPaymentType() { return paymentType; }
        public PaymentMethodCreditCardInfo setPaymentType(String value) { this.paymentType = value; return this; }
        public String getToken() { return token; }
        public PaymentMethodCreditCardInfo setToken(String value) { this.token = value; return this; }
        public String getPan() { return pan; }
        public PaymentMethodCreditCardInfo setPan(String value) { this.pan = value; return this; }
        public String getExpYear() { return expYear; }
        public PaymentMethodCreditCardInfo setExpYear(String value) { this.expYear = value; return this; }
        public String getExpMonth() { return expMonth; }
        public PaymentMethodCreditCardInfo setExpMonth(String value) { this.expMonth = value; return this; }
        public String getCvc() { return cvc; }
        public PaymentMethodCreditCardInfo setCvc(String value) { this.cvc = value; return this; }
    }

    public static class Borgun3DFinalRequest
    {
        public String transactionType = null;
        public Integer amount = null;
        public String currency = null;
        public Date transactionDate = null;
        public String orderId = null;
        public Borgun3DFinalPaymentMethodInfo paymentMethod = null;
        public Borgun3DFinal3DSecureInfo threeDSecure = null;
        
        public String getTransactionType() { return transactionType; }
        public Borgun3DFinalRequest setTransactionType(String value) { this.transactionType = value; return this; }
        public Integer getAmount() { return amount; }
        public Borgun3DFinalRequest setAmount(Integer value) { this.amount = value; return this; }
        public String getCurrency() { return currency; }
        public Borgun3DFinalRequest setCurrency(String value) { this.currency = value; return this; }
        public Date getTransactionDate() { return transactionDate; }
        public Borgun3DFinalRequest setTransactionDate(Date value) { this.transactionDate = value; return this; }
        public String getOrderId() { return orderId; }
        public Borgun3DFinalRequest setOrderId(String value) { this.orderId = value; return this; }
        public Borgun3DFinalPaymentMethodInfo getPaymentMethod() { return paymentMethod; }
        public Borgun3DFinalRequest setPaymentMethod(Borgun3DFinalPaymentMethodInfo value) { this.paymentMethod = value; return this; }
        public Borgun3DFinal3DSecureInfo getThreeDSecure() { return threeDSecure; }
        public Borgun3DFinalRequest setThreeDSecure(Borgun3DFinal3DSecureInfo value) { this.threeDSecure = value; return this; }
    }

    public static class Borgun3DFinalPaymentMethodInfo
    {
        public String paymentType = null;
        public String token = null;
        public String virtualNumber = null;
        public String expYear = null;
        public String expMonth = null;
        public String panLastFour = null;
        
        public String getPaymentType() { return paymentType; }
        public Borgun3DFinalPaymentMethodInfo setPaymentType(String value) { this.paymentType = value; return this; }
        public String getToken() { return token; }
        public Borgun3DFinalPaymentMethodInfo setToken(String value) { this.token = value; return this; }
        public String getVirtualNumber() { return virtualNumber; }
        public Borgun3DFinalPaymentMethodInfo setVirtualNumber(String value) { this.virtualNumber = value; return this; }
        public String getExpYear() { return expYear; }
        public Borgun3DFinalPaymentMethodInfo setExpYear(String value) { this.expYear = value; return this; }
        public String getExpMonth() { return expMonth; }
        public Borgun3DFinalPaymentMethodInfo setExpMonth(String value) { this.expMonth = value; return this; }
        public String getPanLastFour() { return panLastFour; }
        public Borgun3DFinalPaymentMethodInfo setPanLastFour(String value) { this.panLastFour = value; return this; }
    }

    public static class Borgun3DFinal3DSecureInfo
    {
        public String dataType = null;
        public String mpiToken = null;
        
        public String getDataType() { return dataType; }
        public Borgun3DFinal3DSecureInfo setDataType(String value) { this.dataType = value; return this; }
        public String getMpiToken() { return mpiToken; }
        public Borgun3DFinal3DSecureInfo setMpiToken(String value) { this.mpiToken = value; return this; }
    }

    public static class BorgunApplePayFinalInfo
    {
        public String orderId = null;
        public BorgunApplePayThreeDSecureInfo threeDSecure = null;
        
        public String getOrderId() { return orderId; }
        public BorgunApplePayFinalInfo setOrderId(String value) { this.orderId = value; return this; }
        public BorgunApplePayThreeDSecureInfo getThreeDSecure() { return threeDSecure; }
        public BorgunApplePayFinalInfo setThreeDSecure(BorgunApplePayThreeDSecureInfo value) { this.threeDSecure = value; return this; }
    }

    public static class BorgunApplePayThreeDSecureInfo
    {
        public String dataType = null;
        public String securityLevelInd = null;
        public String cavv = null;
        public String ucaf = null;
        
        public String getDataType() { return dataType; }
        public BorgunApplePayThreeDSecureInfo setDataType(String value) { this.dataType = value; return this; }
        public String getSecurityLevelInd() { return securityLevelInd; }
        public BorgunApplePayThreeDSecureInfo setSecurityLevelInd(String value) { this.securityLevelInd = value; return this; }
        public String getCavv() { return cavv; }
        public BorgunApplePayThreeDSecureInfo setCavv(String value) { this.cavv = value; return this; }
        public String getUcaf() { return ucaf; }
        public BorgunApplePayThreeDSecureInfo setUcaf(String value) { this.ucaf = value; return this; }
    }

    public static class GiftCardIssueResult
    {
        public Boolean success = null;
        public Integer giftCardId = null;
        public String code = null;
        public String codeLast4 = null;
        public String status = null;
        public Date expiresAt = null;
        public String paymentId = null;
        public Integer statusCode = null;
        public String message = null;
        
        public Boolean isSuccess() { return success; }
        public GiftCardIssueResult setSuccess(Boolean value) { this.success = value; return this; }
        public Integer getGiftCardId() { return giftCardId; }
        public GiftCardIssueResult setGiftCardId(Integer value) { this.giftCardId = value; return this; }
        public String getCode() { return code; }
        public GiftCardIssueResult setCode(String value) { this.code = value; return this; }
        public String getCodeLast4() { return codeLast4; }
        public GiftCardIssueResult setCodeLast4(String value) { this.codeLast4 = value; return this; }
        public String getStatus() { return status; }
        public GiftCardIssueResult setStatus(String value) { this.status = value; return this; }
        public Date getExpiresAt() { return expiresAt; }
        public GiftCardIssueResult setExpiresAt(Date value) { this.expiresAt = value; return this; }
        public String getPaymentId() { return paymentId; }
        public GiftCardIssueResult setPaymentId(String value) { this.paymentId = value; return this; }
        public Integer getStatusCode() { return statusCode; }
        public GiftCardIssueResult setStatusCode(Integer value) { this.statusCode = value; return this; }
        public String getMessage() { return message; }
        public GiftCardIssueResult setMessage(String value) { this.message = value; return this; }
    }

}

Java GiftCardPurchaseRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /GiftCard/Purchase HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GiftCardPurchaseRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <AmountMinor>0</AmountMinor>
  <ApplePayInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BorgunRPGData">
    <d2p1:OrderId>String</d2p1:OrderId>
    <d2p1:ThreeDSecure>
      <d2p1:CAVV>String</d2p1:CAVV>
      <d2p1:DataType>String</d2p1:DataType>
      <d2p1:SecurityLevelInd>String</d2p1:SecurityLevelInd>
      <d2p1:UCAF>String</d2p1:UCAF>
    </d2p1:ThreeDSecure>
  </ApplePayInfo>
  <Borgun3DFinalInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BorgunRPGData">
    <d2p1:Amount>0</d2p1:Amount>
    <d2p1:Currency>String</d2p1:Currency>
    <d2p1:OrderId>String</d2p1:OrderId>
    <d2p1:PaymentMethod>
      <d2p1:ExpMonth>String</d2p1:ExpMonth>
      <d2p1:ExpYear>String</d2p1:ExpYear>
      <d2p1:PanLastFour>String</d2p1:PanLastFour>
      <d2p1:PaymentType>String</d2p1:PaymentType>
      <d2p1:Token>String</d2p1:Token>
      <d2p1:VirtualNumber>String</d2p1:VirtualNumber>
    </d2p1:PaymentMethod>
    <d2p1:ThreeDSecure>
      <d2p1:DataType>String</d2p1:DataType>
      <d2p1:MpiToken>String</d2p1:MpiToken>
    </d2p1:ThreeDSecure>
    <d2p1:TransactionDate>0001-01-01T00:00:00</d2p1:TransactionDate>
    <d2p1:TransactionType>String</d2p1:TransactionType>
  </Borgun3DFinalInfo>
  <BuyerEmail>String</BuyerEmail>
  <BuyerName>String</BuyerName>
  <BuyerPhone>String</BuyerPhone>
  <CardInfo>
    <Amount>0</Amount>
    <Currency>String</Currency>
    <OrderId>String</OrderId>
    <PaymentMethod>
      <CVC>String</CVC>
      <ExpMonth>String</ExpMonth>
      <ExpYear>String</ExpYear>
      <PAN>String</PAN>
      <PaymentType>String</PaymentType>
      <Token>String</Token>
    </PaymentMethod>
    <SaveCardToToken>false</SaveCardToToken>
    <TransActionDate>0001-01-01T00:00:00</TransActionDate>
  </CardInfo>
  <GiftCardTypeId>0</GiftCardTypeId>
  <IdempotencyKey>String</IdempotencyKey>
  <PaymentId>String</PaymentId>
  <PaymentMethodId>String</PaymentMethodId>
  <PurchaseOwnerId>0</PurchaseOwnerId>
  <PurchasePaymentReference>String</PurchasePaymentReference>
  <RecipientName>String</RecipientName>
</GiftCardPurchaseRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GiftCardIssueResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <Code>String</Code>
  <CodeLast4>String</CodeLast4>
  <ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
  <GiftCardId>0</GiftCardId>
  <Message>String</Message>
  <PaymentId>String</PaymentId>
  <Status>String</Status>
  <StatusCode>0</StatusCode>
  <Success>false</Success>
</GiftCardIssueResult>