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
Type | Name | Description |
---|---|---|
SecurityToken | securityToken | Merchant security token: used to identify merchant and validate transaction. (required) |
string | customerId | Customer ID. (required) |
string | customerInternalId | Unique customer ID assigned by the internal system. (required) |
DateTime | fromDateTime | From payment date. (required) |
DateTime | toDateTime | To payment date. (required) |
int | start | Start position, defaults to 0 (first payment found). (required) |
int | limit | Maximum number of payments to return in result. (required) |
string | sort | Field name to sort the results by. (optional) |
Return Value
Type | Description |
---|---|
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>&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>&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>&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);
Updated about 2 years ago