dolibarr 21.0.0-beta
|
Library for common paypal functions. More...
Go to the source code of this file.
Functions | |
paypaladmin_prepare_head () | |
Define head array for tabs of paypal tools setup pages. | |
print_paypal_redirect ($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $tag) | |
Send redirect to paypal to browser. | |
callSetExpressCheckout ($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $tag, $solutionType, $landingPage, $shipToName, $shipToStreet, $shipToCity, $shipToState, $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum, $email='', $desc='') | |
getDetails ($token) | |
Prepares the parameters for the GetExpressCheckoutDetails API Call. | |
confirmPayment ($token, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $tag) | |
Validate payment. | |
hash_call ($methodName, $nvpStr) | |
This function makes a DoDirectPayment API call. | |
deformatNVP ($nvpstr) | |
This function will take NVPString and convert it to an Associative Array and it will decode the response. | |
getApiError () | |
Get API errors. | |
Library for common paypal functions.
Definition in file paypal.lib.php.
callSetExpressCheckout | ( | $paymentAmount, | |
$currencyCodeType, | |||
$paymentType, | |||
$returnURL, | |||
$cancelURL, | |||
$tag, | |||
$solutionType, | |||
$landingPage, | |||
$shipToName, | |||
$shipToStreet, | |||
$shipToCity, | |||
$shipToState, | |||
$shipToCountryCode, | |||
$shipToZip, | |||
$shipToStreet2, | |||
$phoneNum, | |||
$email = '', | |||
$desc = '' ) |
Purpose: Prepares the parameters for the SetExpressCheckout API Call. Inputs: paymentAmount: Total value of the shopping cart currencyCodeType: Currency code value the PayPal API paymentType: paymentType has to be one of the following values: Sale or Order or Authorization returnURL: the page where buyers return to after they are done with the payment review on PayPal cancelURL: the page where buyers return to when they cancel the payment review on PayPal shipToName: the Ship to name entered on the merchant's site shipToStreet: the Ship to Street entered on the merchant's site shipToCity: the Ship to City entered on the merchant's site shipToState: the Ship to State entered on the merchant's site shipToCountryCode: the Code for Ship to Country entered on the merchant's site shipToZip: the Ship to ZipCode entered on the merchant's site shipToStreet2: the Ship to Street2 entered on the merchant's site phoneNum: the phoneNum entered on the merchant's site email: the buyer email desc: Product description See https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
double | $paymentAmount | Payment amount |
string | $currencyCodeType | Currency |
string | $paymentType | Payment type |
string | $returnURL | Return Url |
string | $cancelURL | Cancel Url |
string | $tag | Full tag |
string | $solutionType | Type ('Mark' or 'Sole') |
string | $landingPage | Landing page ('Login' or 'Billing') |
string | $shipToName | Ship to name |
string | $shipToStreet | Ship to street |
string | $shipToCity | Ship to city |
string | $shipToState | Ship to state |
string | $shipToCountryCode | Ship to country code |
string | $shipToZip | Ship to zip |
string | $shipToStreet2 | Ship to street2 |
string | $phoneNum | Phone |
string | ||
string | $desc | Description |
Definition at line 203 of file paypal.lib.php.
References $conf, getDolGlobalString(), getUserRemoteIP(), and hash_call().
Referenced by print_paypal_redirect().
confirmPayment | ( | $token, | |
$paymentType, | |||
$currencyCodeType, | |||
$payerID, | |||
$ipaddress, | |||
$FinalPaymentAmt, | |||
$tag ) |
Validate payment.
string | $token | Token |
string | $paymentType | Type |
string | $currencyCodeType | Currency |
string | $payerID | Payer ID |
string | $ipaddress | IP Address |
string | $FinalPaymentAmt | Amount |
string | $tag | Full tag |
Definition at line 358 of file paypal.lib.php.
References $conf, and hash_call().
deformatNVP | ( | $nvpstr | ) |
This function will take NVPString and convert it to an Associative Array and it will decode the response.
It is useful to search for a particular key and displaying arrays.
string | $nvpstr | NVPString |
Definition at line 577 of file paypal.lib.php.
Referenced by hash_call().
getApiError | ( | ) |
getDetails | ( | $token | ) |
Prepares the parameters for the GetExpressCheckoutDetails API Call.
string | $token | Token |
Definition at line 309 of file paypal.lib.php.
References $conf, and hash_call().
hash_call | ( | $methodName, | |
$nvpStr ) |
This function makes a DoDirectPayment API call.
paymentType: paymentType has to be one of the following values: Sale or Order or Authorization paymentAmount: total value of the shopping cart currencyCode: currency code value the PayPal API firstName: first name as it appears on credit card lastName: last name as it appears on credit card street: buyer's street address line as it appears on credit card city: buyer's city state: buyer's state countryCode: buyer's country code zip: buyer's zip creditCardType: buyer's credit card type (i.e. Visa, MasterCard ... ) creditCardNumber: buyers credit card number without any spaces, dashes or any other characters expDate: credit card expiration date cvv2: Card Verification Value
string | $methodName | is name of API method. |
string | $nvpStr | is nvp string. |
Definition at line 452 of file paypal.lib.php.
References $conf, deformatNVP(), dol_syslog(), getDolGlobalString(), and GETPOST().
Referenced by callSetExpressCheckout(), confirmPayment(), and getDetails().
paypaladmin_prepare_head | ( | ) |
Define head array for tabs of paypal tools setup pages.
Definition at line 34 of file paypal.lib.php.
References $conf, $object, and complete_head_from_modules().
print_paypal_redirect | ( | $paymentAmount, | |
$currencyCodeType, | |||
$paymentType, | |||
$returnURL, | |||
$cancelURL, | |||
$tag ) |
Send redirect to paypal to browser.
float | $paymentAmount | Amount |
string | $currencyCodeType | Currency code |
string | $paymentType | Payment type |
string | $returnURL | Url to use if payment is OK |
string | $cancelURL | Url to use if payment is KO |
string | $tag | Full tag |
Definition at line 71 of file paypal.lib.php.
References $conf, callSetExpressCheckout(), dol_syslog(), and getDolGlobalString().