Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

ya2checkout

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ya2checkout

Wrapper for 2checkout REST API v6

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Info

NodeJs adapter for 2Checkout REST API v6.

Disclaimer

⚠Right now, with "amazing 2checkout" documentation i can't to fully describe types of models.

TODOs

Services:

  • ProductsService
    • getProducts
    • getProductByCode
    • createProduct
    • deleteProduct (disable product/subscription)
    • enableProduct (enable product/subscription)
    • updateProduct
  • OrdersService
    • getOrders
    • createOrder
  • InvoicesService
  • CustomersService
  • PayoutsService
  • SubscriptionsService

Utils:

  • Api
  • HashCreator
  • ConvertPlusUrlGenerator
    • test for simple dynamic product
    • write test function for 2checkout page(for ensure that generated link is correct)
    • test for simple catalog product
    • test generating link with redirect url
    • required parameters checking

How to test?

2Checkout do not have a test environment for REST API v6, for running tests you must to create .env file and define in it variables:

  • MERCHANT_ID - Your merchant id

  • SECRET_KEY - Your secret key

  • BUY_LINK_SECRET_WORD - Your Buy Link secret word, that you can to get in your merchant panel

  • BUY_LINK_EXPECTED_DYNAMIC_LINK - Getting of this string is harder. For getting, you must to generate Buy link on this page with parameters:

    • Products type: dynamic
    • Currency: USD
    • Product type: Physical/Tangible
    • Product name: Name
    • Product quantity: 1
    • Product price: 10
    • Order tamplate: default

    After filling form you will get link like this:https://secure.2checkout.com/checkout/buy?merchant=250283563061&dynamic=1&currency=USD&tpl=default&prod=Name&tangible=1&price=10&type=product&qty=1&signature=89e285b1902d66eda5292ec0ea0b6f191109e1e0ea696108df13a21ba691166f.

📄My advice: create new account for running tests.

# .env file
MERCHANT_ID='xxxxxxxxxxxx'
SECRET_KEY='xxxxxxxxxxxxxxxxxxxx'
# Testing of ConvertPlus url generator
BUY_LINK_SECRET_WORD='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
BUY_LINK_EXPECTED_DYNAMIC_LINK="https://secure.2checkout.com/checkout/buy?merchant=250283563061&dynamic=1&currency=USD&tpl=default&prod=Name&tangible=1&price=10&type=product&qty=1&signature=89e285b1902d66eda5292ec0ea0b6f191109e1e0ea696108df13a21ba691166f"

Keywords

payments

FAQs

Package last updated on 14 Feb 2020

Did you know?

Socket

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.

Install

Related posts