Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
airbyte-source-paypal-transaction
Advanced tools
This is the repository for the Paypal-Transaction source connector, written in Python. For information about how to use this connector within Airbyte, see the documentation.
From this connector directory, run:
poetry install --with dev
If you are a community contributor, follow the instructions in the documentation
to generate the necessary credentials. Then create a file secrets/config.json
conforming to the source_paypal_transaction/spec.yaml
file.
Note that any directory named secrets
is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
See sample_files/sample_config.json
for a sample config file.
secrets/
folderintegration_tests
. Select the one you want to test with the read command.poetry run source-paypal-transaction spec
poetry run source-paypal-transaction check --config secrets/config.json
poetry run source-paypal-transaction discover --config secrets/config.json
# Example with list_payments catalog and the debug flag
poetry run source-paypal-transaction read --config secrets/config.json --catalog integration_tests/configured_catalog_list_payments.json --debug
To run unit tests locally, from the connector directory run:
poetry run pytest unit_tests
airbyte-ci
From this connector directory, run:
poetry install --with dev
When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
You can customize our build process by adding a build_customization.py
module to your connector.
This module should contain a pre_connector_install
and post_connector_install
async function that will mutate the base image and the connector container respectively.
It will be imported at runtime by our build process and the functions will be called if they exist.
Here is an example of a build_customization.py
module:
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
# Feel free to check the dagger documentation for more information on the Container object and its methods.
# https://dagger-io.readthedocs.io/en/sdk-python-v0.6.4/
from dagger import Container
An image will be available on your host with the tag airbyte/source-paypal-transaction:dev
.
Then run any of the connector commands as follows:
docker run --rm airbyte/source-paypal-transaction:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-paypal-transaction:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-paypal-transaction:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-paypal-transaction:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
You can run our full test suite locally using airbyte-ci
:
airbyte-ci connectors --name=source-paypal-transaction test
If you are testing locally, you can use your local credentials (config.json file) by using --use-local-secrets
airbyte-ci connectors --name source-paypal-transaction --use-local-secrets test
Customize acceptance-test-config.yml
file to configure acceptance tests. See Connector Acceptance Tests for more information.
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
To run unit tests locally, form the root source_paypal_transaction
directory run:
python -m pytest unit_test
If you have a Paypal Sandbox you will be able to use some APIs to create new data and test how data is being created in your destinaiton and choose the best syn strategy that suits better your use case. Some endpoints will require special permissions on the sandbox to update and change some values.
In the bin
folder you will find several data generator scripts:
disputes_generator.py:
https://api-m.paypal.com/v1/customer/disputes/{dispute_id}
endpoint. You need the ID and create a payload to pass it as an argument. See more information here.python disputes_generator.py update DISPUTE_ID ''[{"op": "replace", "path": "/reason", "value": "The new reason"}]'
https://api-m.paypal.com/v1/customer/disputes/{dispute_id}/require-evidence
endpoint. You need the ID and select an option to pass it as an argument. See more information herepython update_dispute.py require-evidence DISPUTE_ID SELLER_EVIDENCE
invoices.py:
https://api-m.sandbox.paypal.com/v2/invoicing/invoices
endpoint. It will automatically generate an invoice (no need to pass any parameters). See more information here.python invoices.py create_draft
https://api-m.sandbox.paypal.com/v2/invoicing/invoices/{invoice_id}/send
endpoint. You need the Invoice ID, a subject and a note (just to have something to update) and an email as an argument. See more information herepython invoices.py send_draft --invoice_id "INV2-XXXX-XXXX-XXXX-XXXX" --subject "Your Invoice Subject" --note "Your custom note" --additional_recipients example@email.com
payments_generator.py:
https://api-m.paypal.com/v1/payments/payment/{payment_id}
endpoint. You need the payment ID and a payload with new values. (no need to pass any parameters). See more information here. python script_name.py update PAYMENT_ID '[{"op": "replace", "path": "/transactions/0/amount", "value": {"total": "50.00", "currency": "USD"}}]'
paypal_transaction_generator.py:
Make sure you have the buyer_username
, buyer_password
and payer_id
in your config file. You can get the sample configuratin in the sample_config.json
.
NOTE: Be midnfu of the number of transactions, as it will be interacting with your machine, and you may not be able to use it while creating the transactions
python paypal_transaction_generator.py [NUMBER_OF_DESIRED_TRANSACTIONS]
product_catalog.py:
https://api-m.sandbox.paypal.com/v1/catalogs/products
endpoint. You need to add the description and the category in the command line. For the proper category see more information here.python product_catalog.py --action create --description "YOUR DESCRIPTION" --category PAYPAL_CATEGORY
https://developer.paypal.com/docs/api/catalog-products/v1/#products_patch
endpoint. You need the product ID, a description and the Category as an argument. See more information herepython product_catalog.py --action update --product_id PRODUCT_ID --update_payload '[{"op": "replace", "path": "/description", "value": "My Update. Does it changes it?"}]'
All of your dependencies should go in setup.py
, NOT requirements.txt
. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
We split dependencies between two groups, dependencies that are:
MAIN_REQUIREMENTS
list.TEST_REQUIREMENTS
listAll of your dependencies should be managed via Poetry.
To add a new dependency, run:
poetry add <package-name>
Please commit the changes to pyproject.toml
and poetry.lock
files.
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
airbyte-ci connectors --name=source-paypal-transaction test
dockerImageTag
value in in metadata.yaml
version
value in pyproject.toml
metadata.yaml
content is up to date.docs/integrations/sources/paypal-transaction.md
).FAQs
Source implementation for Paypal Transaction.
We found that airbyte-source-paypal-transaction demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.