This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hashSecretWord = 'tango'; //2Checkout Secret Word | |
$hashSid = 1303908; //2Checkout account number | |
$hashTotal = '1.00'; //Sale total to validate against | |
$hashOrder = $_REQUEST['order_number']; //2Checkout Order Number | |
$StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal)); | |
if ($StringToHash != $_REQUEST['key']) { | |
$result = "Fail - Hash Mismatch"; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ch = curl_init("https://www.2checkout.com/api/sales/detail_sale?sale_id=1234567890"); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json")); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_USERAGENT, "2Checkout PHP/0.1.0"); | |
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
curl_setopt($ch, CURLOPT_USERPWD, "apiusername:apipassowrd"); | |
$json_resp = curl_exec($ch); | |
curl_close($ch); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action='https://www.2checkout.com/checkout/spurchase' method='post'> | |
<input type='hidden' name='sid' value='1303908' > | |
<input type='hidden' name='mode' value='2CO' > | |
<input type='hidden' name='li_0_type' value='product' > | |
<input type='hidden' name='li_0_name' value='Monthly Subscription' > | |
<input type='hidden' name='li_0_price' value='1.00' > | |
<input type='hidden' name='li_0_recurrence' value='1 Month' > | |
<input name='submit' type='submit' value='Checkout' > | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"response_code": "OK", | |
"response_message": "Sale detail retrieved", | |
"sale": { | |
"comments": [ | |
{ | |
"changed_by_ip": "76.181.170.90", | |
"comment": "Refund Issued On Invoice: test", | |
"timestamp": "2012-08-26 22:27:20", | |
"username": "APIuser1817037" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE 2checkout_ins ( | |
id bigint(20) NOT NULL auto_increment, | |
timestamp varchar(18) NOT NULL default '0', | |
message_type varchar(32) NOT NULL default '0', | |
message_description varchar(64) NOT NULL default '0', | |
md5_hash varchar(32) NOT NULL default '0', | |
message_id bigint(20) NOT NULL default '0', | |
key_count smallint(6) NOT NULL default '0', | |
vendor_id int(8) NOT NULL default '0', | |
sale_id bigint(10) NOT NULL default '0', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URI; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.http.NameValuePair; | |
import org.apache.http.auth.AuthScope; | |
import org.apache.http.auth.UsernamePasswordCredentials; | |
import org.apache.http.client.entity.UrlEncodedFormEntity; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.client.utils.URLEncodedUtils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_POST['message_type'] == 'FRAUD_STATUS_CHANGED') { | |
$insMessage = array(); | |
foreach ($_POST as $k => $v) { | |
$insMessage[$k] = $v; | |
} | |
$hashSecretWord = "tango"; # Input your secret word |