Market Plugin With Paypal

Guys i am trying to hard code paypal integration into this module but am finding it difficult to use the available php code on the page to work with. I would be greatfull If someone could lend a help in hand to help work out the best way to do this?

In market/views/default/object/market.php there is a part that lists the price:

    $body .= "<span class='market_pricetag'><b>" . elgg_echo('') . "</b> {$currency}{$marketpost->price}</span>";
I wanted to get the price this way and then insert the price with php code, as each market post will have a new price. Same method for getting the title of the item etc...

I have provided some sample paypal code if someone can show me a deonstational way to do this?

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_xclick" />
  <input type="hidden" name="bn" value="webassist.dreamweaver.4_5_0" />
  <input type="hidden" name="business" value="paypal@domain.com" />
  <input type="hidden" name="item_name" value="Market Purchase" />
  <input type="hidden" name="item_number" value="Item Number" />
  <input type="hidden" name="amount" value="PRICE GOES HERE IN PHP" />
  <input type="hidden" name="currency_code" value="EUR" />
  <input type="hidden" name="handling" value="1.00" />
  <input type="hidden" name="return" value="http://domain.com" />
  <input type="hidden" name="cancel_return" value="http://domain.com/market" />
  <input type="hidden" name="undefined_quantity" value="1" />
  <input type="hidden" name="receiver_email" value="paypal@domain.com" />
  <input type="hidden" name="mrb" value="R-999999999999" />
  <input type="hidden" name="pal" value="A999999999999" />
  <input type="hidden" name="no_shipping" value="1" />
  <input type="hidden" name="no_note" value="0" />
  Content:<input type="hidden" name="on0" value="Content" />
  <select name="os0">
    <option value="Values">Values</option>
  </select>

  Qty: <input type="text" name="quantity" value="1" style="width:40px" />
  <input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" alt="Make payments with PayPal, it's fast, free, and secure!" />
</form>



  • Hi Mucker

    I have developed a similar plugin using paypal payment. I used the code below:

    $buybuttton = '
    <script src="PATH_TO_PAYPAL_BUTTON/paypal-button.min.js?merchant=PAYPALACCOUNT"
    data-button="buynow"
    data-name="TITLE OF PRODUCT"
    data-number="GUID OF PRODUCT"
    data-quantity="1"
    data-amount="PRICE"
    data-currency="CURRENCY"
    data-return="URL FOR RETURNING BACK"
    data-callback="URL FOR PROCCESSING THE TRANSACTION"
    ></script>
    ';

    (you have to replace all string with upper chars)

    Especially for "data-callback", you have to specify a page which receive the feedback from paypal (verified transaction or not) so you can submit the required actions for your elgg site e.g. this user bought this product.

    You can see the demo of this at http://elgg.lyberakis.gr/demo/agora/all (you have to login to see the paypal button)

     

     

  • Thanks for the reply nlybe, Does the Classifelds mod come integrated with paypal or not? I am using the paypal WebAssist application to connect to the paypal api. I am not the greatest coder when it comes to php, which is why i was hoping someone here could help me integrate it by looking at the code of the modules page above. 

    If you or someone here can help me intergrate this with paypal. It would be a sweet adition to Elgg. 

     

  • Yes, this plugin has integrated paypals payments for admin or for all users (admin decide)

  • Does it come with updates on the wire to say what people bought? Just wondering, but i am going to try it out and see what its like. 

    Thanks nlybe

  • No, i guess that every purchace should be private. But of course it can be modified.

    On activity river are displayed just new classifieds and comments