Beispiel #1
0
<?php

################
# Using html() #
################
$paypal = new GoPayPal(THIRD_PARTY_CART);
//$paypal->sandbox = true;
$paypal->openInNewWindow = true;
$paypal->set('business', '*****@*****.**');
$paypal->set('currency_code', 'SGD');
$paypal->set('country', 'SG');
$paypal->set('return', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=thirdpartycart');
$paypal->set('cancel_return', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=thirdpartycart');
$paypal->set('notify_url', 'http://cithu.0fees.net/GoPayPal/Example/payment_complete.php');
# rm must be 2, need to be hosted online
$paypal->set('rm', 2);
# return by POST
$paypal->set('no_note', 0);
$paypal->set('custom', md5(time()));
$paypal->set('cbt', 'Return to our site to validate your payment!');
# caption override for "Return to Merchant" button
// $paypal->set('shipping', 5); # this doesn't work for THIRD_PARTY_CART
$paypal->set('handling_cart', 1);
# this overide the individual items' handling "handling_x"
$paypal->set('tax_cart', 0.29);
# Add first item
$item = new GoPayPalCartItem();
$item->set('item_name', 'Drupal for Dummies');
$item->set('item_number', 10);
$item->set('amount', 9.99);
$item->set('quantity', 1);
Beispiel #2
0
<?php

################
# Using html() #
################
$paypal = new GoPayPal(SUBSCRIBE);
//$paypal->sandbox = true;
//$paypal->openInNewWindow = true;
$paypal->set('business', '*****@*****.**');
$paypal->set('currency_code', 'SGD');
$paypal->set('country', 'SG');
$paypal->set('item_name', 'Subscription');
$paypal->set('a3', 10);
$paypal->set('p3', 2);
$paypal->set('t3', 'W');
$paypal->set('return', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=subscribe');
$paypal->set('cancel_return', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=subscribe');
$paypal->set('notify_url', 'http://cithu.0fees.net/GoPayPal/Example/payment_complete.php');
# rm must be 2, need to be hosted online
$paypal->set('rm', 2);
# return by POST
$paypal->set('no_note', 0);
$paypal->set('custom', md5(time()));
$paypal->set('cbt', 'Return to our site to validate your payment!');
# caption override for "Return to Merchant" button
# If you set your custom button here, PayPal subscribe button will be displayed.
//$paypal->setButton('<button type="submit">Pay PayPal - The safer, easier way to pay online!</button>');
echo $paypal->html();
if (sizeof($_POST)) {
    echo '<pre>';
    print_r($_POST);
Beispiel #3
0
<?php

################
# Using html() #
################
$paypal = new GoPayPal(GIFT_CERTIFICATE);
//$paypal->sandbox = true;
$paypal->openInNewWindow = true;
$paypal->set('business', '*****@*****.**');
$paypal->set('currency_code', 'SGD');
$paypal->set('country', 'SG');
$paypal->set('item_name', 'Gift Item');
$paypal->set('item_number', '001');
$paypal->set('amount', '50');
$paypal->set('min_denom', '10');
$paypal->set('max_denom', '500');
$paypal->set('shopping_url', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=gift_certificate');
$paypal->set('notify_url', 'http://cithu.0fees.net/GoPayPal/Example/payment_complete.php');
# rm must be 2, need to be hosted online
$paypal->set('rm', 2);
# return by POST
$paypal->set('no_note', 0);
$paypal->set('custom', md5(time()));
# If you set your custom button here, PayPal subscribe button will be displayed.
//$paypal->setButton('<button type="submit">Pay PayPal - The safer, easier way to pay online!</button>');
echo $paypal->html();
if (sizeof($_POST)) {
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
}
Beispiel #4
0
<?php

################
# Using html() #
################
$paypal = new GoPayPal(DONATE);
//$paypal->sandbox = true;
$paypal->openInNewWindow = true;
$paypal->set('business', '*****@*****.**');
$paypal->set('currency_code', 'SGD');
$paypal->set('country', 'SG');
$paypal->set('item_name', 'My donation');
$paypal->set('amount', '50');
$paypal->set('return', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=donation');
$paypal->set('cancel_return', 'http://cithu.0fees.net/GoPayPal/Example/index.php?api=donation');
$paypal->set('notify_url', 'http://cithu.0fees.net/GoPayPal/Example/payment_complete.php');
# rm must be 2, need to be hosted online
$paypal->set('rm', 2);
# return by POST
$paypal->set('no_note', 0);
$paypal->set('custom', md5(time()));
# If you set your custom button here, PayPal subscribe button will be displayed.
//$paypal->setButton('<button type="submit">Pay PayPal - The safer, easier way to pay online!</button>');
echo $paypal->html();
if (sizeof($_POST)) {
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
}
###################
# Using getHtml() #
Beispiel #5
0
<?php

################
# Using html() #
################
$paypal = new GoPayPal(BUY_NOW);
//$paypal->sandbox = true;
$paypal->openInNewWindow = true;
$paypal->set('business', '*****@*****.**');
$paypal->set('currency_code', 'SGD');
$paypal->set('country', 'SG');
$paypal->set('return', 'http://cithu.0fees.net/GoPayPal/Example/index.php');
$paypal->set('cancel_return', 'http://cithu.0fees.net/GoPayPal/Example/index.php');
$paypal->set('notify_url', 'http://cithu.0fees.net/GoPayPal/Example/payment_complete.php');
# rm must be 2, need to be hosted online
$paypal->set('rm', 2);
# return by POST
$paypal->set('no_note', 0);
$paypal->set('custom', md5(time()));
$paypal->set('tax', '0.99');
$paypal->set('shipping', '5.00');
$paypal->set('cbt', 'Return to our site to validate your payment!');
# caption override for "Return to Merchant" button
# Add item for Buy Now
$item = new GoPayPalCartItem();
$item->set('item_name', 'Drupal for Dummies');
$item->set('item_number', 10);
$item->set('quantity', 1);
$item->set('amount', '10.99');
$paypal->addItem($item);
# If you set your custom button here, PayPal subscribe button will be displayed.