Skip to content

Commit 7df104c

Browse files
committed
initial commit
1 parent b6bfd8c commit 7df104c

19 files changed

+1568
-5
lines changed

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea/*
2-
vendor/*
2+
vendor/*
3+
public/*

.phpstorm.meta.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace PHPSTORM_META {
4+
5+
/** @noinspection PhpIllegalArrayKeyTypeInspection */
6+
/** @noinspection PhpUnusedLocalVariableInspection */
7+
$STATIC_METHOD_TYPES = [
8+
\Omnipay\Omnipay::create('') => [
9+
'Braintree' instanceof \Omnipay\Braintree\Gateway,
10+
],
11+
\Omnipay\Common\GatewayFactory::create('') => [
12+
'Braintree' instanceof \Omnipay\Braintree\Gateway,
13+
],
14+
];
15+
}

.scrutinizer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
4+
checks:
5+
php:
6+
remove_extra_empty_lines: true
7+
remove_php_closing_tag: true
8+
remove_trailing_whitespace: true
9+
fix_use_statements:
10+
remove_unused: true
11+
preserve_multiple: false
12+
preserve_blanklines: true
13+
order_alphabetically: true
14+
fix_php_opening_tag: true
15+
fix_linefeed: true
16+
fix_line_ending: true
17+
fix_identation_4spaces: true
18+
fix_doc_comments: true
19+
20+
tools:
21+
external_code_coverage:
22+
timeout: 600
23+
runs: 3

.travis.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
language: php
22

33
php:
4-
- 5.3
54
- 5.4
65
- 5.5
76
- 5.6
7+
- 7.0
88
- hhvm
99

10+
matrix:
11+
allow_failures:
12+
- php: 7.0
13+
include:
14+
- php: 5.4
15+
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
16+
1017
before_script:
11-
- composer install -n --dev --prefer-source
18+
- travis_retry composer self-update
19+
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
20+
21+
script:
22+
- phpunit --coverage-text --coverage-clover=coverage.clover
1223

13-
script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text
24+
after_script:
25+
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
All Notable changes to `omnipay/braintree` will be documented in this file
4+
5+

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ The following gateways are provided by this package:
2424

2525
* Braintree
2626

27+
You need to set your `merchantId`, `publicKey` and `privateKey`. Setting `testMode` to true will use the `sandbox` environment.
28+
29+
This gateway supports purchase through a token (payment nonce) only. You can generate a clientToken for Javascript:
30+
31+
```php
32+
$clientToken = $gateway->clientToken()->send()->getToken();
33+
```
34+
35+
You can use the Braintree JavaScript client to generate the token for your CreditCard data.
36+
37+
```php
38+
$response = $gateway->purchase([
39+
'amount' => '10.00',
40+
'token' => $_POST['payment_method_nonce']
41+
])->send();
42+
```
2743

2844
For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)
2945
repository.

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
"name": "Kayla Daniels",
1919
"email": "[email protected]"
2020
},
21+
{
22+
"name": "Barry vd. Heuvel",
23+
"email": "[email protected]"
24+
},
2125
{
2226
"name": "Omnipay Contributors",
2327
"homepage": "https://github.com/thephpleague/omnipay-braintree/contributors"
@@ -27,7 +31,8 @@
2731
"psr-4": { "Omnipay\\Braintree\\" : "src/" }
2832
},
2933
"require": {
30-
"omnipay/common": "~2.0"
34+
"omnipay/common": "~2.0",
35+
"braintree/braintree_php": "^3.1"
3136
},
3237
"require-dev": {
3338
"omnipay/tests": "~2.0"

0 commit comments

Comments
 (0)