Retrieve check payment details
Last updated: 10-May-2017
Rate this article:
Overview
Retrieve the check payment details that customers must use or have used to pay for an order.
Requirements
Parameters
Parameter | Type/Description |
---|---|
sessionID | Required (String) |
Session identifier string, output of the Login method. An exception is thrown if the values are incorrect. | |
refNo | Required (String) |
Order reference number of an order that was marked with CHECK as payment method. |
Response
Parameter | Type/Description | |
---|---|---|
CheckPaymentDetails |
Object |
|
|
Details below |
|
|
Beneficiary |
String |
|
|
Payment beneficiary name. Can be NULL. |
|
CheckPostalAddress |
String |
|
|
Beneficiary address. Can be NULL. |
|
CheckAccountHolderName |
String |
|
|
Beneficiary account holder name. Can be NULL. |
|
Country |
String |
|
|
Beneficiary country. Can be NULL. |
|
Amount |
Double |
|
|
Total order costs. Can be NULL. |
|
Currency |
String |
|
|
Order currency ISO code – ISO 4217. Can be NULL. |
Request
<?php
require ('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication
require ('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/Partner/00Set_partner
$proformaNumber = 'YOUR_PROFORMA_NUMBER';
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setProforma',
'params' => array($sessionID, $proformaNumber)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));
$paymentDetails = new stdClass();
$paymentDetails->Type = 'CHECK';
$paymentDetails->Curency = 'USD';
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setPaymentDetails',
'params' => array($sessionID, $paymentDetails)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'payProforma',
'params' => array($sessionID)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));
$refNo = 'YOUR_ORDER_REFERENCE_NUMBER';
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getCheckPaymentDetails',
'params' => array($sessionID, $refNo)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));
Errors
Error | Description |
---|---|
INVALID_PARTNER |
No partner is set. |
PAYMENT_PROFORMA |
You have to set a partner invoice first. |
PAYMENT_NOT_SUPPORTED |
The current partner invoice is not set as payable through check. |
Rate this article: