php


How to complete a shopping application? [closed]


I've read many many guides and tutorials on how to make a shopping application, the only one thing they never covered is how to preform the actual checkout, how to charge the user's credit card/paypal after the checkout.
So can anyone point me to the right direction with this one? How do I preform a complete checkout, charging the user's provided credit card/PayPal account, verifying the payment, and then returning a result (success/fail) back to the user?
Thanks in advance.
For completing the transaction, you'll need separate methods for each payment. For PayPal, you'll need to integrate with your API, and the same with google. For normal credit card transactions, you'll need to hook up with a Payment Gateway. You may wish to look at Authorize.net. They're large and well established.
You'll need to look at the gateway and determine if it meets your needs for business flow, as well as their API for communication (SOAP, XML-RPC, REST, etc).
Aside from them, a few other popular transaction gateways are:
1800Pay
2Checkout.com
2Checkout.com 2.0
381808
Accesspoint
Atlantic-Pacific Processing
BeanStream Gateway
Bluefin Gateway
BluePay 2.0
Braintree Payment Solutions
Broadpay
CCBill
Chargeback Guardian Gateway
Check21.com
CheckGateway.com
ChronoPay
ClearCommerce
Comstar Gateway
Concord EFSnet 2.4
CyberSource
DalPay
DHD Media
Direct Payment Solutions
Durango
E-Commerce Exchange Pro
eAccounts Gateway
ECHO
EcorePay Gateway
Enterpayment
eProcessingNetwork
Evoke 360
eWay
Fast Charge
FASTeCom
FastTransact
FirePay
First Data Global Gateway
Gate2Shop
Global Electronic Technology Gateway
GoEmerchant
Group ISO Gateway
Impact Payments
Innovative Gateway
Instabill Gateway
IntelliPay
Internet Secure
Iongate
iTransact
LinkPoint Gateway
LiveMerchant.com
LUCY Gateway
Merchant e-Solutions Gateway
MerchantWarehouse.com
Modern Payments
Moneris e-Select Gateway
Moneris e-Select Plus
Moneris e-Select Plus US
MSC
MultiCards
NET1
Netbilling
Network Merchants Gateway
NobelPay Gateway
Novapointe
Optimal Payments
PacNet Services Raven
PayByCheck
PayDollar
PayJunction
Paymentech
Payments Gateway
Payovation Gateway
PayPal PayFlow Pro
PayTrace
Plug N Pay
ProPay Gateway
Protx VPS Direct
PsiGate
Quantum Payment
QuickBooks Merchant Services
ReoPay
Sage Payments
SecureNet
SecurePay
SkipJack
Transact24
Transaction Central
Transaction Pro
TransFirst eLink Gateway
UltraCart Test Gateway
US Financial Services Group
USA ePay
Verepay
Verifi Gateway
VeriSign PayFlow Link
viaKlix 2
Virtual Merchant
VPG
WorldPay
WorldPay Direct
YourPay Connect
ZipZap
http://developer.paypal.com should have piles of documentation regarding how IPN and its other payment gateway services work.
I would use Paypal or Google Wallet if you are not handling credit card details through the site. If you are planning to use something like Barclays or HSBC merchant services then you are going to need to become PCI compliant with Security Metrics. You'll also need to make sure that you have an SSL certificate installed etc. For more details... https://www.securitymetrics.com/
You can utilise the Paypal API and send the details back to a process page on your server.
In Paypal account you can specify the return url for the IPN... This might be https://
Here's an example of a process page sending to Paypal. This is using the native HTML format.
/// actual url
$formurl = "https://www.paypal.com/cgi-bin/webscr";
$business = "Your email";
}
?>
<form name="client_details_form" id="client_details_form" method="post" action="<?php echo $formurl; ?>" accept-charset="utf-8" >
<h1 id="message_main_message"></h1>
<?php if($_POST['checkout_type'] == "paypal"){ ?>
<input type="hidden" name="business" value="<?php echo $business; ?>">
<input type="hidden" name="upload" id="upload" value="http://www.hlandhlantiquities.com/index.php?page=send_recieve_cart" />
<input type="hidden" name="cmd" value="_cart" />
<!-- standard type <input type="hidden" name="cmd" value="_cart" />
webstuff <input type="hidden" name="cmd" value="_cart" />
-->
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="email" value="<?php echo $client_email; ?>" />
<input type="hidden" name="RETURNURL" value="returnurl/index.php?page=send_recieve_cart" />
<input type="hidden" name="CANCELURL" value="cancelurl/index.php?page=send_recieve_cart" />
<!-- for updating client transactions... list the trasaction id and the client and session -->
<input type='hidden' name='custom' value='<?php echo $_SESSION['userid']; ?>|<?php echo $_SESSION['transaction_id']; ?>|<?php echo $_SESSION['PHPSESSIONID']; ?>|<?php echo $discount_id; ?>'>
<input type='hidden' name='invoice' value='<?php echo $_SESSION['uniqueid']; ?>'>
<?php if ($discount_value > 0) { ?>
<p style="color:red;" ><?php echo $client_message; ?></p>
<?php } ?>
while($row = mssql_fetch_assoc($query_transaction)) {
if($_POST['checkout_type'] == "paypal"){
echo '<input type="hidden" name="transaction_item_id_' . $count . '" id="transaction_item_id_' . $count . '" value="' . $row['transaction_item_id'] . '" />';
echo '<input type="hidden" name="antiquity_id_' .$count . '" id="antiquity_id_' . $count . '" value="' . $row['ID'] . '" />';
if($av_discount > 0) {
echo '<input type="hidden" name="amount_' .$count . '" id="amount_' . $count . '" value="' . round(($row['current_price']-$av_discount),2) . '" />';
} else {
echo '<input type="hidden" name="amount_' .$count . '" id="amount_' . $count . '" value="' . $row['current_price'] . '" />';
}
echo '<input type="hidden" name="item_name_' .$count . '" id="item_name_' . $count . '" value="' . $row['ItemName'] . '" />';
///echo '<input type="hidden" name="item_number_' .$count . '" name="item_number_' . $count . '" value="' . $row['transaction_item_id'] . '" />';
echo '<input type="hidden" name="custom_' .$count . '" id="custom_' . $count . '" value="' . $row['ID'] . '" />';
$Total += $row['current_price'];
$count++;
}
<input type="submit" name="submit" value="transact" />
Ok so that goes to paypal for every item in your cart you incriment the name by 1 (that's the use of the $count variable)
ONce the user has processed the payment it can send back to the page I split the custom field to identify my transaction and update my database that the items were sold... That page explodes the posted transaction_subject which related to my custom field back into individual parts...
$transitems = explode("|",$_POST['transaction_subject']);
$client_details_id = $transitems[0];
$transaction_id = $transitems[1];
$PHPSESSIONID = $transitems[2];
$discount_id = $transitems[3];
$handler_trans_id = $_POST['txn_id'];
$supplier_email = $_POST['receiver_email'];
$purchaser_email = $_POST['payer_email'];
$date = date('Y-m-d H:i:s');
You can now use this information to update your database.
Hope this is somewhat helpful.
Andi

Related Links

Cancel a Stripe authorization without refunding
which api method is good to start working on magento Webservices [closed]
WordPress get post type archive link
Jquery Ajax, PHPMailer doesn't send emails even if there's no error but works if i use stand alone page with fix values
How to provide source to img tag in loop in php
$_GET variable depends on the redirect URL
Retrieve values from 2 different tables and put them in a view with Laravel
Working with PHP __autoload on Cloud9
iPhone Safari, Are you sure you want to resubmit this form again? prompt
How do I get the current user details for a phpFox website?
how to download uploaded files?
php Why can't I run a batch file?
trying to send steam trade offer with php curl
Preselecting an option from a select field in a fields array?
inserting data in mysql db via Drupal Rules module
Build Stripped HTML Array from String in PHP

Categories

HOME
kivy
website
whmcs
odata
twitter-fabric
dronekit-python
gentelella
facebook-android-sdk
haxe
ag-grid
onvif
phpseclib
selection
gtk
driver
yeoman-generator-angular
watch-os-3
sap-fiori
android-externalstorage
outlook-restapi
dhcp
trace32
mailgun
bnf
cocos2d-android
susy-sass
weex
pymongo
fluent-migrator
amazon-sns
fusetools
plyr
envoy
netbios
delayed-job
image-optimization
winrm
subclassing
pdfnet
love2d
uivisualeffectview
gitolite
opal-framework
daz3d
bit-shift
.net-micro-framework
ol3-google-maps
md5-file
test-data
lvalue
1010
yui3
data-management
wininet
callouts
mathml
openseadragon
jeditable
swiffy
ioctl
cfwheels
green-threads
karma-coverage
ampersand
signed
pass-by-value
nanomsg
ildasm
inputbox
windows-rt
relationships
lumia-imaging-sdk
reference-counting
sql-function
profiles
acceptance-testing
user-forums
towers-of-hanoi
sfinae
cakeyframeanimation
glassfish-esb
motodev-studio
groovy-console
botnet
database-deadlocks
fragment-identifier
qcar-sdk
webresponse
aptitude
ios-4.2
ixmldomdocument
spring-modules
processors
accumulator
efs
webclient.uploaddata

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App