GetPayments

Description

This method is used to search the payments database during a certain period of time using customerInternalId or customerId.

Syntax

Payment[] GetPayments(SecurityToken securityToken, string customerId, string customerInternalId, System.DateTime fromDateTime, System.DateTime toDateTime, int start, int limit, string sort)

Arguments

TypeNameDescription
SecurityToken securityTokenMerchant security token: used to identify merchant and validate transaction. (required)
stringcustomerIdCustomer ID. (required)
stringcustomerInternalIdUnique customer ID assigned by the internal system. (required)
DateTimefromDateTimeFrom payment date. (required)
DateTimetoDateTimeTo payment date. (required)
intstartStart position, defaults to 0 (first payment found). (required)
intlimitMaximum number of payments to return in result. (required)
stringsortField name to sort the results by. (optional)

Return Value

TypeDescription
PaymentResponse (doc:paymentresponses) ](/docs/payment)This object contains all payment information, including payment, invoice, and customer information.

Examples

function getPayments(){
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '********-454757-4567457-********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$getPayments = array(
'securityToken' => $securityToken,
'invoiceNumber' => 'in-123',
'paymentInternalId' => 21,
);
$getPaymentsResponse = $client->GetPayments($getPayments);
$getPaymentsResponseResult = $getPaymentsResponse->GetPaymentsResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:GetPayments>
         <ebiz:securityToken>
            <ebiz:SecurityId>*******-90b4-4a38-ad78-********</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:customerId/>
         <ebiz:customerInternalId/>
         <ebiz:fromDateTime>2013-12-21T03:32:42-08:00</ebiz:fromDateTime>
         <ebiz:toDateTime>2016-01-01T11:07:42</ebiz:toDateTime>
         <ebiz:start>0</ebiz:start>
         <ebiz:limit>3</ebiz:limit>
         <ebiz:sort/>
      </ebiz:GetPayments>
   </soapenv:Body>
</soapenv:Envelope>


Response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <GetPaymentsResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <GetPaymentsResult>
            <Payment>
               <CustomerId>SP0115</CustomerId>
               <SubCustomerId>S01743</SubCustomerId>
               <DivisionId>001</DivisionId>
               <InvoiceNumber>112008158</InvoiceNumber>
               <InvoiceInternalId>********-796b-4350-b39c-********</InvoiceInternalId>
               <InvoiceDate>2013-01-21</InvoiceDate>
               <InvoiceDueDate>2013-02-20</InvoiceDueDate>
               <PoNum>&amp;nbsp;</PoNum>
               <InvoiceAmount>-2346.2200</InvoiceAmount>
               <AmountDue>-3013.7200</AmountDue>
               <AuthCode>273046</AuthCode>
               <RefNum>62158562</RefNum>
               <Last4>1111</Last4>
               <PaymentMethod>Visa</PaymentMethod>
               <DatePaid>2015-02-25T05:34:04</DatePaid>
               <PaidAmount>0.2200</PaidAmount>
               <PaymentInternalId>********-95b3-4b6d-a7a7-********</PaymentInternalId>
            </Payment>
            <Payment>
               <CustomerId>SP0115</CustomerId>
               <SubCustomerId>S01743</SubCustomerId>
               <DivisionId>001</DivisionId>
               <InvoiceNumber>112008158</InvoiceNumber>
               <InvoiceInternalId>********-796b-4350-b39c-********</InvoiceInternalId>
               <InvoiceDate>2013-01-21</InvoiceDate>
               <InvoiceDueDate>2013-02-20</InvoiceDueDate>
               <PoNum>&amp;nbsp;</PoNum>
               <InvoiceAmount>-2346.2200</InvoiceAmount>
               <AmountDue>-3013.7200</AmountDue>
               <AuthCode>300235</AuthCode>
               <RefNum>62213422</RefNum>
               <Last4>1111</Last4>
               <PaymentMethod>Visa</PaymentMethod>
               <DatePaid>2015-02-25T17:27:21</DatePaid>
               <PaidAmount>5.0000</PaidAmount>
               <PaymentInternalId>********-771a-42c4-a5bb-********</PaymentInternalId>
            </Payment>
            <Payment>
               <CustomerId>SP0115</CustomerId>
               <SubCustomerId>S01743</SubCustomerId>
               <DivisionId>001</DivisionId>
               <InvoiceNumber>112008158</InvoiceNumber>
               <InvoiceInternalId>********-796b-4350-b39c-********</InvoiceInternalId>
               <InvoiceDate>2013-01-21</InvoiceDate>
               <InvoiceDueDate>2013-02-20</InvoiceDueDate>
               <PoNum>&amp;nbsp;</PoNum>
               <InvoiceAmount>-2346.2200</InvoiceAmount>
               <AmountDue>-3013.7200</AmountDue>
               <AuthCode>315415</AuthCode>
               <RefNum>62244676</RefNum>
               <Last4>1111</Last4>
               <PaymentMethod>Visa</PaymentMethod>
               <DatePaid>2015-02-26T03:10:11</DatePaid>
               <PaidAmount>1.0000</PaidAmount>
               <PaymentInternalId>********-2a24-4943-83a7-********</PaymentInternalId>
            </Payment>
         </GetPaymentsResult>
      </GetPaymentsResponse>
   </s:Body>
</s:Envelope>
var client = new EBizSOAP.IeBizServiceClient();
EBizSOAP.SecurityToken securityToken = new EBizSOAP.SecurityToken();
securityToken.UserId = "";
securityToken.SecurityId = "*******-90b4-4a38-ad78-********";
securityToken.Password = "";
EBizSOAP.Payment[] payments = client.GetPayments(securityToken, "", "", DateTime.Parse("03/03/2016 00:00:00"), DateTime.Parse("03/03/2016 23:59:59"), 0, 100, "");
Console.WriteLine(payments[0].CustomerId);
Console.WriteLine(payments[0].InvoiceNumber);
Console.WriteLine(payments[0].PaymentMethod);
Console.WriteLine(payments[0].PaidAmount);
Console.WriteLine(payments[0].RefNum);
Console.WriteLine(payments[0].Last4);
Console.WriteLine(payments[0].AmountDue);