Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Build & publish
on: [push]
jobs:

build:
name: Build wheel
# Only build wheel on tag pushes
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install hatch
run: python3 -m pip install hatch --user

- name: Build
run: hatch build -t wheel

- name: Save wheel as artifact
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish:
name: Create GitHub release & publish to PyPI
# Only publish to PyPI on tag pushes
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/RocketGate
permissions:
# Required to create GitHub release
contents: write
# Required to authenticate with PyPI
id-token: write

steps:
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
body: ${{ github.event.workflow_run.head_commit.message }}
files: dist/RocketGate-${{ github.ref_name }}-py3-none-any.whl

- name: PyPI Release
uses: pypa/gh-action-pypi-publish@release/v1

# Note that when testing, we weren't able to delete a release from PyPI,
# then re-upload with the same version number. We must always publish
# a unique version, even if the previous version was deleted from PyPI.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ __pycache__
tests/__pycache__
tests/.DS_Store
.DS_Store
/venv
/venv
/dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright notice:
(c) Copyright 2024 RocketGate
All rights reserved.

The copyright notice must not be removed without specific, prior
written permission from RocketGate.

This software is protected as an unpublished work under the U.S. copyright
laws. The above copyright notice is not intended to effect a publication of
this work.
This software is the confidential and proprietary information of RocketGate.
Neither the binaries nor the source code may be redistributed without prior
written permission from RocketGate.

The software is provided "as-is" and without warranty of any kind, express, implied
or otherwise, including without limitation, any warranty of merchantability or fitness
for a particular purpose. In no event shall RocketGate be liable for any direct,
special, incidental, indirect, consequential or other damages of any kind, or any damages
whatsoever arising out of or in connection with the use or performance of this software,
including, without limitation, damages resulting from loss of use, data or profits, and
whether or not advised of the possibility of damage, regardless of the theory of liability.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,69 @@ Docs related to this repository are located at:
From the root of the project, using your installed Python Interpreter, run the following command:
```shell
python3 -m unittest discover ./tests -p '*.py'
```

## Install RocketGate SDK
```shell
pip install RocketGate
```

## Run examples

Clone this repository and run examples from `./examples` folder
with `python3 ./examples/AuthOnly.py`

```bash
cd ~
git clone https://github.com/rocketgate/rocketgate-python-sdk
cd ~/rocketgate-python-sdk
python3 ./examples/AuthOnly.py
```


Expect to see output like:

```bash
Auth Only succeeded
GUID: 100019354857297
Response Code: 0
Reason Code: 0
AuthNo: 942499
AVS: None
CVV2: None
Card Hash: 8Yz0jmvTGdDaZV9g58L+9mJ+0jw2fodvgktC/jS8GSs=
Card Region: 1,2
Card Description: CLASSIC
Account: 70
Scrub: NEGDB=0,PROFILE=0,ACTIVITY=1
```

## Using your local github clone for testing
If you want to test the modifications of your local version
set `PYTHONPATH` env variable with the path to your
local repository and you can run examples from `./examples` folder.

```bash
cd ~
git clone https://github.com/rocketgate/rocketgate-python-sdk
cd ~/rocketgate-python-sdk
export PYTHONPATH=~/rocketgate-python-sdk
python3 ./examples/AuthOnly.py
```

Expect to see output like:

```bash
Auth Only succeeded
GUID: 10001935007BB5F
Response Code: 0
Reason Code: 0
AuthNo: 400966
AVS: None
CVV2: None
Card Hash: 8Yz0jmvTGdDaZV9g58L+9mJ+0jw2fodvgktC/jS8GSs=
Card Region: 1,2
Card Description: CLASSIC
Account: 70
Scrub: NEGDB=0,PROFILE=0,ACTIVITY=1
```
2 changes: 1 addition & 1 deletion RocketGate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class GatewayRequest:
VERSION_INDICATOR = "version"
VERSION_NUMBER = "PY3.7"
VERSION_NUMBER = "PY3.8"

######################################################################
#
Expand Down
2 changes: 1 addition & 1 deletion examples/1Click-CrossMerchant_wCardHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/1Click-CrossMerchant_wPayInfoToken.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/1Click-WithCardHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/1Click-WithPayInfoToken.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/ACH.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Allocate the objects needed for the test
Expand Down
2 changes: 1 addition & 1 deletion examples/AuthOnly.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

the_time = str(int(time.time()))
Expand Down
2 changes: 1 addition & 1 deletion examples/AuthTicket.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

the_time = str(int(time.time()))
Expand Down
2 changes: 1 addition & 1 deletion examples/AuthVoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *


Expand Down
2 changes: 1 addition & 1 deletion examples/Cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

the_time = str(int(time.time()))
Expand Down
2 changes: 1 addition & 1 deletion examples/CancelPromo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/CardScrub.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

cust_id = "CardScrubTest"
Expand Down
2 changes: 1 addition & 1 deletion examples/GenerateXsell.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/InstantUpgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/Lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Setup required and testing variables
Expand Down
2 changes: 1 addition & 1 deletion examples/NonRebillUpdateToRebill.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/ProratedUpgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/Purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

the_time = str(int(time.time()))
Expand Down
2 changes: 1 addition & 1 deletion examples/PurchaseCredit.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Setup required and testing variables
Expand Down
2 changes: 1 addition & 1 deletion examples/PurchaseLifetimeMembership.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Allocate the objects needed for the test
Expand Down
2 changes: 1 addition & 1 deletion examples/PurchaseRebill.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

the_time = str(int(time.time()))
Expand Down
2 changes: 1 addition & 1 deletion examples/PurchaseTrialToLifetimeMembership.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Allocate the objects needed for the test
Expand Down
2 changes: 1 addition & 1 deletion examples/RebillReactivate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

"""
Expand Down
2 changes: 1 addition & 1 deletion examples/RebillStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Setup a couple required and testing variables
Expand Down
2 changes: 1 addition & 1 deletion examples/RebillStatusCancelled.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

from RocketGate import *

# Allocate the objects needed for the test
Expand Down
Loading