PHP Classes
elePHPant
Icontem

File: example_request.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mubashir Ali  >  PayPal Request Money  >  example_request.php  >  Download  
File: example_request.php
Role: Example script
Content type: text/plain
Description: Sample Example file of Request Money
Class: PayPal Request Money
Send e-mail to request a payment via Paypal
Author: By
Last change:
Date: 3 years ago
Size: 1,043 bytes
 

Contents

Class file image Download
<?php
    error_reporting
(15);

    require_once(
'class.request.money.php');
   
   
$objReq = new PayPalRequestMoney("sandbox");

   
$amount = "64.00";

   
$aryData = array();
   
$aryData['recipient_email'] = "saad_ali6@yahoo.com";
   
$aryData['amount'] = number_format(doubleval($amount), 2);
   
$aryData['subject'] = "TEST MERCHANT NAME would like to be paid through PayPal.";
   
$aryData['invoice'] = strtotime('now');
   
$aryData['message'] = "Additional Amount Request";

   
$contents = $objReq->requestMoney($aryData);
    if(!
$contents)
    {
        echo
"Please Check that OpenSSL is enabled from php.ini file. <br />";
        exit(
"ERROR: Encryption Failed");
    }

   
    if(
$objReq->sendEmail($aryData['recipient_email'], "", $aryData['subject'], "" , $contents))
    {
        echo
"Request Money Email is sent Successfully.";
    }
    else
    {
        echo
"Error Sending Request Money Email.<br /><br />The Email Contents are: <br /><br />";
        echo
$contents;
    }
?>