Giter Site home page Giter Site logo

bpizzi / paypal-merchant-sdk-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imkow/sdks

0.0 2.0 0.0 44.09 MB

New simple and easy to use SDKs for all PayPal APIs

Home Page: https://www.x.com/developers/paypal

License: Other

PHP 100.00%

paypal-merchant-sdk-php's Introduction

PayPal PHP Merchant SDK

Prerequisites

PayPal's PHP Merchant SDK requires

  • PHP 5.2 and above with curl extension enabled

Using the SDK

To use the SDK,

  • Copy the config and lib folders into your project.
  • Make sure that the lib folder in your project is available in PHP's include path
  • Include the services\PayPalAPIInterfaceService\PayPalAPIInterfaceServiceService.php file in your code.
  • Create a service wrapper object
  • Create a request object as per your project's needs. All the API request and response classes are available in services\PayPalAPIInterfaceService\PayPalAPIInterfaceServiceService.php
  • Invoke the appropriate method on the request object.

For example,

require_once('services/PayPalAPIInterfaceService/PayPalAPIInterfaceServiceService.php');	require_once('PPLoggingManager.php');

$itemAmount = new BasicAmountType();
$itemAmount->currencyID = $_REQUEST['currencyCode'];
$itemAmount->value = $_REQUEST['itemAmount'];
$setECReqType = new SetExpressCheckoutRequestType();
$setECReqType->SetExpressCheckoutRequestDetails = $setECReqDetails;
$setECReqType->Version = '86.0';
$setECReq = new SetExpressCheckoutReq();
$setECReq->SetExpressCheckoutRequest = $setECReqType;
......

$paypalService = new PayPalAPIInterfaceServiceService();
$setECResponse = $paypalService->SetExpressCheckout($setECReq);

$ack = strtoupper($setECResponse->Ack);

if($ack == 'SUCCESS') {
	// Success
}

SDK Configuration

replace the API credential in config/sdk_config.ini . You can use the configuration file to configure

  • (Multiple) API account credentials.
  • Service endpoint and other HTTP connection parameters

Please refer to the sample config file provided with this bundle.

paypal-merchant-sdk-php's People

Contributors

aydiv avatar bpizzi avatar carsongregory avatar ganeshx avatar kumaravel-jayakumar avatar lathavairamani avatar palavilli-godaddy avatar samcleaver avatar tkanta avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.