PayPal: Description
Iemand een idee hoe ik dat aanpak? (via een POST/GET vatiabele?)
PS het gaat niet om het maken van het registratienummer dat werkt prima... Alleen het versturen van de tekst!)
dan kan ik verder kijken
Dan zal je in de documentatie van die Joomla! extension moeten kijken.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
if ($length >= 1 && $length <= 4) {
if ($paymenttype == 1) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=" . $paypal_email . "&item_name=" . $paypal_org . "&amount=" . $amount . "&no_shipping=0&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dDonationsBF&charset=UTF%2d8&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($paymenttype == 2) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" . $paypal_email . "&item_name=" . $paypal_org . "&amount=" . $amount . "&no_shipping=0&no_note=1&tax=0¤cy_code=" . $currency_code . "&bn=PP%2dBuyNowBF&charset=UTF%2d8&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($paymenttype == 3) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=" . $paypal_email . "&item_name=" . $paypal_org . "&amount=" . $amount . "&add=1&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dShopCartBF&charset=UTF%2d8&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($paymenttype == 4) {
if ($length == 1) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=D&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($length == 2) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=W&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($length == 3) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=M&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($length == 4) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=Y&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
}
}
if ($paymentlocation != "") {
$header = $header . "&lc=" . $paymentlocation;
}
header($header);
}
?>
if ($length >= 1 && $length <= 4) {
if ($paymenttype == 1) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=" . $paypal_email . "&item_name=" . $paypal_org . "&amount=" . $amount . "&no_shipping=0&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dDonationsBF&charset=UTF%2d8&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($paymenttype == 2) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" . $paypal_email . "&item_name=" . $paypal_org . "&amount=" . $amount . "&no_shipping=0&no_note=1&tax=0¤cy_code=" . $currency_code . "&bn=PP%2dBuyNowBF&charset=UTF%2d8&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($paymenttype == 3) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=" . $paypal_email . "&item_name=" . $paypal_org . "&amount=" . $amount . "&add=1&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dShopCartBF&charset=UTF%2d8&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($paymenttype == 4) {
if ($length == 1) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=D&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($length == 2) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=W&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($length == 3) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=M&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
} else if ($length == 4) {
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=Y&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
}
}
if ($paymentlocation != "") {
$header = $header . "&lc=" . $paymentlocation;
}
header($header);
}
?>
Gewijzigd op 09/11/2010 17:47:34 door Chris Avontuur
Voor het geval iemand met het zelfde probleem:
Ik heb het op gelost door de links aan te passen:
OUDE CODE:
Code (php)
1
2
3
2
3
<?php
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=M&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
?>
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=" . $paypal_org . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=M&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
?>
NIEUWE CODE:
Code (php)
1
2
3
4
2
3
4
<?php
$invoice = "yyyymmddxxx" #wordt gevuld door een functie!
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=Invoice:" . $invoice . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=M&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
?>
$invoice = "yyyymmddxxx" #wordt gevuld door een functie!
$header = "Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=" . $paypal_email . "&item_name=Invoice:" . $invoice . "&no_shipping=1&no_note=1¤cy_code=" . $currency_code . "&bn=PP%2dSubscriptionsBF&charset=UTF%2d8&a3=" . $amount . "%2e00&p3=1&t3=M&src=1&sra=1&return=" . $paypalreturn . "&cancel=" . $paypalcancel;
?>
Zoek de verschillen en kleur de plaatjes!
Gewijzigd op 11/11/2010 16:53:03 door Chris Avontuur
http://php.net/manual/en/function.http-build-query.php
Daar kan je je code veel mooier mee maken
Kijk eens naar Daar kan je je code veel mooier mee maken