function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
muralikrishna.sfdcmuralikrishna.sfdc 

Payment gateway please help me

I am working under payment gateway , I am new to this

 

 

is it require to encode for sending our request .

 I have to  send four things through this

 

session id , application number , amount, type of process

 

first one is how to get session id in salesforce

 

after encoding ,is it the right process add each one and attach to the endpoint at the end..

 

please help me

Best Answer chosen by Admin (Salesforce Developers) 
Abhay AroraAbhay Arora

Hi ,

 

I have made a sample code for paypal integration. Please check

http://php-salesforce.blogspot.in/2011/02/salesforce-paypal-integration.html

 

To get session id UserInfo.getSessionId()

 

 

If you need more info just let me know

 

All Answers

sfdcfoxsfdcfox

Apex Code or a custom button? You might do this:

 

--GatewayURL--?sessionid={!URLENCODE($Api.Session_Id)}&appnumber={!URLENCODE(Application__c.ApplicationNumber__c)}&amount={!URLENCODE(Application__c.AmountRequested__c)}&processType={!URLENCODE(Application__c.ProcessType)}

In Apex Code, you can use UserInfo.getSessionId(). In any case, if they are expecting URL parameters, you'd use the url as constructed above, while if they need a post, you might instead place the parameters into the body of the request.

Abhay AroraAbhay Arora

Hi ,

 

I have made a sample code for paypal integration. Please check

http://php-salesforce.blogspot.in/2011/02/salesforce-paypal-integration.html

 

To get session id UserInfo.getSessionId()

 

 

If you need more info just let me know

 

This was selected as the best answer
muralikrishna.sfdcmuralikrishna.sfdc

Thanks for your answer .

 

 

 

Am I need to fallow any security issues for making HTTPs payment gateway request, Like SSL and any thing

muralikrishna.sfdcmuralikrishna.sfdc

Billdesk people are asking our end point to send the responce . how can we generate end point for taking responce.

 

 

my code is following like this

 

 

I am getting 200 erroe in http request

 

public class paymentGateWay {

     
 public string LAN{get;set;}
 public string Amount{get;set;}


  public PageReference goForPay() {
 
  paymentprocess1 pay =new paymentprocess1();
  pay.paymentprocess1m(LAN,Amount);
 
   string sessionid = UserInfo.getSessionId();
   string body='?txtCustomerId='+LAN+'&txtTxnAmount='+Amount;
   string body2= EncodingUtil.urlEncode(body, 'UTF-8');  
   
 
  Http h = new Http();

 
       HttpRequest req = new HttpRequest();
         req.setEndpoint('https://www.billdesk.com/pgidsk/pgmerc/mycompanyoption.jsp'+body);
         req.setMethod('POST');
       //HttpResponse res = new HttpResponse();   
       
       
 // HttpResponse res = h.send(req);
   // return res.getBody();         
   
   
   try {
         HttpResponse res= h.send(req);
         System.debug('STATUS:'+res.getStatus());
         System.debug('STATUS_CODE:'+res.getStatusCode());
         System.debug('BODY: '+res.getBody());
         
        } catch(System.CalloutException e) {
            System.debug('Callout error: '+ e);
           // System.debug(res.toString());
        }
 //system.debug('resSSSSSSSSSS'+res );
 
 
   
 // system.debug('pageref'+pageRef);
 // pageRef.setRedirect(true);
 
 system.debug('TTTTTTT'+req);
csreddy7799csreddy7799

Hello Murali,

 

             Have you implemented payment gateway in salesforce successfully?, i need some guidence from  you.