Announcement

Collapse
No announcement yet.

Reuse existing Payment Method

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

  • Reuse existing Payment Method

    Hi C&P,

    We are continuing in writing our donation submittal integration and we want to implement the reuse of existing payment methods. I was made aware that there is no Payment Method object and that basically its a reference of a previous transaction that can be used as a base but how do we do that with the CnP_IaaS.PaaS_Class, I don't see where to add the Reference Transaction as stated in your API docs here: https://manual.clickandpledge.com/Tr...nceTransaction

    our send transaction method looks like this at the moment:

    Code:
            Map<String, Object> result = new Map<String,Object>();
    
            CnP_IaaS.PaaS_Class cnpxmlstring = new CnP_IaaS.PaaS_Class();
            CnP_IaaS.PaaS_Class.Operation Operation = new CnP_IaaS.PaaS_Class.Operation();
            CnP_IaaS.PaaS_Class.Order Order = new CnP_IaaS.PaaS_Class.Order();
            CnP_IaaS.PaaS_Class.Authentication Authentication = new CnP_IaaS.PaaS_Class.Authentication();
            CnP_IaaS.PaaS_Class.BillingInformation BillingInfo = new CnP_IaaS.PaaS_Class.BillingInformation();
            CnP_IaaS.PaaS_Class.BillingAddress BillingAddress = new CnP_IaaS.PaaS_Class.BillingAddress();
            CnP_IaaS.PaaS_Class.PaymentMethod PaymentMethod = new CnP_IaaS.PaaS_Class.PaymentMethod();
            CnP_IaaS.PaaS_Class.Receipt Receipt = new CnP_IaaS.PaaS_Class.Receipt();
    
            CnP_IaaS.PaaS_Class.cnpTransaction trans = new CnP_IaaS.PaaS_Class.cnpTransaction();
            trans.TransactionType = 'Authorize';
    
            Authentication.AccountID = 'xxx';//Replace with your Click & Pledge account number.
            Authentication.AccountGuid = 'xxx';//Replace with your Click & Pledge account GUID.
    
            Order.OrderMode='Test';
    
            cnpxmlstring.ItemsList = new List<CnP_IaaS.Paas_Class.Items>();
            CnP_IaaS.Paas_Class.Items i = new CnP_IaaS.Paas_Class.Items();
            i.ItemName = (String)gift.get('itemName');
            i.UnitPrice = (Decimal)gift.get('unitPrice');
            cnpxmlstring.ItemsList.add(i);
            BillingInfo.BillingFirstName = (String)gift.get('firstName');
            BillingInfo.BillingLastName = (String)gift.get('lastName');
            BillingAddress.BillingStateProvince = (String)gift.get('billinngState');
    
            PaymentMethod.NameOnCard = (String)gift.get('cardName');
            PaymentMethod.CardNumber = (String)gift.get('cardNumber');
            PaymentMethod.Cvv2 = (String)gift.get('cvv2');
            PaymentMethod.ExpirationMonth = (String)gift.get('expirationMonth');
            PaymentMethod.ExpirationYear = (String)gift.get('expirationYear');
    
            Operation.IPAddress = (String)gift.get('ip'); 
    
            cnpxmlstring.getOperation_node(Operation);
            cnpxmlstring.getOrder_node(Order);
            cnpxmlstring.getAuthentication_node(Authentication);
            cnpxmlstring.getBillingInformation_node(BillingInfo);
            cnpxmlstring.getBillingAddress_node(BillingAddress);
            cnpxmlstring.getItemslist_node(cnpxmlstring.getItemsList());
            cnpxmlstring.getTransactionDetails_node(trans);
            cnpxmlstring.getPaymentMethod_node(PaymentMethod);
            cnpxmlstring.getreceipt_node(Receipt);
            cnpxmlstring.getgeneratexml(cnpxmlstring);
    
    
            cnpxmlstring.Send_Transaction_api(cnpxmlstring.xmlfile);
    
            result.put('TransactionResultCode',cnpxmlstring.TransactionResultCode);
            result.put('ErrorData',cnpxmlstring.ErrorData);
            result.put('TransactionNumber',cnpxmlstring.TransactionNumber);
    
            return result;

    Thanks

  • #2
    Good day @dgarcia

    You will need to pass reference transaction information as shown below:

    PaymentMethod.vaultguid = VaultGUID of the Reference Transaction
    PaymentMethod.Ordernumber = Reference Transaction Ordernumber

    Please include the above and let us know if you find any issues.
    Regards,
    Click & Pledge Support Department

    On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
    Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

    Comment


    • #3
      Hi CnP.Support.AM unless I include all the code above with the vaultGUID and the orderNumber it wont work so I have a couple of questiosn:
      1. If we have the reference transaction info, why do we need the card information?
      2. Without the card information I get back a transaction code: 2052 but no error information, how can I get the error information back?
      3. Hijacking you attention a bit, can I also get which property I can set to make this a recurring transaction?
      Thank you for all your support

      Comment


      • #4
        Good day @dgarcia

        You will need to pass the following information:

        In case of Reference Transaction :

        PaymentMethod.PaymentType='ReferenceTransaction';
        PaymentMethod.vaultguid = VaultGUID of the Reference Transaction
        PaymentMethod.Ordernumber = Reference Transaction Ordernumber


        In case of Credit Card:

        PaymentMethod.PaymentType='CreditCard';
        PaymentMethod.NameOnCard = card holderName;
        PaymentMethod.CardNumber = card Number;
        PaymentMethod.Cvv2 = cvv2;
        PaymentMethod.ExpirationMonth = expirationMonth;
        PaymentMethod.ExpirationYear = expirationYear;


        Based on the PaymentType you need to pass those values to our API: https://manual.clickandpledge.com/PaymentMethod.html

        Regards,
        Click & Pledge Support Department

        On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

        Join us @ the educational webinars: https://clickandpledge.com/webinars/
        Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
        Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

        Comment


        • #5
          CnP.Support.AM thank you for that, it worked. Now my following question was about taking that transaction and setting it up as recurring. I am getting an xml error when setting in the code above

          trans.setRecurring(true);, is there anything more that needs to be set?

          Thanks

          Comment


          • #6
            Good day @dgarcia

            In case of recurring, along with trans.setRecurring(true) you need to include below code as well:

            trans.RecurringMethod
            trans.Periodicity
            trans.installment
            trans.enddate

            Please refer: https://manual.clickandpledge.com/Tr...ecurringMethod
            Regards,
            Click & Pledge Support Department

            On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

            Join us @ the educational webinars: https://clickandpledge.com/webinars/
            Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
            Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

            Comment

            Working...
            X