Skip to content

Commit 916f5a3

Browse files
Merge pull request #6 from petricarg/pypi-package-3.6
Prepare RocketGate 3.8 package
2 parents 69ff260 + fb3fd46 commit 916f5a3

37 files changed

Lines changed: 213 additions & 33 deletions

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Build & publish
3+
on: [push]
4+
jobs:
5+
6+
build:
7+
name: Build wheel
8+
# Only build wheel on tag pushes
9+
if: startsWith(github.ref, 'refs/tags/')
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.8"
21+
22+
- name: Install hatch
23+
run: python3 -m pip install hatch --user
24+
25+
- name: Build
26+
run: hatch build -t wheel
27+
28+
- name: Save wheel as artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
publish:
35+
name: Create GitHub release & publish to PyPI
36+
# Only publish to PyPI on tag pushes
37+
if: startsWith(github.ref, 'refs/tags/')
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/p/RocketGate
44+
permissions:
45+
# Required to create GitHub release
46+
contents: write
47+
# Required to authenticate with PyPI
48+
id-token: write
49+
50+
steps:
51+
- name: Download wheel artifact
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: python-package-distributions
55+
path: dist/
56+
57+
- name: GitHub Release
58+
uses: softprops/action-gh-release@v1
59+
with:
60+
body: ${{ github.event.workflow_run.head_commit.message }}
61+
files: dist/RocketGate-${{ github.ref_name }}-py3-none-any.whl
62+
63+
- name: PyPI Release
64+
uses: pypa/gh-action-pypi-publish@release/v1
65+
66+
# Note that when testing, we weren't able to delete a release from PyPI,
67+
# then re-upload with the same version number. We must always publish
68+
# a unique version, even if the previous version was deleted from PyPI.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ __pycache__
33
tests/__pycache__
44
tests/.DS_Store
55
.DS_Store
6-
/venv
6+
/venv
7+
/dist

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright notice:
2+
(c) Copyright 2024 RocketGate
3+
All rights reserved.
4+
5+
The copyright notice must not be removed without specific, prior
6+
written permission from RocketGate.
7+
8+
This software is protected as an unpublished work under the U.S. copyright
9+
laws. The above copyright notice is not intended to effect a publication of
10+
this work.
11+
This software is the confidential and proprietary information of RocketGate.
12+
Neither the binaries nor the source code may be redistributed without prior
13+
written permission from RocketGate.
14+
15+
The software is provided "as-is" and without warranty of any kind, express, implied
16+
or otherwise, including without limitation, any warranty of merchantability or fitness
17+
for a particular purpose. In no event shall RocketGate be liable for any direct,
18+
special, incidental, indirect, consequential or other damages of any kind, or any damages
19+
whatsoever arising out of or in connection with the use or performance of this software,
20+
including, without limitation, damages resulting from loss of use, data or profits, and
21+
whether or not advised of the possibility of damage, regardless of the theory of liability.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,69 @@ Docs related to this repository are located at:
1919
From the root of the project, using your installed Python Interpreter, run the following command:
2020
```shell
2121
python3 -m unittest discover ./tests -p '*.py'
22+
```
23+
24+
## Install RocketGate SDK
25+
```shell
26+
pip install RocketGate
27+
```
28+
29+
## Run examples
30+
31+
Clone this repository and run examples from `./examples` folder
32+
with `python3 ./examples/AuthOnly.py`
33+
34+
```bash
35+
cd ~
36+
git clone https://github.com/rocketgate/rocketgate-python-sdk
37+
cd ~/rocketgate-python-sdk
38+
python3 ./examples/AuthOnly.py
39+
```
40+
41+
42+
Expect to see output like:
43+
44+
```bash
45+
Auth Only succeeded
46+
GUID: 100019354857297
47+
Response Code: 0
48+
Reason Code: 0
49+
AuthNo: 942499
50+
AVS: None
51+
CVV2: None
52+
Card Hash: 8Yz0jmvTGdDaZV9g58L+9mJ+0jw2fodvgktC/jS8GSs=
53+
Card Region: 1,2
54+
Card Description: CLASSIC
55+
Account: 70
56+
Scrub: NEGDB=0,PROFILE=0,ACTIVITY=1
57+
```
58+
59+
## Using your local github clone for testing
60+
If you want to test the modifications of your local version
61+
set `PYTHONPATH` env variable with the path to your
62+
local repository and you can run examples from `./examples` folder.
63+
64+
```bash
65+
cd ~
66+
git clone https://github.com/rocketgate/rocketgate-python-sdk
67+
cd ~/rocketgate-python-sdk
68+
export PYTHONPATH=~/rocketgate-python-sdk
69+
python3 ./examples/AuthOnly.py
70+
```
71+
72+
Expect to see output like:
73+
74+
```bash
75+
Auth Only succeeded
76+
GUID: 10001935007BB5F
77+
Response Code: 0
78+
Reason Code: 0
79+
AuthNo: 400966
80+
AVS: None
81+
CVV2: None
82+
Card Hash: 8Yz0jmvTGdDaZV9g58L+9mJ+0jw2fodvgktC/jS8GSs=
83+
Card Region: 1,2
84+
Card Description: CLASSIC
85+
Account: 70
86+
Scrub: NEGDB=0,PROFILE=0,ACTIVITY=1
2287
```

RocketGate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
class GatewayRequest:
3434
VERSION_INDICATOR = "version"
35-
VERSION_NUMBER = "PY3.7"
35+
VERSION_NUMBER = "PY3.8"
3636

3737
######################################################################
3838
#

examples/1Click-CrossMerchant_wCardHash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import time
2727
import sys
2828
import os
29-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
29+
3030
from RocketGate import *
3131

3232
"""

examples/1Click-CrossMerchant_wPayInfoToken.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import time
2727
import sys
2828
import os
29-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
29+
3030
from RocketGate import *
3131

3232
"""

examples/1Click-WithCardHash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import time
2727
import sys
2828
import os
29-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
29+
3030
from RocketGate import *
3131

3232
"""

examples/1Click-WithPayInfoToken.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import time
2727
import sys
2828
import os
29-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
29+
3030
from RocketGate import *
3131

3232
"""

examples/ACH.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import time
2727
import sys
2828
import os
29-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
29+
3030
from RocketGate import *
3131

3232
# Allocate the objects needed for the test

0 commit comments

Comments
 (0)