Skip to main content

Confirm payment for Proforma Invoices

Confirm payment for Proforma Invoices

Last updated: 08-Feb-2019
Rate this article:

Overview

Use this method to confirm the payment for proforma invoices issued to your partners on the Direct Payment module. To confirm the payment for a proforma invoice, you need to follow these steps before calling the confirmInvoicePayment API method:

  1. Authenticate to 2Checkout API based on these instructions.
  2. Set the partner for which you want to confirm the payment (method explained in the sample below).
  3. Set the proforma invoice  (method explained in the sample below).
  4. Confirm the payment using the instructions below.

Requirements

You can confirm payments only for partners set with Direct business model. Learn here how to set a business model to your partners.

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.
partnerCode Required (String)
  The unique identifier that you need to specify when creating a partner in the Control Panel. You can find it under the General Information area when editing partner details.
proformaNo Required (String)
  The unique identifier of a partner invoice from the 2Checkout system.
rrn Optional (String)
  The code associated with the proforma invoice payment reference (receipt registration number).

Response

Parameters Type/Description

TRUE

FALSE

Boolean

True - method is successful

False - method is not successful

Error messages

Error code Error description
INVALID_PARTNER No partner is set or the proforma does not belong to the partner set.
PAYMENT_PROFORMA The proforma invoice has already been paid.
INVALID_PROFORMA The proforma invoice number is invalid.
INVALID_METHOD The partner set is not on the Direct business model.

Request

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.2checkout.com/Integration/07Channel_Manager_API/SOAP/02Authentication
require ('PATH_TO_SET_PARTNER'); // setPartner example: https://knowledgecenter.2checkout.com/Integration/07Channel_Manager_API/SOAP/06Reference/00Partner/00Set_partner


$partnerCode = 'partner_code'; // direct

try {
    $setPartner = $client->setPartner($sessionID, $partnerCode);
    var_dump($setPartner);
} catch (SoapFault $e) {
    echo "<pre>";
    echo $e->xdebug_message;
    echo $e->getMessage();
}


$proformaNo = '6';

try {
    $setProforma = $client->setProforma($sessionID, $proformaNo);
    var_dump($setProforma);
} catch (SoapFault $e) {
    echo "<pre>";

    echo $e->getMessage();
}

try {
    $confirmInvoicePayment = $client->confirmInvoicePayment($sessionID);
    var_dump($confirmInvoicePayment);
} catch (SoapFault $e) {

    echo $e->getMessage();
}
Rate this article:
Logo of Verifone