You need to login in order to make a new post. If you do not have a community account, you can get one here.

Sample php code

Hello,

I am looking for sample code in php which will tell me if a payment made by a customer was success or faliure.

Just like Paypal’s IPN. I need similar thing for 2co.

Thanks.

RSS feed

5 Comments »

# Comment by zeppelin 2CO Staff
2010-02-04 16:55:14

Greetings kikloo,

Our Direct Return feature will pass the customer and the sale parameters to the approved URL that you specify. An example return script is available for download at acmeonlinebooks.com, our demonstration website. The download link is labeled “Download examples and return script”.

More information regarding Direct Return is located here.

Our Instant Notification System can also send messages to a URL that you specify within your 2Checkout.com account. More information regarding the INS can be found here.

 
 
# Comment by dumbguy
2010-02-17 22:04:07

There is something wrong in the return parameters..now sure what I am doing wrong…

In the example script, these parameters are shown as returned:

$_POST['order_number']
$_POST['total']

where as in my live test order, none of these params are returned. I got the following params instead:

2010-02-16 22:12:54 IPN [bill_city][]
2010-02-16 22:12:54 IPN [bill_country][USA]
2010-02-16 22:12:54 IPN [bill_postal_code][]
2010-02-16 22:12:54 IPN [bill_state][]
2010-02-16 22:12:54 IPN [bill_street_address][]
2010-02-16 22:12:54 IPN [bill_street_address2][]
2010-02-16 22:12:54 IPN [cust_currency][USD]
2010-02-16 22:12:54 IPN [customer_email][email@gmail.com]
2010-02-16 22:12:54 IPN [customer_first_name][name]
2010-02-16 22:12:54 IPN [customer_ip][174.00.00.00]
2010-02-16 22:12:54 IPN [customer_ip_country][United States]
2010-02-16 22:12:54 IPN [customer_last_name][Name]
2010-02-16 22:12:54 IPN [customer_name][Name]
2010-02-16 22:12:54 IPN [customer_phone][0000000000]
2010-02-16 22:12:54 IPN [fraud_status][wait]
2010-02-16 22:12:54 IPN [invoice_cust_amount][1.00]
2010-02-16 22:12:54 IPN [invoice_id][4203490910]
2010-02-16 22:12:54 IPN [invoice_list_amount][1.00]
2010-02-16 22:12:54 IPN [invoice_status][pending]
2010-02-16 22:12:54 IPN [invoice_usd_amount][1.00]
2010-02-16 22:12:54 IPN [item_count][1]
2010-02-16 22:12:54 IPN [item_cust_amount_1][1.00]
2010-02-16 22:12:54 IPN [item_duration_1][]
2010-02-16 22:12:54 IPN [item_id_1][1]
2010-02-16 22:12:54 IPN [item_list_amount_1][1.00]
2010-02-16 22:12:54 IPN [item_name_1][Cart purchase: 1]
2010-02-16 22:12:54 IPN [item_rec_date_next_1][]
2010-02-16 22:12:54 IPN [item_rec_install_billed_1][]
2010-02-16 22:12:54 IPN [item_rec_list_amount_1][]
2010-02-16 22:12:54 IPN [item_rec_status_1][]
2010-02-16 22:12:54 IPN [item_recurrence_1][]
2010-02-16 22:12:54 IPN [item_type_1][bill]
2010-02-16 22:12:54 IPN [item_usd_amount_1][1.00]
2010-02-16 22:12:54 IPN [key_count][56]
2010-02-16 22:12:54 IPN [list_currency][USD]
2010-02-16 22:12:54 IPN [md5_hash][74CD88E6EECE64EE6E3473DA61BE4DE2]
2010-02-16 22:12:54 IPN [message_description][New order created]
2010-02-16 22:12:54 IPN [message_id][1]
2010-02-16 22:12:54 IPN [message_type][ORDER_CREATED]
2010-02-16 22:12:54 IPN [payment_type][paypal ec]
2010-02-16 22:12:54 IPN [recurring][0]
2010-02-16 22:12:54 IPN [sale_date_placed][2010-02-16 22:12:35]
2010-02-16 22:12:54 IPN [sale_id][4201190212]
2010-02-16 22:12:54 IPN [ship_city][]
2010-02-16 22:12:54 IPN [ship_country][]
2010-02-16 22:12:54 IPN [ship_name][]
2010-02-16 22:12:54 IPN [ship_postal_code][]
2010-02-16 22:12:54 IPN [ship_state][]
2010-02-16 22:12:54 IPN [ship_status][]
2010-02-16 22:12:54 IPN [ship_street_address][]
2010-02-16 22:12:54 IPN [ship_street_address2][]
2010-02-16 22:12:54 IPN [ship_tracking_number][]
2010-02-16 22:12:54 IPN [timestamp][2010-02-16 22:12:35]
2010-02-16 22:12:54 IPN [vendor_id][1291121]
2010-02-16 22:12:54 IPN [vendor_order_id][]
2010-02-16 22:12:54 FORMING KEY FROM:
2010-02-16 22:12:54 KEY FORMED1: 8CBDEEDC6F5A0C5DAF3C5027387683EB

So the key I have formed in code is very different from what is returned by 2co..

I have used these values to form the key:

sale_id, vendor_id, invoice_usd_amount, and my secret word

What is wrong here??

 
# Comment by bion 2CO Staff
2010-02-18 12:01:50

dumbguy

I will have one of our support team answer this soon.

 
 
 
# Comment by dumbguy
2010-02-19 10:03:46

Any update on this please? I am stuck.

 
 
# Comment by ricks 2CO Staff
2010-02-19 11:29:40

dumbguy,

Please contact us directly so that we may better assist you with the issue you are encountering.

 
 
You need to login before leaving a comment If you do not have an account, you can register one here.

Recent Activity:

Welcome to 2Checkout!

2Checkout is a full-service e-commerce solution recognized by Inc. Magazine as one of the fastest growing companies in the United States. 2CO’s proprietary technology supports back-office functions including financial reporting, tracking, fraud prevention, affiliate tracking, customer service and sales tracking. Click here to learn more.

Spotlight Supplier

Spotlight Supplier

Premium Web Hosting

Spotlight Shopping Cart

Spotlight Shopping Cart

VPASP Shopping Cart


Popular Tags

$150 2Checkout 2CO account accounting address affiliate approval automatic beta billing buy cart celebrity changes chargeback charges checkout consumer credit card currency customer delivery download email error essay Euro extension fee fraud FX Getting Started help India INS intangible integration international IPN issues joomla language laptop link login logo md5 medison Money monthly notification option order oscommerce Pakistan Parameter parameter error parameters payment payments payoneer payoneer card paypal pending Product product options products purchase recurring Recurring Payments refund refunds release level returns risk sales scam script sellers sell mp3 service Services setup shipping shopping shopping cart software status subscription subscriptions suggestions support third party Transfer url Valdi vendor verification website