Renewing ProPay Merchant or Card-Only Accounts

The need for renewal depends on several factors.
These factors are defined, primarily, by what works for you, ProPay, and what you think will make your merchants happy.
  • Accounts can be set to expire. Those that do, need to be renewed.
  • It’s possible to charge merchants an annual or monthly fee for their accounts.
  • It’s also possible to charge you a fee. (Useful when sensitivity about processing rates trumps concerns about a yearly or monthly fee.)
  • Renewing an account also allows a merchant to change pricing and service configuration.
Accounts can be set to auto-renew if you prefer.
This is not the same thing as having accounts that just don’t expire. IF an account must be renewed, and IF that renewal should be paid for, then this option automatically takes renewal fees from either you or the merchant, and then pushes an account’s expiration date out based on the term of renewal. (Monthly, or yearly auto-renewal is possible.)

Order of payment operations for auto-renewal when payment is expected.
  • If the API request includes payment details, it will be used in an attempt to collect renewal fees.
  • Then, if either no payment group is passed, or if payment fails, ProPay will check to see if the account is set up to be paid for by the partner. If such is the case, the account will simply be renewed.
  • Finally, ProPay will attempt to collect renewal fees from the account’s available balance. If all of these attempts to collect the renewal fees fails the renewal request will return denied.
How to call this method?

HTTP URL(s)
HTTP Verb PUT
HTTP Header Authorization
Example Request

Example Response

{
  "accountNum": 123456,
  "CVV2": 999,
  "tier": "194e4047-69b5-4e7c-b",
  "ccNum": "4111111111111111",
  "expDate": "1221",
  "zip": "12345"
}
{
 AccountNumber: 123456,
 Status: "00",
 Tier: "194e4047-69b5-4e7c-b"
}
Implementation Details
Request Submission

namespace MSAPI_Renew
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Xml;
    using System.Xml.Linq;
    using System.Xml.Serialization;

 

    /*
      ProPay provides the following code “AS IS.”
      ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
      including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
      ProPay does not warrant that the code will be uninterrupted or error free,
      nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
    */
    public class RenewAccountTransType39
    {
        public static void RenewAccount()
        {
            var renewRequest = new XmlTransactionRequest { CertificationString = "4cdcccc0bcba4b6ca8cd62ee975f00", TerminalID = "29c1df5fed", };
            var xmlTransaction = new XmlRenewTransaction
                                     {
                                         TransType = "39",
                                         AccountNumber = "32542256",
                                         ExternalId = "",
                                         SourceEmail = "7180bae6-266a-41e6-aa69-24cb2d245af0@qamail.com",
                                         CreditCardNumber = "4111111111111111", // test credit card
                                         ExpirationDate = "0519",
                                         CVV2 = "999",
                                         Zip = "84043",
                                     };
            renewRequest.Transactions.Add(xmlTransaction);
            string request = XmlSerializer<XmlTransactionRequest>.WriteToString(renewRequest);
            SubmitRequest(request);
        }

 

        private static void SubmitRequest(string request)
        {
            byte[] dataToSend = Encoding.UTF8.GetBytes(request);

 

            // Change the following URL to point to production instead of integration
            WebRequest webRequest = WebRequest.Create("https://xmltest.propay.com/API/PropayAPI.aspx");
            webRequest.Method = "POST";
            webRequest.ContentLength = dataToSend.Length;
            webRequest.ContentType = "text/xml";
            Stream dataStream = webRequest.GetRequestStream();
            dataStream.Write(dataToSend, 0, dataToSend.Length);
            dataStream.Close();

 

            string response = string.Empty;

 

            try
            {
                WebResponse apiResponse = webRequest.GetResponse();

 


                using (StreamReader sr = new StreamReader(apiResponse.GetResponseStream()))
                {
                    response += sr.ReadToEnd();
                }
            }
            catch (WebException wex)
            {
                HttpWebResponse httpResponse = wex.Response as HttpWebResponse;
                using (Stream responseStream = httpResponse.GetResponseStream())
                    using (StreamReader reader = new StreamReader(responseStream))
                    {
                        response = reader.ReadToEnd();
                    }
            }

 

            // Call Parse Function for the XML response
            ParseResponse(response);
        }

 

        private static void ParseResponse(string response)
        {
            var load = XDocument.Parse(response);
            var transType = Convert.ToInt32(load.Descendants().First(p => p.Name.LocalName == "transType").Value);
            var accountId = Convert.ToInt32(load.Descendants().First(p => p.Name.LocalName == "accountNum").Value);
            var status = load.Descendants().First(p => p.Name.LocalName == "status").Value;
        }
    }

 

    public class XmlRenewTransaction : XmlTransaction
    {
        /// <summary>
        /// This is a client’s own unique identifier. Typically used as the distributor ID.
        /// </summary>
        [XmlElement("externalId")]
        public string ExternalId = string.Empty;

 

        /// <summary>
        /// Merchant/Individual email address. Must be unique in ProPay system.
        /// </summary>
        [XmlElement("sourceEmail")]
        public string SourceEmail = string.Empty;

 

        /// <summary>
        /// The account number assigned by ProPay.
        /// </summary>
        [XmlElement("accountNum")]
        public string AccountNumber = string.Empty;

 

        /// <summary>
        /// The credit card CVV code.
        /// </summary>
        [XmlElement("CVV2")]
        public string CVV2 = string.Empty;

 

        /// <summary>
        /// The credit card number used to pay for the renewal.
        /// </summary>
        [XmlElement("ccNum")]
        public string CreditCardNumber = string.Empty;

 

        /// <summary>
        /// The US zip code of the credit card. 5 or 9 digits without a dash for US cards. Omit for international credit cards.
        /// </summary>
        [XmlElement("zip")]
        public string Zip = string.Empty;

 

        /// <summary>
        /// The credit card expiration date in ‘mmdd’ format.
        /// </summary>
        [XmlElement("expDate")]
        public string ExpirationDate = string.Empty;

 

        /// <summary>
        /// Supplying a value will change the accounts tier under the affiliation upon renewal.
        /// If not passed the tier will not be changed.
        /// </summary>
        [XmlElement("tier")]
        public string Tier = string.Empty;
    }

 

    public static class XmlSerializer<T>
    {
        public static XmlSerializer Serializer = new XmlSerializer(typeof(T));

 

        /// <summary>
        /// Writes to a string <paramref name="data"/> using <see cref="Encoding.UTF8"/>.
        /// </summary>
        /// <remarks>
        /// This defaults the encoding to <see cref="Encoding.UTF8"/> because that is what xml internal uses
        /// to read in xml transactions.
        /// </remarks>
        /// <param name="data">The data to write to a string.</param>       
        /// <returns>A string representation of <paramref name="data"/>.</returns>
        public static string WriteToString(T data)
        {
            return WriteToString(data, Encoding.UTF8);
        }

 

        /// <summary>
        /// Writes to a string <paramref name="data"/> using <paramref name="encoding"/>.
        /// </summary>
        /// <param name="data">The data to write to a string.</param>
        /// <param name="encoding">The encoding to use when writing to a string.</param>
        /// <returns>A string representation of <paramref name="data"/>.</returns>
        public static string WriteToString(T data, Encoding encoding)
        {
            string retVal;
            using (MemoryStream memoryStream = new MemoryStream())
            {
                using (XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, encoding))
                {
                    Serializer.Serialize(xmlTextWriter, data);
                }

 

                retVal = encoding.GetString(memoryStream.ToArray());
            }

 

            return retVal;
        }
    }

 

    [XmlInclude(typeof(XmlRenewTransaction))]
    public class XmlTransaction
    {
        /// <summary>
        /// The transaction type.
        /// </summary>
        [XmlElement("transType")]
        public string TransType = string.Empty;
    }

 

    /// <summary>
    /// The XML request object.
    /// </summary>
    [XmlRoot("XMLRequest")]
    public class XmlTransactionRequest
    {
        /// <summary>
        /// Supplied by ProPay, Used to access the API.
        /// </summary>
        [XmlElement("certStr")]
        public string CertificationString = string.Empty;

 

        /// <summary>
        /// Omit unless specifically instructed by ProPay, Used to access the API.
        /// </summary>
        [XmlElement("termid")]
        public string TerminalID = string.Empty;

 

        /// <summary>
        /// The XML transactions to process.
        /// </summary>
        [XmlElement("XMLTrans")]
        public List<XmlTransaction> Transactions = new List<XmlTransaction>();
    }
}

Response Handling

Request Submission

/**
 * ProPay provides the following code “AS IS.” ProPay makes no warranties and
 * ProPay disclaims all warranties and conditions, express, implied or
 * statutory, including without limitation the implied warranties of title,
 * non-infringement, merchantability, and fitness for a particular purpose.
 * ProPay does not warrant that the code will be uninterrupted or error free,
 * nor does ProPay make any warranty as to the performance or any results that
 * may be obtained by use of the code.
 */

 

<?php
class ProPayApi
{
    /* change this to the production url for going live after testing https://api.propay.com */
    private $_apiBaseUrl = 'https://xmltestapi.propay.com';

 

    /* for xml */
    /** @var  \SimpleXMLElement */
    private $_xmlRequestObject;
    /** @var  \SimpleXMLElement */
    private $_xmlResponseObject;
    /** @var  string */
    private $_xmlUrl;

 

    /**
     * sets the xml request object
     * @param string $xmlData - containing XML
     * @return $this
     */
    public function setXMLRequestData($xmlData) {
        $this->_xmlRequestObject = simplexml_load_string($xmlData);
        return $this;
    }

 

    /**
     * @param string $xmlData - containing XML
     * @return $this
     */
    public function setXMLResponseData($xmlData) {
        $this->_xmlResponseObject = simplexml_load_string($xmlData);
        return $this;
    }

 

    /**
     * @return mixed
     */
    public function getXMLRequestObject() {
        return $this->_xmlRequestObject;
    }

 

    /**
     * @return mixed
     */
    public function getXMLResponseObject() {
        return $this->_xmlResponseObject;
    }

 

    /**
     * @param \SimpleXMLElement $xmlObject
     * @return $this
     */
    public function setXMLRequestObject(\SimpleXMLElement $xmlObject) {
        $this->_xmlRequestObject = $xmlObject;
        return $this;
    }

 

    /**
     * @param \SimpleXMLElement $xmlObject
     * @return $this
     */
    public function setXMLResponseObject(\SimpleXMLElement $xmlObject) {
        $this->_xmlResponseObject = $xmlObject;
        return $this;
    }

 

    /**
     * sets the url for the XML request
     * @param string $xmlUrl
     * @return $this
     */
    public function setXMLUrl($xmlUrl) {
        $this->_xmlUrl = $xmlUrl;
        return $this;
    }

 

    /**
     * posts XML to the server
     * @return $this
     */
    public function postXML() {
        $header = [
            "Content-type:text/xml; charset=\"utf-8\"",
            "Accept: text/xml"
        ];

 


        $curl = curl_init();
        curl_setopt_array($curl, [
            CURLOPT_URL            => $this->_xmlUrl,
            CURLOPT_TIMEOUT        => 30,
            CURLOPT_POST           => true,
            CURLOPT_POSTFIELDS     => $this->_xmlRequestObject->asXML(),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HTTPHEADER     => $header,
            CURLOPT_SSL_VERIFYPEER => 0,
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_HTTPAUTH => CURLAUTH_ANY
        ]);
        $result = curl_exec($curl);
        $this->_xmlResponseObject = simplexml_load_string($result);
        curl_close($curl);
        return $this;
    }
}

 

$proPayAPI = new ProPayApi();
$data = "<?xml version='1.0'?>
            <!DOCTYPE Request.dtd>
            <XMLRequest>
            </XMLRequest>";
$simpleXML = new \SimpleXMLElement($data);
$simpleXML->addChild('certStr','cert string here');
$simpleXML->addChild('termId','terminal id');
$simpleXML->addChild('class','partner');
$simpleXML->addChild('XMLTrans');
$simpleXML->XMLTrans->addChild('transType', 39);
$simpleXML->XMLTrans->addChild('accountNum', 999999999);
$simpleXML->XMLTrans->addChild('tier', 'Merchant');
$simpleXML->XMLTrans->addChild('ccNum', '4747474747474747');
$simpleXML->XMLTrans->addChild('expDate', '1220');
$simpleXML->XMLTrans->addChild('zip', '23456');
$simpleXML->XMLTrans->addChild('CVV2', '999');

 

// returns XML
$result =
    $proPayAPI->setXMLUrl('https://xmltest.propay.com/API/PropayAPI.aspx')
        ->setXMLRequestData($simpleXML->asXML())
        ->postXML()
        ->getXMLResponseObject()->asXML();

// if you prefer a simpleXML object you just retrieve the object back to work with that
$result = $proPayAPI->getXMLResponseObject();

Response Handling

Request Submission

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import java.io.IOException;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.Feature;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.ObjectMapper;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import com.mashape.unirest.request.HttpRequest;
import com.mashape.unirest.request.HttpRequestWithBody;

public class RenewAccountTransactionXmlSample {

 final static String ApiUrl = "https://xmltest.propay.com/API/PropayAPI.aspx";

 public static void main(String[] args) {
configureObjectMapper();

RenewAccountTransactionXmlSample program = new RenewAccountTransactionXmlSample();

TransactionRequest transactionRequest = program.getRequest();
RenewAccountTransactionRequest transaction = program.getRenewAccountTransactionRequest();

transactionRequest.getTransactions().add(transaction);

RenewAccountResponse response = program.sendRequest(transactionRequest);

System.out.println("Response:");
RenewAccountTransactionResponse transactionResponse = response.getTransactions().get(0);

System.out.println("Transaction type: " + transactionResponse.TransType);
System.out.println("Status: " + transactionResponse.status);
System.out.println("Account Number: " + transactionResponse.AccountNumber);
System.out.println("Tier: " + transactionResponse.TierName);
 }

 /**
* Get the affiliate credential id. This would normally be in a
* configuration file or database.
*/
 private String getCertString() {
return "TiAuNrNwEjRnScCaE9RcTcS7ReI9NG";
 }

 /**
* Get the request container, setting up the authentication.
*
* @return The request container.
*/
 private TransactionRequest getRequest() {
String certString = getCertString();

TransactionRequest transactionRequest = new TransactionRequest();
transactionRequest.CertificationString = certString;
transactionRequest.TerminalId = "ReI9NG";

return transactionRequest;
 }

 /**
* Get the transaction details, how much to refund, on which transaction.
*
*/
 private RenewAccountTransactionRequest getRenewAccountTransactionRequest() {
RenewAccountTransactionRequest transaction = new RenewAccountTransactionRequest();

transaction.AccountNumber = "30829395";
transaction.CreditCardNumber = "41111111111111111";
transaction.ExpirationDate = "0519";
transaction.Cvv2 = "999";
transaction.Zip = "84043";

return transaction;
 }

 /**
* Send the refund transaction request.
*
* @param transactionRequest
* The transaction request.
* @return The transaction response.
*/
 private RenewAccountResponse sendRequest(TransactionRequest transactionRequest) {
HttpRequestWithBody request = this.createRequest(ApiUrl);

request.body(transactionRequest);

RenewAccountResponse response = this.executeRequest(request, RenewAccountResponse.class);

return response;
 }

 /**
* Create the request instance. This ensures that the correct content type
* and accept headers are attached to each request.
*
* @param resourceUrl
* The URL of the resource.
* @return The request instance.
*/
 public HttpRequestWithBody createRequest(String resourceUrl) {

HttpRequestWithBody request = Unirest.post(resourceUrl).header("accept", "text/xml").header("Content-Type",
"text/xml");

return request;
 }

 /**
* Execute a request.
*
* @param request
* The request to perform.
* @param responseClass
* The type instance of the return type.
* @return An instance of type T or null if there was an error.
*/
 public <T> T executeRequest(HttpRequest request, Class<T> responseClass) {
try {
HttpResponse<T> response = request.asObject(responseClass);
if (response.getStatus() != 200) { // HTTP OK response code
System.out.println(response.getStatusText());
return null;
}

return response.getBody();
} catch (UnirestException e) {
e.printStackTrace();
}

return null;
 }

 /**
* Configures the mapping between XML and Classes.
*
* This is boilerplate Unirest & Jackson configuration. It should only need
* to be done once in a full solution.
*/
 private static void configureObjectMapper() {
Unirest.setObjectMapper(new ObjectMapper() {

private com.fasterxml.jackson.databind.ObjectMapper jacksonObjectMapper = new XmlMapper()
.configure(Feature.WRITE_XML_DECLARATION, true);

public <T> T readValue(String value, Class<T> valueType) {
try {
return jacksonObjectMapper.readValue(value, valueType);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

public String writeValue(Object value) {
try {
return jacksonObjectMapper.writeValueAsString(value);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
});
 }
}


// -------------------------------------------------------------------------------------------- //
// Object files

// Transaction.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

@JacksonXmlRootElement(localName = "XMLTrans")
public class Transaction {
 @JacksonXmlProperty(localName = "transType")
 public String TransType;
}

// -------------------------------------------------------------------------------------------- //
// TransactionRequest.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

@JacksonXmlRootElement(localName = "XMLRequest")
public class TransactionRequest {
 @JacksonXmlProperty(localName = "certStr")
 public String CertificationString;

 @JacksonXmlProperty(localName = "class")
 public final String ClassType = "partner";
 /**
* Omit unless specifically instructed by ProPay, Used to access the API
*/
 @JacksonXmlProperty(localName = "termid")
 public String TerminalId;

 @JacksonXmlProperty(localName = "XMLTrans")
 @JacksonXmlElementWrapper(useWrapping = false)
 private List<Transaction> Transactions;

 public TransactionRequest() {
this.Transactions = new ArrayList<Transaction>();
 }

 /**
* @return the transactions
*/
 @JacksonXmlProperty(localName = "XMLTrans")
 @JacksonXmlElementWrapper(useWrapping = false)
 public List<Transaction> getTransactions() {
return this.Transactions;
 }
}

// -------------------------------------------------------------------------------------------- //
// RenewAccountTransactionRequest.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

public class RenewAccountTransactionRequest extends Transaction {
 public RenewAccountTransactionRequest() {
this.TransType = "39";
 }

 /**
* The account number for the account to lookup.
*
* One of accountNumber, sourceEmail or externalId is required.
*/
 @JacksonXmlProperty(localName = "accountNum")
 public String AccountNumber;

 /**
* The credit card CVV code.
*/
 @JacksonXmlProperty(localName = "CVV2")
 public String Cvv2;

 /**
* The tier for the account after the renewal.
*
* Optional: If not specified the account's tier will not be changed.
*/
 @JacksonXmlProperty(localName = "tier")
 public String TierName;

 /**
* The credit card number paying for the renewal fee.
*
* Optional: Accounts can be affiliate paid or pay the renewal fee from the
* account balance.
*/
 @JacksonXmlProperty(localName = "ccNum")
 public String CreditCardNumber;

 /**
* The credit card expiration date.
*/
 @JacksonXmlProperty(localName = "expDate")
 public String ExpirationDate;

 /**
* The billing zip code for US credit cards.
*
* This field is not used if paying with an international credit card.
*/
 public String Zip;
}

// -------------------------------------------------------------------------------------------- //
// RenewAccountTransactionResponse.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

public class RenewAccountTransactionResponse extends Transaction {
 public String status;

 @JacksonXmlProperty(localName = "accountNum")
 public String AccountNumber;

 @JacksonXmlProperty(localName = "tier")
 public String TierName;
}

// -------------------------------------------------------------------------------------------- //
// RenewAccountResponse.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import java.util.List;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

@JacksonXmlRootElement(localName = "XMLResponse")
public class RenewAccountResponse {
 @JacksonXmlProperty(localName = "XMLTrans")
 @JacksonXmlElementWrapper(useWrapping = false)
 private List<RenewAccountTransactionResponse> transactions;

 /**
* @return the transactions
*/
 public List<RenewAccountTransactionResponse> getTransactions() {
return transactions;
 }
}

Go to Ruwix.com to learn the solution of the Rubik's Cube and other twisty puzzles like Pyraminx, Square-1 etc.

Response Handling

The following sample uses the Unirest and Jackson libraries.

You can add them to your project using:

Apache Maven
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.8.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.9.0.pr3</version>
</dependency>

Gradle/Grails
compile 'com.mashape.unirest:unirest-java:1.4.9'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.8.1'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0.pr3'

Request Submission

Response Handling

Request Values

Element

Type

Max

Required

Notes

accountNum

Int(32)

 

Required

Assigned to each account by ProPay.

tier

String

 

Optional

Supplying a value will change the accounts tier under the affiliation upon renewal.

If not passed the tier will not be changed.

 

Group: Payment Information (Credit Card) - Optional

Element

Type

Max

Required

Notes

CVV2

String

4

Required

The credit card CVV code.

ccNum

String

16

Required

The credit card number used to pay for the renewal. *Required if using credit card to pay renewal fee.

expDate

String

4

Required

The credit card expiration date in ‘mmdd’ format. *Required if using credit card to pay renewal fee.

zip

String

9

Required

The US zip code of the credit card. 5 or 9 digits without a dash for US cards. Omit for international credit cards.

 

Group: Payment Information (Bank Account) - Optional

Element

Type

Max

Required

Notes

PaymentBankAccountNumber

String

 

Required

Used to pay for an account via ACH and monthly renewal. Financial institution account number. *Required if using ACH to pay renewal fee.

PaymentBankRoutingNumber

String

 

Required

Used to pay for an account via ACH and monthly renewal. Financial institution routing number.

Must be a valid ACH routing number. *Required if using ACH to pay renewal fee.

PaymentBankAccountType

String

 

Required

Used to pay for an account via ACH and monthly renewal. Valid values are: Checking and Savings

Response Values

Element

Type

Notes

Status

string

Result of the transaction request. See Appendix B for result code definitions.

Tier

string

The tier the account was renewed under.

How to call this method?

You should submit a post of XML data to the following URL
 
HTTP URL(s)
Example Request

Example Response

<?xml version='1.0'?>
<XMLRequest>
<certStr>MyTestCertStr00000001</certStr>
<class>partner</class>
<XMLTrans>
<transType>39</transType>
<accountNum>1547785</accountNum>
<zip>84118</zip>
</XMLTrans>
</XMLRequest>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<XMLResponse xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.propay.com/schema/PPResponse.xsd">
<XMLTrans>
<transType>39</transType>
<status>00</status>
</XMLTrans>
</XMLResponse>
Implementation Details
Request Submission

namespace MSAPI_Renew
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Serialization;

/*
ProPay provides the following code “AS IS.”
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/
public class RenewAccountTransType39
{
public static void RenewAccount()
{
var renewRequest = new XmlTransactionRequest { CertificationString = "4cdcccc0bcba4b6ca8cd62ee975f00", TerminalID = "29c1df5fed", };
var xmlTransaction = new XmlRenewTransaction
{
TransType = "39",
AccountNumber = "32542256",
ExternalId = "",
SourceEmail = "7180bae6-266a-41e6-aa69-24cb2d245af0@qamail.com",
CreditCardNumber = "4111111111111111", // test credit card
ExpirationDate = "0519",
CVV2 = "999",
Zip = "84043",
};
renewRequest.Transactions.Add(xmlTransaction);
string request = XmlSerializer<XmlTransactionRequest>.WriteToString(renewRequest);
SubmitRequest(request);
}

private static void SubmitRequest(string request)
{
byte[] dataToSend = Encoding.UTF8.GetBytes(request);

// Change the following URL to point to production instead of integration
WebRequest webRequest = WebRequest.Create("https://xmltest.propay.com/API/PropayAPI.aspx");
webRequest.Method = "POST";
webRequest.ContentLength = dataToSend.Length;
webRequest.ContentType = "text/xml";
Stream dataStream = webRequest.GetRequestStream();
dataStream.Write(dataToSend, 0, dataToSend.Length);
dataStream.Close();

string response = string.Empty;

try
{
WebResponse apiResponse = webRequest.GetResponse();


using (StreamReader sr = new StreamReader(apiResponse.GetResponseStream()))
{
response += sr.ReadToEnd();
}
}
catch (WebException wex)
{
HttpWebResponse httpResponse = wex.Response as HttpWebResponse;
using (Stream responseStream = httpResponse.GetResponseStream())
using (StreamReader reader = new StreamReader(responseStream))
{
response = reader.ReadToEnd();
}
}

// Call Parse Function for the XML response
ParseResponse(response);
}

private static void ParseResponse(string response)
{
var load = XDocument.Parse(response);
var transType = Convert.ToInt32(load.Descendants().First(p => p.Name.LocalName == "transType").Value);
var accountId = Convert.ToInt32(load.Descendants().First(p => p.Name.LocalName == "accountNum").Value);
var status = load.Descendants().First(p => p.Name.LocalName == "status").Value;
}
}

public class XmlRenewTransaction : XmlTransaction
{
/// <summary>
/// This is a client’s own unique identifier. Typically used as the distributor ID.
/// </summary>
[XmlElement("externalId")]
public string ExternalId = string.Empty;

/// <summary>
/// Merchant/Individual email address. Must be unique in ProPay system.
/// </summary>
[XmlElement("sourceEmail")]
public string SourceEmail = string.Empty;

/// <summary>
/// The account number assigned by ProPay.
/// </summary>
[XmlElement("accountNum")]
public string AccountNumber = string.Empty;

/// <summary>
/// The credit card CVV code.
/// </summary>
[XmlElement("CVV2")]
public string CVV2 = string.Empty;

/// <summary>
/// The credit card number used to pay for the renewal.
/// </summary>
[XmlElement("ccNum")]
public string CreditCardNumber = string.Empty;

/// <summary>
/// The US zip code of the credit card. 5 or 9 digits without a dash for US cards. Omit for international credit cards.
/// </summary>
[XmlElement("zip")]
public string Zip = string.Empty;

/// <summary>
/// The credit card expiration date in ‘mmdd’ format.
/// </summary>
[XmlElement("expDate")]
public string ExpirationDate = string.Empty;

/// <summary>
/// Supplying a value will change the accounts tier under the affiliation upon renewal.
/// If not passed the tier will not be changed.
/// </summary>
[XmlElement("tier")]
public string Tier = string.Empty;
}

public static class XmlSerializer<T>
{
public static XmlSerializer Serializer = new XmlSerializer(typeof(T));

/// <summary>
/// Writes to a string <paramref name="data"/> using <see cref="Encoding.UTF8"/>.
/// </summary>
/// <remarks>
/// This defaults the encoding to <see cref="Encoding.UTF8"/> because that is what xml internal uses
/// to read in xml transactions.
/// </remarks>
/// <param name="data">The data to write to a string.</param>
/// <returns>A string representation of <paramref name="data"/>.</returns>
public static string WriteToString(T data)
{
return WriteToString(data, Encoding.UTF8);
}

/// <summary>
/// Writes to a string <paramref name="data"/> using <paramref name="encoding"/>.
/// </summary>
/// <param name="data">The data to write to a string.</param>
/// <param name="encoding">The encoding to use when writing to a string.</param>
/// <returns>A string representation of <paramref name="data"/>.</returns>
public static string WriteToString(T data, Encoding encoding)
{
string retVal;
using (MemoryStream memoryStream = new MemoryStream())
{
using (XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, encoding))
{
Serializer.Serialize(xmlTextWriter, data);
}

retVal = encoding.GetString(memoryStream.ToArray());
}

return retVal;
}
}

[XmlInclude(typeof(XmlRenewTransaction))]
public class XmlTransaction
{
/// <summary>
/// The transaction type.
/// </summary>
[XmlElement("transType")]
public string TransType = string.Empty;
}

/// <summary>
/// The XML request object.
/// </summary>
[XmlRoot("XMLRequest")]
public class XmlTransactionRequest
{
/// <summary>
/// Supplied by ProPay, Used to access the API.
/// </summary>
[XmlElement("certStr")]
public string CertificationString = string.Empty;

/// <summary>
/// Omit unless specifically instructed by ProPay, Used to access the API.
/// </summary>
[XmlElement("termid")]
public string TerminalID = string.Empty;

/// <summary>
/// The XML transactions to process.
/// </summary>
[XmlElement("XMLTrans")]
public List<XmlTransaction> Transactions = new List<XmlTransaction>();
}
}

Response Handling

Request Submission

/**
 * ProPay provides the following code “AS IS.” ProPay makes no warranties and
 * ProPay disclaims all warranties and conditions, express, implied or
 * statutory, including without limitation the implied warranties of title,
 * non-infringement, merchantability, and fitness for a particular purpose.
 * ProPay does not warrant that the code will be uninterrupted or error free,
 * nor does ProPay make any warranty as to the performance or any results that
 * may be obtained by use of the code.
 */

<?php
class ProPayApi
{
/* change this to the production url for going live after testing https://api.propay.com */
private $_apiBaseUrl = 'https://xmltestapi.propay.com';

/* for xml */
/** @var \SimpleXMLElement */
private $_xmlRequestObject;
/** @var \SimpleXMLElement */
private $_xmlResponseObject;
/** @var string */
private $_xmlUrl;

/**
* sets the xml request object
* @param string $xmlData - containing XML
* @return $this
*/
public function setXMLRequestData($xmlData) {
$this->_xmlRequestObject = simplexml_load_string($xmlData);
return $this;
}

/**
* @param string $xmlData - containing XML
* @return $this
*/
public function setXMLResponseData($xmlData) {
$this->_xmlResponseObject = simplexml_load_string($xmlData);
return $this;
}

/**
* @return mixed
*/
public function getXMLRequestObject() {
return $this->_xmlRequestObject;
}

/**
* @return mixed
*/
public function getXMLResponseObject() {
return $this->_xmlResponseObject;
}

/**
* @param \SimpleXMLElement $xmlObject
* @return $this
*/
public function setXMLRequestObject(\SimpleXMLElement $xmlObject) {
$this->_xmlRequestObject = $xmlObject;
return $this;
}

/**
* @param \SimpleXMLElement $xmlObject
* @return $this
*/
public function setXMLResponseObject(\SimpleXMLElement $xmlObject) {
$this->_xmlResponseObject = $xmlObject;
return $this;
}

/**
* sets the url for the XML request
* @param string $xmlUrl
* @return $this
*/
public function setXMLUrl($xmlUrl) {
$this->_xmlUrl = $xmlUrl;
return $this;
}

/**
* posts XML to the server
* @return $this
*/
public function postXML() {
$header = [
"Content-type:text/xml; charset=\"utf-8\"",
"Accept: text/xml"
];


$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $this->_xmlUrl,
CURLOPT_TIMEOUT => 30,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $this->_xmlRequestObject->asXML(),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $header,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_HTTPAUTH => CURLAUTH_ANY
]);
$result = curl_exec($curl);
$this->_xmlResponseObject = simplexml_load_string($result);
curl_close($curl);
return $this;
}
}

$proPayAPI = new ProPayApi();
$data = "<?xml version='1.0'?>
<!DOCTYPE Request.dtd>
<XMLRequest>
</XMLRequest>";
$simpleXML = new \SimpleXMLElement($data);
$simpleXML->addChild('certStr','cert string here');
$simpleXML->addChild('termId','terminal id');
$simpleXML->addChild('class','partner');
$simpleXML->addChild('XMLTrans');
$simpleXML->XMLTrans->addChild('transType', 39);
$simpleXML->XMLTrans->addChild('accountNum', 999999999);
$simpleXML->XMLTrans->addChild('tier', 'Merchant');
$simpleXML->XMLTrans->addChild('ccNum', '4747474747474747');
$simpleXML->XMLTrans->addChild('expDate', '1220');
$simpleXML->XMLTrans->addChild('zip', '23456');
$simpleXML->XMLTrans->addChild('CVV2', '999');

// returns XML
$result =
$proPayAPI->setXMLUrl('https://xmltest.propay.com/API/PropayAPI.aspx')
->setXMLRequestData($simpleXML->asXML())
->postXML()
->getXMLResponseObject()->asXML();

// if you prefer a simpleXML object you just retrieve the object back to work with that
$result = $proPayAPI->getXMLResponseObject();

Response Handling

Request Submission

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import java.io.IOException;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.Feature;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.ObjectMapper;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import com.mashape.unirest.request.HttpRequest;
import com.mashape.unirest.request.HttpRequestWithBody;

public class RenewAccountTransactionXmlSample {

 final static String ApiUrl = "https://xmltest.propay.com/API/PropayAPI.aspx";

 public static void main(String[] args) {
configureObjectMapper();

RenewAccountTransactionXmlSample program = new RenewAccountTransactionXmlSample();

TransactionRequest transactionRequest = program.getRequest();
RenewAccountTransactionRequest transaction = program.getRenewAccountTransactionRequest();

transactionRequest.getTransactions().add(transaction);

RenewAccountResponse response = program.sendRequest(transactionRequest);

System.out.println("Response:");
RenewAccountTransactionResponse transactionResponse = response.getTransactions().get(0);

System.out.println("Transaction type: " + transactionResponse.TransType);
System.out.println("Status: " + transactionResponse.status);
System.out.println("Account Number: " + transactionResponse.AccountNumber);
System.out.println("Tier: " + transactionResponse.TierName);
 }

 /**
* Get the affiliate credential id. This would normally be in a
* configuration file or database.
*/
 private String getCertString() {
return "TiAuNrNwEjRnScCaE9RcTcS7ReI9NG";
 }

 /**
* Get the request container, setting up the authentication.
*
* @return The request container.
*/
 private TransactionRequest getRequest() {
String certString = getCertString();

TransactionRequest transactionRequest = new TransactionRequest();
transactionRequest.CertificationString = certString;
transactionRequest.TerminalId = "ReI9NG";

return transactionRequest;
 }

 /**
* Get the transaction details, how much to refund, on which transaction.
*
*/
 private RenewAccountTransactionRequest getRenewAccountTransactionRequest() {
RenewAccountTransactionRequest transaction = new RenewAccountTransactionRequest();

transaction.AccountNumber = "30829395";
transaction.CreditCardNumber = "41111111111111111";
transaction.ExpirationDate = "0519";
transaction.Cvv2 = "999";
transaction.Zip = "84043";

return transaction;
 }

 /**
* Send the refund transaction request.
*
* @param transactionRequest
* The transaction request.
* @return The transaction response.
*/
 private RenewAccountResponse sendRequest(TransactionRequest transactionRequest) {
HttpRequestWithBody request = this.createRequest(ApiUrl);

request.body(transactionRequest);

RenewAccountResponse response = this.executeRequest(request, RenewAccountResponse.class);

return response;
 }

 /**
* Create the request instance. This ensures that the correct content type
* and accept headers are attached to each request.
*
* @param resourceUrl
* The URL of the resource.
* @return The request instance.
*/
 public HttpRequestWithBody createRequest(String resourceUrl) {

HttpRequestWithBody request = Unirest.post(resourceUrl).header("accept", "text/xml").header("Content-Type",
"text/xml");

return request;
 }

 /**
* Execute a request.
*
* @param request
* The request to perform.
* @param responseClass
* The type instance of the return type.
* @return An instance of type T or null if there was an error.
*/
 public <T> T executeRequest(HttpRequest request, Class<T> responseClass) {
try {
HttpResponse<T> response = request.asObject(responseClass);
if (response.getStatus() != 200) { // HTTP OK response code
System.out.println(response.getStatusText());
return null;
}

return response.getBody();
} catch (UnirestException e) {
e.printStackTrace();
}

return null;
 }

 /**
* Configures the mapping between XML and Classes.
*
* This is boilerplate Unirest & Jackson configuration. It should only need
* to be done once in a full solution.
*/
 private static void configureObjectMapper() {
Unirest.setObjectMapper(new ObjectMapper() {

private com.fasterxml.jackson.databind.ObjectMapper jacksonObjectMapper = new XmlMapper()
.configure(Feature.WRITE_XML_DECLARATION, true);

public <T> T readValue(String value, Class<T> valueType) {
try {
return jacksonObjectMapper.readValue(value, valueType);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

public String writeValue(Object value) {
try {
return jacksonObjectMapper.writeValueAsString(value);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
});
 }
}


// -------------------------------------------------------------------------------------------- //
// Object files

// Transaction.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

@JacksonXmlRootElement(localName = "XMLTrans")
public class Transaction {
 @JacksonXmlProperty(localName = "transType")
 public String TransType;
}

// -------------------------------------------------------------------------------------------- //
// TransactionRequest.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

@JacksonXmlRootElement(localName = "XMLRequest")
public class TransactionRequest {
 @JacksonXmlProperty(localName = "certStr")
 public String CertificationString;

 @JacksonXmlProperty(localName = "class")
 public final String ClassType = "partner";
 /**
* Omit unless specifically instructed by ProPay, Used to access the API
*/
 @JacksonXmlProperty(localName = "termid")
 public String TerminalId;

 @JacksonXmlProperty(localName = "XMLTrans")
 @JacksonXmlElementWrapper(useWrapping = false)
 private List<Transaction> Transactions;

 public TransactionRequest() {
this.Transactions = new ArrayList<Transaction>();
 }

 /**
* @return the transactions
*/
 @JacksonXmlProperty(localName = "XMLTrans")
 @JacksonXmlElementWrapper(useWrapping = false)
 public List<Transaction> getTransactions() {
return this.Transactions;
 }
}

// -------------------------------------------------------------------------------------------- //
// RenewAccountTransactionRequest.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

public class RenewAccountTransactionRequest extends Transaction {
 public RenewAccountTransactionRequest() {
this.TransType = "39";
 }

 /**
* The account number for the account to lookup.
*
* One of accountNumber, sourceEmail or externalId is required.
*/
 @JacksonXmlProperty(localName = "accountNum")
 public String AccountNumber;

 /**
* The credit card CVV code.
*/
 @JacksonXmlProperty(localName = "CVV2")
 public String Cvv2;

 /**
* The tier for the account after the renewal.
*
* Optional: If not specified the account's tier will not be changed.
*/
 @JacksonXmlProperty(localName = "tier")
 public String TierName;

 /**
* The credit card number paying for the renewal fee.
*
* Optional: Accounts can be affiliate paid or pay the renewal fee from the
* account balance.
*/
 @JacksonXmlProperty(localName = "ccNum")
 public String CreditCardNumber;

 /**
* The credit card expiration date.
*/
 @JacksonXmlProperty(localName = "expDate")
 public String ExpirationDate;

 /**
* The billing zip code for US credit cards.
*
* This field is not used if paying with an international credit card.
*/
 public String Zip;
}

// -------------------------------------------------------------------------------------------- //
// RenewAccountTransactionResponse.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

public class RenewAccountTransactionResponse extends Transaction {
 public String status;

 @JacksonXmlProperty(localName = "accountNum")
 public String AccountNumber;

 @JacksonXmlProperty(localName = "tier")
 public String TierName;
}

// -------------------------------------------------------------------------------------------- //
// RenewAccountResponse.java

/*
ProPay provides the following code "AS IS."
ProPay makes no warranties and ProPay disclaims all warranties and conditions, express, implied or statutory,
including without limitation the implied warranties of title, non-infringement, merchantability, and fitness for a particular purpose.
ProPay does not warrant that the code will be uninterrupted or error free,
nor does ProPay make any warranty as to the performance or any results that may be obtained by use of the code.
*/

import java.util.List;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

@JacksonXmlRootElement(localName = "XMLResponse")
public class RenewAccountResponse {
 @JacksonXmlProperty(localName = "XMLTrans")
 @JacksonXmlElementWrapper(useWrapping = false)
 private List<RenewAccountTransactionResponse> transactions;

 /**
* @return the transactions
*/
 public List<RenewAccountTransactionResponse> getTransactions() {
return transactions;
 }
}

Response Handling

The following sample uses the Unirest and Jackson libraries.

You can add them to your project using:

Apache Maven
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.8.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.9.0.pr3</version>
</dependency>

Gradle/Grails
compile 'com.mashape.unirest:unirest-java:1.4.9'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.8.1'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0.pr3'

Request Submission

Response Handling

Request Values

Element

Type

Max

Required

Notes

accountNum

Int(32)

 

Required

Assigned to each account by ProPay.

tier

String

 

Optional

Supplying a value will change the accounts tier under the affiliation upon renewal.

If not passed the tier will not be changed.

 

 

Group: Payment Information (Credit Card) - Optional

Element

Type

Max

Required

Notes

CVV2

String

4

Required

The credit card CVV code.

ccNum

String

16

Required

The credit card number used to pay for the renewal. *Required if using credit card to pay renewal fee.

expDate

String

4

Required

The credit card expiration date in ‘mmdd’ format. *Required if using credit card to pay renewal fee.

zip

String

9

Required

The US zip code of the credit card. 5 or 9 digits without a dash for US cards. Omit for international credit cards.

 

 

Group: Payment Information (Bank Account) - Optional

Element

Type

Max

Required

Notes

PaymentBankAccountNumber

String

 

Required

Used to pay for an account via ACH and monthly renewal. Financial institution account number. *Required if using ACH to pay renewal fee.

PaymentBankRoutingNumber

String

 

Required

Used to pay for an account via ACH and monthly renewal. Financial institution routing number.

Must be a valid ACH routing number. *Required if using ACH to pay renewal fee.

PaymentBankAccountType

String

 

Required

Used to pay for an account via ACH and monthly renewal. Valid values are: Checking and Savings

Response Values

Element

Type

Notes

transType

string

Will always return as 39.

status

string

Result of the transaction request. See Appendix for result code definitions.

tier

string

The tier the account was renewed under.

How to call this method?

Example Request

Example Response

Implementation Details
Request Submission

Response Handling

Request Submission

Response Handling

Request Submission

Response Handling

Request Submission

Response Handling

Request Values
Response Values