Announcement

Collapse
No announcement yet.

Process Refund through API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Process Refund through API

    Hi,

    I am trying to process a Refund through API, I am getting the following error

    AdditionalInfo=The
    'urn:APISchema.xsd:Version' element is invalid - The value '' is invalid according to its datatype
    'String' - The actual length is less than the MinLength value.

    When I use the below payload, can you please take a look and let me know if I am missing something.

    <CnPAPI
    xmlns="urn:APISchema.xsd"><Version>12</Version><Engine><Application><ID></ID><Name></Name><Version><
    /Version></Application><Request><Authentication><AccountGuid> *********************</
    AccountGuid><AccountID>******</AccountID></Authentication><Order><OrderMode>Test</OrderMode><Tracker>
    <![CDATA[272727]]></Tracker><Campaign><![CDATA[]]></Campaign><CardHolder></CardHolder><ThirdParty></
    ThirdParty><Receipt><SendReceipt>false</SendReceipt><Language>ENG</Language><OrganizationInformation
    ><![CDATA[]]></OrganizationInformation><ThankYouMessage><![CDATA[]]></ThankYouMessage><
    TermsCondition><![CDATA[]]></TermsCondition><Deductible>false</Deductible></Receipt><Transaction><
    TransactionType>Refund</TransactionType><ReferenceTransaction><OrderNumber >1512040059586231111</
    OrderNumber><VaultGUID>705d5684-7404-42db-a207-e842152b32bf</VaultGUID></ReferenceTransaction></
    Transaction></Order></Request></Engine></CnPAPI>

    Thank you.
    Last edited by sri_gull; 12-23-2015, 12:06 PM.

  • #2
    Good day!

    We will review this shortly but the best way to test the XML for the API is through here: https://verify.paas.cloud.clickandpledge.com/

    When you post the resulting XML in this verification site it will show you the issue.
    Regards,
    Click & Pledge Support Department

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/

    Comment


    • #3
      Good day!

      The version # needs to be specified if you pass the node. If you do not wish to use it then do not pass it, otherwise a value needs to be added. Please double check with the schema: https://s3.amazonaws.com/clickandple.../APISchema.zip


      Code:
          <xsd:element name="Version">
              <xsd:simpleType>
                  <xsd:annotation>
                      <xsd:documentation>Specifies the CnPAPI engine version</xsd:documentation>
                  </xsd:annotation>
                  <xsd:restriction base="xsd:string">
                      <xsd:minLength value="1"/>
                      <xsd:maxLength value="100"/>
                  </xsd:restriction>
              </xsd:simpleType>
          </xsd:element>
      The field is not mandatory but if listed needs to have a value, see example below:

      Code:
          <Application>
            <Name>Connect</Name>
            <Version>1.0</Version>
          </Application>
      Hope that answers your question.
      Regards,
      Click & Pledge Support Department

      Join us @ the educational webinars: https://clickandpledge.com/webinars/
      Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/

      Comment


      • #4
        Hi,

        Thank you for responding, below is the code I was given by the click and pledge team to get Refunds working

        CnP_IaaS.PaaS_Class xmlstring = new CnP_IaaS.PaaS_Class();
        CnP_IaaS.PaaS_Class.Operation XmlOperation = new CnP_IaaS.PaaS_Class.Operation();
        CnP_IaaS.PaaS_Class.Application xmlapplication = new CnP_IaaS.PaaS_Class.Application();
        CnP_IaaS.PaaS_Class.Order XmlOrder = new CnP_IaaS.PaaS_Class.Order();
        CnP_IaaS.PaaS_Class.Authentication XmlAuthentication = new CnP_IaaS.PaaS_Class.Authentication();
        CnP_IaaS.PaaS_Class.cnpTransaction xmltransaction = new CnP_IaaS.PaaS_Class.cnpTransaction();
        CnP_IaaS.PaaS_Class.Receipt xmlReceipt = new CnP_IaaS.PaaS_Class.Receipt();
        xmloperation.DeclineFraud = false;
        xmloperation.EnableRestriction = false;
        xmlstring.getApplication_node(xmlapplication);
        xmlstring.getOperation_node(xmloperation);
        XmlAuthentication.AccountID =Accountnumber; // Portal Account Number
        XmlAuthentication.AccountGuid=AccountVaultGuid; // Portal Account GUID
        xmlstring.getAuthentication_node(XmlAuthentication );
        XmlOrder.OrderMode = 'Production';
        xmlstring.getOrder_node(XmlOrder);
        xmlReceipt.SendReceipt=false;
        xmlstring.getreceipt_node(xmlReceipt);
        xmltransaction.TransactionType='Refund';
        xmltransaction.OrderNumber=Ordernumber; // Transaction Ordernumber
        xmltransaction.VaultGUID=VaultGUID; // Transaction VaultGUID
        xmlstring.getRefundTransactionDetails_node(xmltran saction);
        xmlstring.getgeneraterefundxml(xmlstring);
        xmlstring.Send_Transaction_api(xmlstring.xmlfile);

        below are the issues I am having

        1) I am getting the “Method is not visible” error for getgeneraterefundxml(), so I am using getgeneratexml(), I don’t know if it makes any difference.
        2) As per your suggestion I removed Application_node which solved the issue mentioned in my previous post
        3) Getting a nullpointer exception in this line “xmlstring.getOperation_node(xmloperation)”, this is happening in the package class itself, I don’t know if I am missing any other node.
        4) Instead of using the code I just wanted to check if the xml works,
        I used the following XML
        <CnPAPI xmlns="urn:APISchema.xsd"><Version>12</Version><Engine><Request><Operation><OperationType > Transaction</OperationType><IPAddress>45.23.177.52</IPAddress><DeclineFraud>true</DeclineFraud>< EnableRestriction>true</EnableRestriction><UrlReferrer></UrlReferrer></Operation><Authentication>< AccountGuid>bf0e70b2-3358-4d18-91a8-d8d3f9039944</AccountGuid><AccountID>*****</AccountID></ Authentication><Order><OrderMode>Test</OrderMode><Tracker><![CDATA[272727]]></Tracker><Campaign><![ CDATA[]]></Campaign><CardHolder></CardHolder><ThirdParty></ThirdParty><Receipt><SendReceipt>false</ SendReceipt><Language>ENG</Language><OrganizationInformation><![CDATA[]]></OrganizationInformation>< ThankYouMessage><![CDATA[]]></ThankYouMessage><TermsCondition><![CDATA[]]></TermsCondition>< Deductible>false</Deductible></Receipt><Transaction><TransactionType>Refund</TransactionType>< ReferenceTransaction><OrderNumber>1512040059586231 111</OrderNumber><VaultGUID>705d5684-7404-42db-
        a207-e842152b32bf</VaultGUID></ReferenceTransaction></Transaction></Order></Request></Engine></ CnPAPI>


        so I entered the operation module directly into the XML and tried, then I started getting a error to enter a value for “CardHolder”, which is present in the “Order” tag , I also removed that from the xml, now looks like there is no error in the XML but I am getting the TransactionResultCode as 3502, can you tell me what does 3502 mean and how to solve the above errors, can you also tell me what is the “OrderNumber”, is it required to get the refunds and is it same as TransactionID

        Thank you.

        Comment


        • #5
          Good day!

          I have requested one of our developers to review this.

          We need to ask you for a favor. If an issue is solved please start a new thread. The new one you posted is not related to the original post and as such will create confusion for visitors as well as our team.

          Thank you.
          Regards,
          Click & Pledge Support Department

          Join us @ the educational webinars: https://clickandpledge.com/webinars/
          Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/

          Comment


          • #6
            Good day!

            The reason you are not able to issue credit is that it is a test transaction and test transactions cannot be refunded since they had not settled.

            Only actual live transactions with real credit cards may be refunded.

            Hope that answers your question.
            Regards,
            Click & Pledge Support Department

            Join us @ the educational webinars: https://clickandpledge.com/webinars/
            Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/

            Comment

            Working...
            X