Announcement

Collapse
No announcement yet.

Salesforce PaaS_Class.Operation

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Salesforce PaaS_Class.Operation

    his is a continuation of the previous question:

    Originally posted by sri_gull
    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.
    I am taking over implementation of this.


    The previous developer response:
    Originally posted by Support.Department
    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.
    I've created a live transaction and attempting to process a refund for it with a valid transaction number.

    When I attempt:

    Code:
    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);
            XmlAuthentication.AccountID = PaymentProcessor.SETTINGS.Click_Pledge_Account_ID__c;
            XmlAuthentication.AccountGuid = PaymentProcessor.SETTINGS.Click_Pledge_Account_GUID__c;
    
            if (PaymentProcessor.SETTINGS.Enable_Live_Transactions__c == true) {
                XmlOrder.OrderMode = 'Production';
            } else {
                XmlOrder.OrderMode = 'Test';
            }
    
            ////XmlOrder.setTracker(tracker);
            xmlReceipt.SendReceipt = false;
            xmltransaction.TransactionType = 'Refund';
            xmltransaction.OrderNumber = transactionNumber; // Transaction Ordernumber
    
            //xmlstring.getRefundTransactionDetails_node(xmltransaction);
            xmlstring.getOperation_node(xmloperation);
            xmlstring.getOrder_node(XmlOrder);
            xmlstring.getAuthentication_node(XmlAuthentication);
            xmlstring.getreceipt_node(xmlReceipt);
            xmlstring.getTransactionType();
            xmlstring.getgeneratexml(xmlstring);
            System.debug('************* -- ' + xmlstring.xmlfile);
            //System.debug(xmlstring.xmlfile);
            xmlstring.Send_Transaction_api(xmlstring.xmlfile);
    
            TransactionResult result = new TransactionResult();
            System.debug(xmlstring);
            if (xmlstring.TransactionResultCode == 0) {
                result.isSuccess = true;
    
            } else {
                result.isSuccess = false;
            }
    
            //result.transactionResultCode = xmlstring.TransactionResultCode;
            //result.errorData = xmlstring.ErrorData;
            //result.transactionNumber = xmlstring.TransactionNumber;
            //result.VaultGUID = cnpXmlString.VaultGUID;
            //result.AdditionalInfo = cnpXmlString.AdditionalInfo;
            return null;
    * I am using Live Transactions (in my settings)

    I get a "null pointer exception" when I attempt to call:

    Code:
    xmlstring.getOperation_node(xmloperation);
    Examining the schema, I see

    Code:
    <xsd:element name="Operation">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="OperationType"/>
                    <xsd:element ref="IPAddress" minOccurs="0"/>
                    <xsd:element ref="DeclineFraud" minOccurs="0"/>
            <xsd:element ref="KountSessionID" minOccurs="0"/>
                    <xsd:element ref="EnableRestriction" minOccurs="0"/>
                    <xsd:element ref="UrlReferrer" minOccurs="0"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    So I attempt to directly assign:
    Code:
    xmloperation.OperationType = 'Refund';
            xmlstring.getOperation_node(xmloperation);
    This does not change the behavior from within the package code.

    * This is odd because reviewing another method ( previously implemented ) for payments, and the call to xmlstring.getOperation_node(...) works normally
    Last edited by jordanbaucke; 01-12-2016, 02:22 PM.

  • #2
    Good day!

    Would you please grant us login access so we can review your case. The error is an internal error when there is an extreme violation that nothings makes sense to the processor.

    Our lead developer in charge of this aspect sent the following code as an example:

    Code:
    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(xmltransaction);
            xmlstring.getgeneraterefundxml(xmlstring);
            xmlstring.Send_Transaction_api(xmlstring.xmlfile);
    if you grant us login access to your instance so we can review your instance we can find the root cause. Please try the above and let me know if that helps.
    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
      One more point:

      The IP address in the operation node should not be used in the VF page and ONLY be used outside the scope of the VF page. If you do this will throw an exception by Salesforce.

      So ONLY use the IP address in the operations node when not in a VF page, for example you may pass the IP in the dev console.
      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
        CnP.Support

        I have granted login access on org id: 00DJ0000003O9R2

        Please also upgrade the installed C&P Packages installed there. Once we have finished testing I will have you upgrade in other sandboxes / production before we go live.

        The code snippet you provided here is the same as the one I have now.

        Thanks,

        Jordan


        Originally posted by Support.Department
        Good day!

        Would you please grant us login access so we can review your case. The error is an internal error when there is an extreme violation that nothings makes sense to the processor.

        Our lead developer in charge of this aspect sent the following code as an example:
        Code:
        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(xmltransaction);
        xmlstring.getgeneraterefundxml(xmlstring);
        xmlstring.Send_Transaction_api(xmlstring.xmlfile);
        if you grant us login access to your instance so we can review your instance we can find the root cause. Please try the above and let me know if that helps.
        @Click

        Comment


        • #5
          Good day!

          To help with this process we developed a VF page for you as an example:In the page you need to give the Order Number and the VaultGUID of the transaction to process the refund.

          In reviewing your instance we also discovered that you have not pasted the GUID correctly. Please see the following images:

          Click image for larger version

Name:	image_2324.jpg
Views:	80
Size:	58.3 KB
ID:	21515


          But in Salesforce you have:
          Click image for larger version

Name:	image_2326.jpg
Views:	66
Size:	41.5 KB
ID:	21514


          The number is short a "4" at the end.

          Please resolve the issues as shown and test the page - hopefully this answers your question.
          Last edited by CnP.Support; 01-16-2016, 12:47 PM.
          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
            Originally posted by Support.Department
            Good day!

            To help with this process we developed a VF page for you as an example:In the page you need to give the Order Number and the VaultGUID of the transaction to process the refund.

            In reviewing your instance we also discovered that you have not pasted the GUID correctly. Please see the following images:
            Thank you for adding this page code. I think actually my toolset was attempting to compile the PaaS class improperly. As such I kept getting "Method is not visible" issues. When I attempted to edit the page directly from VF I was able to get it to function.

            I'm concerned though - isn't having the account #/Guid in a public-visible forum a bit of a security issue?

            Comment


            • #7
              Good day!

              I will remove it but the GUID is not important. All forms need to have it as a posted value and there is nothing anyone can do with it. Let us assume that someone takes your the GUID and all the other variables of your account then they can process money and deposit it in your account. It is like having your email and sending you money through PayPal.

              The GUID has no security importance.
              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
              😀
              🥰
              🤢
              😎
              😡
              👍
              👎