定制 rtcamp/stripe-xero-csv 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rtcamp/stripe-xero-csv

Composer 安装命令:

composer create-project rtcamp/stripe-xero-csv

包简介

Export Stripe's balance affecting transactions in a CSV file, recognisable by Xero Import CSV Statement feature.

README 文档

README

The php script stripe-xero.php exports all Stripe balance affecting transactions into a CSV file recognisable by Xero Bank Account's import a CSV statement feature.

Currently it supports:

  1. Charges
  2. Refunds
  3. Payouts

Usage

Preparation

git clone https://github.com/rtcamp/stripe-xero-csv
cd stripe-xero-csv
composer install

Edit .env file to add correct Stripe API Key.

Finally run the script:

php stripe-xero.php

It will create a file stripe-xero-{date}.csv with all balance affecting transactions from your Stripe account.

Xero will skip duplicates during import so you need to worry about previously imported transactions appearing in CSV.

Email

The script supports emailing CSV as attachment to predefined email address. This comes handy if you are running script as a CRON job.

As of now only Amazon AWS SES is supported.

You need to set values of following variables in .env file:

  • EMAIL_FROM
  • EMAIL_TO
  • AWS_ACCESS_KEY
  • AWS_SECRET_KEY

Please make sure:

  1. EMAIL_FROM address must be verified already in SES console.
  2. You are using IAM API user to generate AWS_ credentials. SES SMTP credentials won't work.

crontab

Add a line like below for weekly emails @ Monday 10am.

0 10 * * 1	cd /path/to/stripe-xero-csv && /usr/bin/php stripe-xero.php >> stripe-xero.log 2>&1

Known Issues and Limitations

  1. Xero doesn't provide support for adding Stripe as a bank account. So we need to create a normal bank account with manual feed.
  2. Stripe doesn't provide Xero friendly statements. Xero supports many formats.
  3. Xero API doesn't have provision to insert bank statement lines. It's second most popular feature request pending from eternity i.e. 2009! This is main reason that you need to run this script locally and import CSV files manually.

TODO

  • Add support to generate CSV for a specific duration. Something like "this month", "last month" should be enough to start with.

LICENSE

MIT

Does this interest you?

Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 31
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固