manuel-rubio

manuel-rubio

After a while I got the time to publish this first (and incomplete, sorry) library for Paypal v2 which is including at this moment orders and payments.

It’s now battle tested and I can ensure it’s working perfectly for the funcionts that are implemented however, I’ll be adding more parts of the API and publishing new improvements and fixes (if any). Don’t hesitate to use it or even help with documentation, testing, or adding what you need for it.

https://github.com/altenwald/paypal

Showing Posts 1 to 1

manuel-rubio

manuel-rubio OP

Hi everyone! :waving_hand:

I’m happy to announce the release of paypal v0.2.0 on Hex.pm
paypal | Hex !

This release brings a long-awaited feature requested by the community,
along with significant modernization, improved security, and a revamped
HTTP stack.
──────

:sparkles: Highlights in v0.2.0

1. Full PayPal Subscriptions & Billing Plans API

As requested, we now have first-class support for PayPal’s recurring
billing and subscriptions ecosystem:

• Catalog Products (Paypal.Subscription.Product): Create, show, list, and
update digital, physical, or service products.
• Billing Plans (Paypal.Subscription.Plan): Define recurring billing cycles,
setup fees, trial periods, and pricing schemes.
• Subscriptions Lifecycle (Paypal.Subscription): Create subscriptions,
retrieve details, update, revise plans/quantities, suspend, reactivate,
cancel, capture outstanding balances, and list transaction histories.

# 1. Create a Product
{:ok, product} = Paypal.Subscription.Product.create(%{
  name: "Video Streaming Pro",
  type: :service,
  description: "Monthly subscription for video streaming",
  category: "SOFTWARE"
})

# 2. Create a Billing Plan
{:ok, plan} = Paypal.Subscription.Plan.create(%{
  product_id: product.id,
  name: "Monthly Pro Plan",
  description: "Standard monthly billing plan",
  status: :active,
  billing_cycles: [
    %{
      frequency: %{"interval_unit" => "MONTH", "interval_count" => 1},
      tenure_type: :regular,
      sequence: 1,
      total_cycles: 0,
      pricing_scheme: %{
        "fixed_price" => %{"currency_code" => "USD", "value" => "15.00"}
      }
    }
  ],
  payment_preferences: %{
    auto_bill_outstanding: true,
    setup_fee_failure_action: :cancel,
    payment_failure_threshold: 3
  }
})

# 3. Create a Subscription
{:ok, subscription} = Paypal.Subscription.create(%{
  plan_id: plan.id,
  subscriber: %{
    name: %{given_name: "Jane", surname: "Doe"},
    email_address: "jane.doe@example.com"
  },
  application_context: %{
    brand_name: "My SaaS",
    locale: "en-US",
    return_url: "https://example.com/subscription/return",
    cancel_url: "https://example.com/subscription/cancel"
  }
})

──────

2. Migration to Req & Security Improvements

• Switched from Tesla to Req https://github.com/wojtekmach/req: Streamlined
HTTP client configuration, cleaner error handling, and robust Finch pooling
out-of-the-box.
• Dependencies & Security: All dependencies have been audited and updated
(mix_audit clean with 0 vulnerabilities).
──────

3. Modern Elixir & Quality Standards

• Elixir & OTP support: Minimum requirements updated to Elixir ~> 1.17 and
OTP 27+.
• Code Quality & Type Safety:
• 100% clean mix check pipeline (compiler with --warnings-as-errors,
Credo, and strict Dialyzer type specs).
• 100% documentation coverage verified with Doctor.
• Test coverage exceeding 95% with full unit and Bypass integration
suites.
• License: Clarified under the standard MIT License.
──────

:package: Links & Documentation

• Hex.pm: paypal | Hex
• HexDocs: Paypal v0.2.0 — Documentation
• GitHub: GitHub - altenwald/paypal: Paypal implementation for Elixir · GitHub

Feedback, issues, and contributions are very welcome!

— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
rodloboz
I’ve started working on a new library to run SQL queries and do basic business intelligence. Think “Blazer for Elixir.” Currently it fe...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews