Wednesday 15 August 2012

php - How do I get the information returned in the IPN after a transaction in PayPal using ci_merchant library? -


I am a newbie for codeigniter and so far I am doing good to develop my first application. However, when I tried to integrate the CIMARCATT library on the site, I have been sent properly to PayPal and I can successfully complete the transaction and redirect my website. However, in addition to removing this information and posting the database, how can I verify "hidden information" sent by PayPal?

I have this in my controller:

  public function place_order ($ id = NULL) {$ this- & gt; Merchant- & gt; Load ('paypal_express'); $ Id = $ this- & gt; Session-> Userdata ('id'); $ CUSTOMER_ID = $ ID; $ Rules = $ this- & gt; Order_m-> Rules_place_order; $ This- & gt; Form_validation- & gt; Set_rules ($ rules); If ($ this-> form_validation-> run () == FALSE) // verification {$ this-> Data ['subview'] = 'customer / order_view' has not been passed; $ This- & gt; Load-> View ('templates / header_customer'); $ This- & gt; Load-> View ('customer / _layout_main', $ this- & gt; data); $ This- & gt; Load-> View ('templates / footer_customer'); } Else // Proceed to success logic after verification {// model $ data = $ this- & gt; Order_m-> Array_frame_order (array 'topic' title, 'discipline', 'academic_level', 'type_off_sev' 'paper_format', 'pages', 'no_of_sources', 'no_of_slides', 'paper_details', 'deadline', 'time zone' )); $ Data ['CUSTOMER_ID'] = $ id; $ This- & gt; Order_m-> Save_data ($ data); $ This- & gt; Db- & gt; Where ('CUSTOMER_ID', $ id); // Final put id $ some = $ this-> Db- & gt; Get insert_id (); $ Settings = $ this- & gt; Merchant- & gt; Default_settings (); // Payments for the order $ params = Array ('zodiac' => 100.00, 'currency' = & gt; 'USD', 'return_url =' = & gt; http: // local host / customer / order / Paypal ',' do not cancel '= & gt; http: // local host / customer / order'); $ Response = $ this- & gt; Merchant- & gt; Purchase ($ parameter); }} Public function PayPal () {var_dump ($ _ GET); $ This- & gt; Merchant- & gt; Load ('paypal_express'); $ Settings = $ this- & gt; Merchant- & gt; Default_settings (); $ Params = Array ('zodiac' => 100.00, 'currency' => 'USD',); $ Response = $ this- & gt; Merchant- & gt; Purchase_return ($ parameter); Var_dump ($ response); If ($ response-> status () == Merchant_response :: authorized) {resonant "status is authorized"; } If ($ response-> position () == Merchant_response :: FAILED) {resonance "status is unsuccessful"; } If ($ response-> position () == Merchant_response :: REDIRECT) {Resonance "condition is radial"; } If ($ reaction-> position () == Merchant_response :: COMPLETE) {echo "status is full"; } If ($ response-> status () == Merchant_response :: refunded) {Resonance "status refunded"; }   

This redirects me successfully in PayPal and I can complete the transaction. However, I am unable to proceed from here because I am a newbie for payment processing. Please tell me in the right direction how to: 1. Confirm every transaction with PayPal and be able to visualize and post this data. 2. Before reprinting the customer from PayPal, I compare the database related information with information obtained from PayPal.

You need to call the purchase_return () method when the customer is sent to your return_url This transaction will confirm PayPal.

No comments:

Post a Comment