Announcement

Collapse

Information Needed

See more
See less

Basic Example PaaS API Not Working

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

  • Basic Example PaaS API Not Working

    Hello,
    I am trying to run the PaaS API. I am using the CnP Basic Example provided in the library, below. I have only changed orderMode from Test to Production. It always come back as "decline". It looks that I have everything I need in the SFDC View State. The regular CnP Transaction works fine though. Any idea? Thanks again for your support.
    Jerome

    public with sharing class Example_Basic {
    public CnP_IaaS.Paas_Class cnpxmlstring{get;set;}
    public CnP_IaaS.Paas_Class.Operation Operation{get;set;}
    public CnP_IaaS.Paas_Class.Order Order{get;set;}
    public CnP_IaaS.Paas_Class.Authentication Authentication{get;set;}
    public CnP_IaaS.Paas_Class.BillingInformation BillingInfo{get;set;}
    public CnP_IaaS.Paas_Class.PaymentMethod PaymentMethod{get;set;}
    public CnP_IaaS.Paas_Class.Receipt Receipt{get;set;}
    public CnP_IaaS.Paas_Class.cnpTransaction cnptransaction{get;set;}
    public integer ResultCode {get;set;}
    public boolean error{set;get;}
    public Example_Basic(){
    list<CnPAccountSetting__c> SettingsList=[select C_P_AccountGUID__c,C_P_Account_Number__c,WID__c from CnPAccountSetting__c limit 1];
    if(SettingsList.isempty())
    {
    error=true;
    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.warning,'Plea se enter C&P Account details at C&P Account Information Tab and process');
    ApexPages.addMessage(myMsg);
    }
    cnpxmlstring=new CnP_IaaS.Paas_Class();
    Operation=new CnP_IaaS.Paas_Class.Operation();
    Order=new CnP_IaaS.Paas_Class.Order();
    Authentication=new CnP_IaaS.Paas_Class.Authentication();
    BillingInfo=new CnP_IaaS.Paas_Class.BillingInformation();
    PaymentMethod=new CnP_IaaS.Paas_Class.PaymentMethod();
    Receipt=new CnP_IaaS.Paas_Class.Receipt();
    cnptransaction=new CnP_IaaS.Paas_Class.cnpTransaction();
    string dd=datetime.now().format('MM/dd/yyyy');
    string mon=dd.substring(0,2);
    string year=dd.substring(7,10);
    PaymentMethod.ExpirationMonth=mon;
    PaymentMethod.ExpirationYear=year;
    //PaymentMethod.ExpirationMonth=
    }
    public void process(){
    list<CnPAccountSetting__c> SettingsList=[select C_P_AccountGUID__c,C_P_Account_Number__c,WID__c from CnPAccountSetting__c limit 1];
    Authentication.AccountGuid=SettingsList[0].C_P_AccountGUID__c;
    Authentication.AccountID=SettingsList[0].C_P_Account_Number__c;
    Order.OrderMode='Production';
    for(CnP_IaaS.Paas_Class.Items i : cnpxmlstring.ItemsList){
    i.ItemName='Donation';
    }
    cnpxmlstring.getOperation_node(Operation);
    cnpxmlstring.getOrder_node(Order);
    cnpxmlstring.getAuthentication_node(Authentication );
    cnpxmlstring.getBillingInformation_node(BillingInf o);
    cnpxmlstring.getItemsString_node(cnpxmlstring);
    cnpxmlstring.getTransactionDetails_node(cnptransac tion);
    cnpxmlstring.getPaymentMethod_node(PaymentMethod);
    cnpxmlstring.getreceipt_node(Receipt);
    cnpxmlstring.getgeneratexml(cnpxmlstring);
    if(cnpxmlstring.Verifyxmlfile==false){
    cnpxmlstring.Send_Transaction_api(cnpxmlstring.xml file);
    }
    }
    }

  • #2
    Good day!

    You may have blacklisted yourself by testing in Production.

    <DeclineFraud>true</DeclineFraud>

    Please set the above node to False during testing so the fraud system does not trigger.

    We need to review your IP and remove you from the blacklist database. Please change the node and do test transactions in TEST mode.

    Please note that in TEST mode we don't check for fraud but when in production patterns are analyzed and the system may flag you if it thinks you are verifying credit cards.
    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