0

I am using Rest API to get security token using unique securityID and other parameters. I am using following code :

HttpRequest httpRequest = new HttpRequest();
httpRequest.setEndpoint('https://pilot-payflowpro.paypal.com');
String body = 'PARTNER=Paypal&PWD=pwd&VENDOR=abc&USER=abc&CREATESECURERTOKEN=Y&SECURETOKENID=9a9ea8208de1413abc3d60c86cb1f4ce&TRXTYPE=C&AMT=23.0&MODE=TEST';
httpRequest.setBody(body);
httpRequest.setMethod('GET');
Http htt = new hTTP();
HttpResponse httpRe = htt.send(httpRequest);
system.debug(httpRe.geTbody());

But I am getting following error : RESULT=2&PNREF=A7X06D187FF7&RESPMSG=Invalid tender

Please suggest how to rectify this.

user3727204
  • 55
  • 1
  • 1
  • 6

1 Answers1

0

You dont appear to be passing a tender type:

TENDER (Required) The method of payment. Values are: * A = Automated clearinghouse * C = Credit card * D = Pinless debit * K = Telecheck * P = PayPal See the Payflow ACH Payment Service Guide for details on the Automated clearinghouse tender type.

Ind_KevinG
  • 1,945
  • 14
  • 9
  • Is this required for getting security token ? – user3727204 Jul 21 '14 at 20:21
  • You are getting the Invalid tender error because you are not passing the "Tender" NVP. According to the [Payflow Pro Developer's Guide](https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowpro_guide.pdf), Page 26 it is a required parameter. – Ind_KevinG Jul 21 '14 at 20:29
  • As per this video http://www.youtube.com/watch?v=qyiv3ndRcZI. We only need to add amount and transaction type.I just need to get security token. I don't want to do transaction. – user3727204 Jul 21 '14 at 20:32
  • Like this is the example : curl https://pilot-payflowpro.paypal.com -kd "PARTNER=PayPal& VENDOR=MyMerchantID& USER=UserID& PWD=UserPassword& TRXTYPE=S& AMT=40& CREATESECURETOKEN=Y& SECURETOKENID=12528208de1413abc3d60c86cb15" – user3727204 Jul 21 '14 at 20:37
  • @user3727204 Did you ever solve this? I'm experiencing the same problem. – Gustav Apr 22 '15 at 09:41