Paypal REST API - anyone used?

Discussion in 'PHP' started by trustjon, Jun 21, 2013.

  1. #1
    Hello,

    I have been trying to implement the PayPal REST API for taking in payments. Everything works fine when I run the code from the API folder, but it does not work from outside.

    I suppose the reason for this are the lines:
    use PayPal\Api\Address;
    use PayPal\Api\Amount;
    use PayPal\Api\CreditCard;
    use PayPal\Api\Payer;
    use PayPal\Api\Payment;
    use PayPal\Api\FundingInstrument;
    use PayPal\Api\Transaction;

    I am not sure how they work. Does anyone have any idea?

    Thanks.
     
    trustjon, Jun 21, 2013 IP
  2. sorindsd

    sorindsd Well-Known Member

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    118
    #2
    What error do you get? I think you have to change define("PP_CONFIG_PATH",__DIR__);
     
    Last edited: Jun 22, 2013
    sorindsd, Jun 22, 2013 IP
  3. trustjon

    trustjon Well-Known Member

    Messages:
    120
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    120
    #3
    Hello sorindsd, Thanks for the answer. Will check it on Monday and will let you know if it worked.
     
    trustjon, Jun 22, 2013 IP
  4. trustjon

    trustjon Well-Known Member

    Messages:
    120
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    120
    #4
    Hello, hmm. this does not seem to help... "PP_CONFIG_PATH" was correct I suppose that is why it works when called from within the directory. The problems are the "use PayPal\Api\Address" lines, how to use them? Do I need to change them in all the files? or there is some short way to do it??
     
    Last edited: Jun 24, 2013
    trustjon, Jun 24, 2013 IP