Giter Site home page Giter Site logo

alipay-sdk-php's Introduction

aliay-sdk-php

a modification of alipay php-sdk,icludes both openapi and mapi

Table of contents

modifications:

mapi

  • add md5 sign/verfy although not often used
  • add default configuration and alipay mapi public key

openapi

  • add namespaces
  • remove lotusphp_runtime requirement
  • add default configuration and alipay openapi public key

Installation

using composer:

composer require fishlab/aliay-sdk-php

Configuration

mapi

<?php

$alipay_config =[];
/// --- required ---
$alipay_config['partner'] = '2088xxx';

// requiref if sign_type is RSA
$alipay_config['private_key_path'] = 'key/mapi_rsa_private_key.pem';

// required if sign_type is MD5
// $alipay_config['key'] = 'your secret';

/// --- optional ----

// usually,seller_id equals partner
// $alipay_config['seller_id'] = $alipay_config['partner'];
// $alipay_config['ali_public_key_path']= 'key/alipay_public_key.pem';

// sign type,defualt is RSA
// $alipay_config['sign_type'] = 'RSA';

// support gbk or utf-8,default 'utf-8'
// $alipay_config['input_charset'] = 'utf-8';

// transfer protocol
// $alipay_config['transport'] = 'https';

openapi

<?php

$config = [
		'alipay_public_key_file' => __DIR__. "/key/alipay_openapi_rsa_public_key.pem",
		'merchant_private_key_file' => "you/openapi_rsa_private_key.pem",
		'charset' => "UTF-8",
		'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
		'app_id' => "2015123456000000"
];

Examples

see tests/*.php

License

MIT

alipay-sdk-php's People

Contributors

fishlab 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.