RHP_API

<back to all web services

CreateUserPurchase

Purchase via CC

Requires Authentication
CreateUserPurchase Parameters:
NameParameterData TypeRequiredDescription
PurchaseTokenbodystringNoPurchase token
CardbodyCreditCardNoCredit card details
ProductbodySelectedProductNoSelected product
UseStoredCardbodyboolNoUserStoredCard if set to true the stored card will be used to process the transaction. This field is not required.
UseDiamondsbodyboolNoUseDiamonds if set to true Diamonds will be used to process the transaction. This field is not required.
TokenbodyPaymentTokenNoToken from Apple or Google pay. This field is not required.
CreditCard Parameters:
NameParameterData TypeRequiredDescription
NumberformstringNoCredit card number
MonthformintNo2 digit number representing the month
YearformintNo2 digit number representing the year
CCVformstringNo3 digit security code
SelectedProduct Parameters:
NameParameterData TypeRequiredDescription
TokenformstringNoProduct token, represents the selected product and duration
PaymentToken Parameters:
NameParameterData TypeRequiredDescription
TypeformPaymentTokenTypeNo
TokenformstringNo
PurchaseResponse Parameters:
NameParameterData TypeRequiredDescription
PaymentSuccessformboolNoIndicates if a transaction has succeded
PaymentResponseformPaymentResultNoProvides additional detail to the payments status
ErrorCodeformstringNoIf payment failed additional error code is returned
ErrorMessageformstringNoIf payment failed additional error message is returned
ReceiptformPurchaseReceiptNoIf payment has succeded the receipt details are returned
PurchaseReceipt Parameters:
NameParameterData TypeRequiredDescription
AmountformReceiptAmountNoPayment amount
CompanyformstringNoCompany name, that is displayed on the user's bank statement
ABNformstringNoAustralian Business Number
ReceiptNumberformstringNoReceipt number for the payment
CreditCardNumberformstringNoMasked Credit Card number
ReceiptAmount Parameters:
NameParameterData TypeRequiredDescription
TotalformdecimalNoTotal amount of payment
TaxformdecimalNoTax included in the payment
AmountLessTaxformdecimalNoTotal minus Tax

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

HTTP + SOAP12

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

POST /soap12 HTTP/1.1 
Host: tstsrvs.redhotpie.com.au 
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>

<CreateUserPurchase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RHP_API.ServiceModel">
  <Card>
    <CCV>String</CCV>
    <Month>0</Month>
    <Number>String</Number>
    <Year>0</Year>
  </Card>
  <Product>
    <Token>String</Token>
  </Product>
  <PurchaseToken>String</PurchaseToken>
  <Token>
    <Token>String</Token>
    <Type>ApplePay</Type>
  </Token>
  <UseDiamonds>false</UseDiamonds>
  <UseStoredCard>false</UseStoredCard>
</CreateUserPurchase>

    </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>

<PurchaseResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RHP_API.ServiceModel">
  <ErrorCode>String</ErrorCode>
  <ErrorMessage>String</ErrorMessage>
  <PaymentResponse>TokenAcquisitionFailed</PaymentResponse>
  <PaymentSuccess>false</PaymentSuccess>
  <Receipt>
    <ABN>String</ABN>
    <Amount>
      <AmountLessTax>0</AmountLessTax>
      <Tax>0</Tax>
      <Total>0</Total>
    </Amount>
    <Company>String</Company>
    <CreditCardNumber>String</CreditCardNumber>
    <ReceiptNumber>String</ReceiptNumber>
  </Receipt>
</PurchaseResponse>

    </soap12:Body>
</soap12:Envelope>