Coder Social home page Coder Social logo

openplatform-sdk-php's Introduction

使用方法

1.使用composer(推荐)

composer config secure-http false && composer require golden-corp/openplatform-sdk

use Gd\Sdk;

require __DIR__ . "/../autoload.php";

$obj = new Sdk("testappkey111", "请更正为自己的appsecret", "test", "1.0.0");

$str = <<<str
{
  "buyer_title": "sdfsdfsdf",
  "invoice_type_code":"032",
  "title_type": 1,
  "order_id":"13332311x1asdfcsdcc",
  "buyer_taxpayer_num": "123456789406426",
  "buyer_address": "广东 深圳 南山",
  "buyer_bank_name": "**工商银行",
  "buyer_bank_account": "621281240200099900000",
  "buyer_phone": "0755—26951098",
  "buyer_email": "[email protected]",
  "user_openid": "201708022e87777ggg74",
  "channel": "GP110001",
  "machine_no":"0",
  "seller_taxpayer_num":"111112222233333",
  "callback_url":"http://test.feehi.com/sign/mock/invoice-callback.php",
  "tax_amount":864,
  "amount_has_tax":9508,
  "amount_without_tax":8644,
  "drawer":"ddd",
  "items": [
    {
      "name": "商品1",
      "tax_rate": 100,
      "models": "XYZ",
      "unit": "个",
      "total_price": 8644,
      "price":"17.288",
      "tax_amount":864,
      "total": "5",
      "include_tax_flag":"1",
      "tax_code": "1020202000000000000",
      "discount":0,
      "tax_type":"1",
      "preferential_policy_flag":"0"
    }
  ]

}
str;

$post = json_decode($str, true);
$result = $obj->httpRequest("/invoice/blue", $post);
var_dump($result);
print_r($obj->getLog());

2.手动加载

下载源码到目录,假设放置在/path/to/golden目录中

use Gd\Sdk;

require "/path/to/golden/autoload.php";

$obj = new Sdk("testappkey111", "请更正为自己的appsecret", "test", "1.0.0");

运行example

    composer run-script example

openplatform-sdk-php's People

Contributors

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