开发者

Selling Digital Goods/Ebooks With Authorize.Net IPN and PHP

i am trying to sell a few products off my website, and i need to just accept a credit card and be able to push a download to the buyer.

here's an excellent way to do this with paypal items

http://www.ngcoders.开发者_StackOverflowcom/php/selling-digital-goods-with-paypal-ipn-and-php

do you know if i can do the same thing authorize.net?


There are 3 ways to integrate your application with authorize.net:

  • Simple Checkout
  • Server Integration Method (SIM)
  • Advanced Integration Method (AIM)

You are most likely to use the 2nd approach.

Sample code can be downloaded here: http://developer.authorize.net/samplecode/

Basically, the form will look like this:

<FORM method='post' action='<?= $url ?>' >
    <INPUT type='hidden' name='x_login' value='<?= $loginID %>' />
    <INPUT type='hidden' name='x_amount' value='<?= $amount %>' />
    <INPUT type='hidden' name='x_description' value='<?= $description %>' />
    <INPUT type='hidden' name='x_invoice_num' value='<?= $invoice %>' />
    <INPUT type='hidden' name='x_fp_sequence' value='<?= $sequence %>' />
    <INPUT type='hidden' name='x_fp_timestamp' value='<?= $timeStamp %>' />
    <INPUT type='hidden' name='x_fp_hash' value='<?= $fingerprint %>' />
    <INPUT type='hidden' name='x_test_request' value='<?= $testMode %>' />
    <INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' />
    <input type='submit' value='<?= $label %>' />
</FORM>

And the URL is one of the following:

// Testing
$url = "https://test.authorize.net/gateway/transact.dll" ;
// Real account
$url = "https://secure.authorize.net/gateway/transact.dll" ;

See the sample code for more details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜