├── .env.template ├── .github └── workflows │ ├── ci.yml │ └── release.yml ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── bin ├── console └── setup ├── lib ├── paddle_pay.rb └── paddle_pay │ ├── configuration.rb │ ├── connection.rb │ ├── errors │ └── paddle_pay_error.rb │ ├── models │ ├── alert │ │ └── webhook.rb │ ├── product │ │ ├── coupon.rb │ │ ├── license.rb │ │ ├── pay_link.rb │ │ ├── payment.rb │ │ └── product.rb │ ├── subscription │ │ ├── charge.rb │ │ ├── modifier.rb │ │ ├── payment.rb │ │ ├── plan.rb │ │ └── user.rb │ └── transaction │ │ ├── checkout.rb │ │ ├── order.rb │ │ ├── product.rb │ │ ├── subscription.rb │ │ └── user.rb │ ├── util.rb │ └── version.rb ├── paddle_pay.gemspec └── test ├── spec └── paddle_pay │ ├── configuration_spec.rb │ ├── connection_spec.rb │ ├── models │ ├── alert │ │ └── webhook_spec.rb │ ├── product │ │ ├── coupon_spec.rb │ │ ├── license_spec.rb │ │ ├── pay_link_spec.rb │ │ ├── payment_spec.rb │ │ └── product_spec.rb │ ├── subscription │ │ ├── charge_spec.rb │ │ ├── modifier_spec.rb │ │ ├── payment_spec.rb │ │ ├── plan_spec.rb │ │ └── user_spec.rb │ └── transaction │ │ ├── checkout_spec.rb │ │ ├── order_spec.rb │ │ ├── product_spec.rb │ │ ├── subscription_spec.rb │ │ └── user_spec.rb │ ├── util_spec.rb │ └── version_spec.rb ├── test_helper.rb └── vcr_cassettes └── paddle_pay ├── alert └── webhook │ ├── test_0001_should_list_all_webhooks.yml │ ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml │ └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── product ├── coupon │ ├── test_0001_should_list_all_coupons.yml │ ├── test_0001_should_raise_an_error_if_the_coupon_deletion_is_invalid.yml │ ├── test_0001_should_raise_an_error_if_the_coupon_is_invalid.yml │ ├── test_0001_should_return_updated_0_if_the_coupon_group_update_is_invalid.yml │ ├── test_0001_should_return_updated_0_if_the_coupon_update_is_invalid.yml │ ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml │ ├── test_0002_should_return_coupon_codes_if_the_coupon_is_valid.yml │ ├── test_0002_should_return_success_if_the_coupon_deletion_is_valid.yml │ ├── test_0002_should_return_updated_0_if_the_coupon_group_update_is_valid.yml │ ├── test_0002_should_return_updated_0_if_the_coupon_update_is_valid.yml │ └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── license │ ├── test_0001_should_raise_an_error_if_license_generation_request_is_invalid.yml │ └── test_0002_should_return_a_license_code_if_license_generation_request_is_valid.yml ├── pay_link │ ├── test_0001_should_raise_an_error_if_pay_link_generation_request_is_invalid.yml │ └── test_0002_should_return_an_url_if_pay_link_generation_request_is_valid.yml ├── payment │ ├── test_0001_should_raise_an_error_if_the_payment_refund_is_invalid.yml │ └── test_0002_should_return_success_if_the_payment_refund_is_valid.yml ├── test_0001_should_list_all_products.yml ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── subscription ├── charge │ ├── test_0001_should_raise_an_error_if_the_charge_is_invalid.yml │ └── test_0002_should_return_invoice_id_if_the_charge_is_valid.yml ├── modifier │ ├── test_0001_should_list_all_modifiers.yml │ ├── test_0001_should_raise_an_error_if_the_modifier_deletion_is_invalid.yml │ ├── test_0001_should_raise_an_error_if_the_modifier_is_invalid.yml │ ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml │ ├── test_0002_should_return_a_modifier_id_if_the_modifier_is_valid.yml │ ├── test_0002_should_return_a_product_id_if_the_modifier_deletion_is_valid.yml │ └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── payment │ ├── test_0001_should_list_all_payments.yml │ ├── test_0001_should_raise_an_error_if_the_payment_refund_is_invalid.yml │ ├── test_0001_should_raise_an_error_if_the_payment_reschedule_is_invalid.yml │ ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml │ ├── test_0002_should_return_success_if_the_payment_refund_is_valid.yml │ ├── test_0002_should_return_success_if_the_payment_reschedule_is_valid.yml │ └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── plan │ ├── test_0001_should_list_all_plans.yml │ ├── test_0001_should_raise_an_error_if_the_plan_is_invalid.yml │ ├── test_0002_should_be_successful_if_the_plan_is_valid.yml │ ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml │ ├── test_0002_should_return_a_product_id_if_the_plan_is_valid.yml │ └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml └── user │ ├── test_0001_should_list_all_users.yml │ ├── test_0001_should_raise_an_error_if_the_cancelation_is_invalid.yml │ ├── test_0001_should_raise_an_error_if_the_subscription_update_is_invalid.yml │ ├── test_0001_should_raise_an_error_if_the_subscription_update_preview_is_invalid.yml │ ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml │ ├── test_0002_should_return_a_subscription_id_if_the_subscription_update_is_valid.yml │ ├── test_0002_should_return_a_subscription_id_if_the_subscription_update_preview_is_valid.yml │ ├── test_0002_should_return_success_if_the_cancelation_is_valid.yml │ └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml └── transaction ├── checkout ├── test_0001_should_list_all_checkouts.yml ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── order ├── test_0001_should_list_all_orders.yml ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── product ├── test_0001_should_list_all_products.yml ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml ├── subscription ├── test_0001_should_list_all_subscriptions.yml ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml └── user ├── test_0001_should_list_all_users.yml ├── test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml └── test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml /.env.template: -------------------------------------------------------------------------------- 1 | PADDLE_VENDOR_ID=PADDLE_VENDOR_ID 2 | PADDLE_VENDOR_AUTH_CODE=PADDLE_VENDOR_AUTH_CODE 3 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: tests 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - '*' 7 | push: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | test: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Ruby 19 | uses: ruby/setup-ruby@v1 20 | with: 21 | ruby-version: 3.0 22 | - name: Install dependencies 23 | run: bundle install 24 | - name: StandardRb check 25 | run: bundle exec standardrb 26 | - name: Run tests 27 | env: 28 | PADDLE_VENDOR_ID: ${{ secrets.PADDLE_VENDOR_ID }} 29 | PADDLE_VENDOR_AUTH_CODE: ${{ secrets.PADDLE_VENDOR_AUTH_CODE }} 30 | run: bundle exec rake -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | jobs: 9 | release: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up Ruby 16 | uses: ruby/setup-ruby@v1 17 | with: 18 | ruby-version: 3.0 19 | - name: Install dependencies 20 | run: bundle install 21 | - name: Release Gem 22 | env: 23 | RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} 24 | run: | 25 | mkdir -p ~/.gem 26 | cat << EOF > ~/.gem/credentials 27 | --- 28 | :rubygems_api_key: ${RUBYGEMS_API_KEY} 29 | EOF 30 | chmod 0600 ~/.gem/credentials 31 | bundle install 32 | bundle exec gem release 33 | rm -f ~/.gem/credentials -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /tmp/ 8 | 9 | .env 10 | *.gem -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | # Specify your gem's dependencies in paddle_pay.gemspec 6 | gemspec 7 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | paddle_pay (0.3.0) 5 | faraday (>= 1.10.0, < 3.0) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | addressable (2.8.0) 11 | public_suffix (>= 2.0.2, < 5.0) 12 | ansi (1.5.0) 13 | ast (2.4.2) 14 | builder (3.2.4) 15 | crack (0.4.5) 16 | rexml 17 | dotenv (2.7.6) 18 | faraday (2.6.0) 19 | faraday-net_http (>= 2.0, < 3.1) 20 | ruby2_keywords (>= 0.0.4) 21 | faraday-net_http (3.0.1) 22 | hashdiff (1.0.1) 23 | minitest (5.15.0) 24 | minitest-reporters (1.5.0) 25 | ansi 26 | builder 27 | minitest (>= 5.0) 28 | ruby-progressbar 29 | parallel (1.21.0) 30 | parser (3.1.0.0) 31 | ast (~> 2.4.1) 32 | public_suffix (4.0.6) 33 | rainbow (3.1.1) 34 | rake (13.0.6) 35 | regexp_parser (2.2.1) 36 | rexml (3.2.5) 37 | rubocop (1.25.1) 38 | parallel (~> 1.10) 39 | parser (>= 3.1.0.0) 40 | rainbow (>= 2.2.2, < 4.0) 41 | regexp_parser (>= 1.8, < 3.0) 42 | rexml 43 | rubocop-ast (>= 1.15.1, < 2.0) 44 | ruby-progressbar (~> 1.7) 45 | unicode-display_width (>= 1.4.0, < 3.0) 46 | rubocop-ast (1.15.2) 47 | parser (>= 3.0.1.1) 48 | rubocop-performance (1.13.2) 49 | rubocop (>= 1.7.0, < 2.0) 50 | rubocop-ast (>= 0.4.0) 51 | ruby-progressbar (1.11.0) 52 | ruby2_keywords (0.0.5) 53 | standard (1.7.2) 54 | rubocop (= 1.25.1) 55 | rubocop-performance (= 1.13.2) 56 | standardrb (1.0.1) 57 | standard 58 | unicode-display_width (2.1.0) 59 | vcr (5.1.0) 60 | webmock (3.14.0) 61 | addressable (>= 2.8.0) 62 | crack (>= 0.3.2) 63 | hashdiff (>= 0.4.0, < 2.0.0) 64 | 65 | PLATFORMS 66 | ruby 67 | 68 | DEPENDENCIES 69 | bundler (~> 2.0) 70 | dotenv (~> 2.7) 71 | minitest (~> 5.8) 72 | minitest-reporters (~> 1.1) 73 | paddle_pay! 74 | rake (~> 13.0) 75 | standardrb (~> 1.0) 76 | vcr (~> 5.0) 77 | webmock (~> 3.0) 78 | 79 | BUNDLED WITH 80 | 2.3.7 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Nicolas Metzger 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "rake/testtask" 4 | 5 | Rake::TestTask.new do |t| 6 | t.libs << "test" 7 | t.test_files = FileList["test/**/*_spec.rb"] 8 | t.verbose = true 9 | end 10 | 11 | desc "Run tests" 12 | task default: :test 13 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require 'dotenv/load' 5 | require 'bundler/setup' 6 | require 'paddle_pay' 7 | 8 | # You can add fixtures and/or initialization code here to make experimenting 9 | # with your gem easier. You can also use a different console, if you like. 10 | 11 | # (If you use this, don't forget to add pry to your Gemfile!) 12 | # require "pry" 13 | # Pry.start 14 | 15 | require 'irb' 16 | require 'irb/completion' 17 | 18 | def reload! 19 | files = $LOADED_FEATURES.select { |feat| feat =~ %r{/paddle_pay/} } 20 | files.each { |file| load file } 21 | nil 22 | end 23 | 24 | ARGV.clear 25 | IRB.start(__FILE__) 26 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | # Do any other automated setup that you need to do here -------------------------------------------------------------------------------- /lib/paddle_pay.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "faraday" 4 | 5 | require_relative "paddle_pay/configuration" 6 | require_relative "paddle_pay/connection" 7 | require_relative "paddle_pay/util" 8 | require_relative "paddle_pay/version" 9 | require_relative "paddle_pay/errors/paddle_pay_error" 10 | require_relative "paddle_pay/models/alert/webhook" 11 | require_relative "paddle_pay/models/product/coupon" 12 | require_relative "paddle_pay/models/product/license" 13 | require_relative "paddle_pay/models/product/pay_link" 14 | require_relative "paddle_pay/models/product/payment" 15 | require_relative "paddle_pay/models/product/product" 16 | require_relative "paddle_pay/models/subscription/charge" 17 | require_relative "paddle_pay/models/subscription/modifier" 18 | require_relative "paddle_pay/models/subscription/payment" 19 | require_relative "paddle_pay/models/subscription/plan" 20 | require_relative "paddle_pay/models/subscription/user" 21 | require_relative "paddle_pay/models/transaction/checkout" 22 | require_relative "paddle_pay/models/transaction/order" 23 | require_relative "paddle_pay/models/transaction/product" 24 | require_relative "paddle_pay/models/transaction/subscription" 25 | require_relative "paddle_pay/models/transaction/user" 26 | 27 | module PaddlePay 28 | class << self 29 | attr_writer :config 30 | end 31 | 32 | def self.configure 33 | yield(config) if block_given? 34 | end 35 | 36 | def self.config 37 | @config ||= PaddlePay::Configuration.new 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /lib/paddle_pay/configuration.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | class Configuration 5 | attr_reader :environment 6 | attr_accessor :proxy_host 7 | attr_accessor :proxy_port 8 | attr_accessor :ssl_verify 9 | attr_accessor :vendor_auth_code 10 | attr_accessor :vendor_id 11 | 12 | def initialize 13 | @environment ||= :production 14 | end 15 | 16 | def environment=(env) 17 | env = env.to_sym 18 | unless [:development, :sandbox, :production].include?(env) 19 | raise ArgumentError, "#{env.inspect} is not a valid environment" 20 | end 21 | @environment = env 22 | end 23 | 24 | def vendors_url 25 | case @environment 26 | when :production 27 | "https://vendors.paddle.com/api" 28 | when :development, :sandbox 29 | "https://sandbox-vendors.paddle.com/api" 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/paddle_pay/connection.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Connection 5 | class << self 6 | def request(url, options = {}) 7 | request_url = PaddlePay.config.vendors_url 8 | params = options.delete(:params) || {} 9 | headers = options.delete(:headers) || {} 10 | body = options.delete(:body) || {} 11 | 12 | conn = Faraday.new(url: request_url, 13 | proxy: proxy_url, 14 | ssl: {verify: PaddlePay.config.ssl_verify}) { |faraday| 15 | faraday.request :url_encoded 16 | faraday.response :raise_error 17 | faraday.response :json 18 | faraday.adapter :net_http 19 | } 20 | 21 | begin 22 | response = conn.post(url, config.merge(body)) { |req| 23 | req.params.merge!(params) 24 | req.headers.merge!(headers) 25 | } 26 | result = response.body 27 | 28 | unless result["success"] 29 | raise PaddlePayError.new(result["error"]["message"], result["error"]["code"]) 30 | end 31 | 32 | PaddlePay::Util.convert_hash_keys(result["response"]) 33 | rescue Faraday::ParsingError => e 34 | raise ParseError, "Invalid response object from API: #{e.response[:body]} " \ 35 | "(HTTP response code was #{e.response[:status]})" 36 | rescue Faraday::BadRequestError => e 37 | raise BadRequestError.new(e.response[:body], e.response[:status]) 38 | rescue Faraday::UnauthorizedError => e 39 | raise UnauthorizedError.new(e.response[:body], e.response[:status]) 40 | rescue Faraday::ForbiddenError => e 41 | raise ForbiddenError.new(e.response[:body], e.response[:status]) 42 | rescue Faraday::ResourceNotFound => e 43 | raise ResourceNotFoundError.new(e.response[:body], e.response[:status]) 44 | rescue Faraday::ProxyAuthError => e 45 | raise ProxyAuthError.new(e.response[:body], e.response[:status]) 46 | rescue Faraday::ConflictError => e 47 | raise ConflictError.new(e.response[:body], e.response[:status]) 48 | rescue Faraday::UnprocessableEntityError => e 49 | raise UnprocessableEntityError.new(e.response[:body], e.response[:status]) 50 | rescue Faraday::TimeoutError 51 | raise TimeoutError, "The connection has timed out" 52 | rescue Faraday::ConnectionFailed 53 | raise ConnectionError, "The connection failed" 54 | rescue Faraday::ServerError => e 55 | raise ServerError.new(e.response[:body], e.response[:status]) 56 | end 57 | end 58 | 59 | private 60 | 61 | def config 62 | { 63 | vendor_id: PaddlePay.config.vendor_id, 64 | vendor_auth_code: PaddlePay.config.vendor_auth_code 65 | } 66 | end 67 | 68 | def proxy_url 69 | if PaddlePay.config.proxy_host && PaddlePay.config.proxy_port 70 | return "#{PaddlePay.config.proxy_host}:#{PaddlePay.config.proxy_port}" 71 | end 72 | 73 | nil 74 | end 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /lib/paddle_pay/errors/paddle_pay_error.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # based off of stripe gem: https://github.com/stripe/stripe-ruby 4 | module PaddlePay 5 | class PaddlePayError < StandardError 6 | attr_reader :code 7 | attr_reader :message 8 | 9 | def initialize(message, code = nil) 10 | super("#{message} #{"(Code " + code.to_s + ")" if code}") 11 | @code = code 12 | @message = message 13 | end 14 | end 15 | 16 | class ClientError < PaddlePayError 17 | end 18 | 19 | class BadRequestError < ClientError 20 | end 21 | 22 | class UnauthorizedError < ClientError 23 | end 24 | 25 | class ForbiddenError < ClientError 26 | end 27 | 28 | class ResourceNotFoundError < ClientError 29 | end 30 | 31 | class ProxyAuthError < ClientError 32 | end 33 | 34 | class ConflictError < ClientError 35 | end 36 | 37 | class UnprocessableEntityError < ClientError 38 | end 39 | 40 | class ArgumentError < ClientError 41 | end 42 | 43 | class ServerError < PaddlePayError 44 | end 45 | 46 | class LimitExceededError < ServerError 47 | end 48 | 49 | class ConnectionError < ServerError 50 | end 51 | 52 | class TimeoutError < ServerError 53 | end 54 | 55 | class ParseError < ServerError 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/alert/webhook.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Alert 5 | module Webhook 6 | class << self 7 | def history(filters = {}, options = {}) 8 | options[:body] = filters if filters.is_a?(::Hash) 9 | Connection.request("2.0/alert/webhooks", options) 10 | end 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/product/coupon.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Product 5 | module Coupon 6 | class << self 7 | def list(product_id, options = {}) 8 | options[:body] = {product_id: product_id} 9 | Connection.request("2.0/product/list_coupons", options) 10 | end 11 | 12 | def create(attributes, options = {}) 13 | options[:body] = attributes if attributes.is_a?(::Hash) 14 | Connection.request("2.1/product/create_coupon", options) 15 | end 16 | 17 | def delete(coupon_code, product_id, options = {}) 18 | options[:body] = {coupon_code: coupon_code, product_id: product_id} 19 | Connection.request("2.0/product/delete_coupon", options) 20 | end 21 | 22 | def update_code(coupon_code, attributes = {}, options = {}) 23 | attributes[:coupon_code] = coupon_code 24 | options[:body] = attributes 25 | Connection.request("2.1/product/update_coupon", options) 26 | end 27 | 28 | def update_group(group, attributes = {}, options = {}) 29 | attributes[:group] = group 30 | options[:body] = attributes 31 | Connection.request("2.1/product/update_coupon", options) 32 | end 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/product/license.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Product 5 | module License 6 | class << self 7 | def generate(attributes, options = {}) 8 | options[:body] = attributes if attributes.is_a?(::Hash) 9 | Connection.request("2.0/product/generate_license", options) 10 | end 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/product/pay_link.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Product 5 | module PayLink 6 | class << self 7 | def generate(attributes, options = {}) 8 | options[:body] = attributes if attributes.is_a?(::Hash) 9 | Connection.request("2.0/product/generate_pay_link", options) 10 | end 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/product/payment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Product 5 | module Payment 6 | class << self 7 | def refund(order_id, attributes = {}, options = {}) 8 | attributes[:order_id] = order_id 9 | options[:body] = attributes 10 | Connection.request("2.0/payment/refund", options) 11 | end 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/product/product.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Product 5 | class << self 6 | def list(filters = {}, options = {}) 7 | options[:body] = filters if filters.is_a?(::Hash) 8 | Connection.request("2.0/product/get_products", options) 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/subscription/charge.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Subscription 5 | module Charge 6 | class << self 7 | def create(subscription_id, amount, charge_name, options = {}) 8 | options[:body] = {amount: amount, charge_name: charge_name} 9 | Connection.request("2.0/subscription/#{subscription_id}/charge", options) 10 | end 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/subscription/modifier.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Subscription 5 | module Modifier 6 | class << self 7 | def list(filters = {}, options = {}) 8 | options[:body] = filters if filters.is_a?(::Hash) 9 | Connection.request("2.0/subscription/modifiers", options) 10 | end 11 | 12 | def create(attributes, options = {}) 13 | options[:body] = attributes if attributes.is_a?(::Hash) 14 | Connection.request("2.0/subscription/modifiers/create", options) 15 | end 16 | 17 | def delete(modifier_id, options = {}) 18 | options[:body] = {modifier_id: modifier_id} 19 | Connection.request("2.0/subscription/modifiers/delete", options) 20 | end 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/subscription/payment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Subscription 5 | module Payment 6 | class << self 7 | def list(filters = {}, options = {}) 8 | options[:body] = filters if filters.is_a?(::Hash) 9 | Connection.request("2.0/subscription/payments", options) 10 | end 11 | 12 | def reschedule(payment_id, date, options = {}) 13 | options[:body] = {payment_id: payment_id, date: date} 14 | Connection.request("2.0/subscription/payments_reschedule", options) 15 | end 16 | 17 | def refund(order_id, attributes = {}, options = {}) 18 | attributes[:order_id] = order_id 19 | options[:body] = attributes 20 | Connection.request("2.0/payment/refund", options) 21 | end 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/subscription/plan.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Subscription 5 | module Plan 6 | class << self 7 | def list(filters = {}, options = {}) 8 | options[:body] = filters if filters.is_a?(::Hash) 9 | Connection.request("2.0/subscription/plans", options) 10 | end 11 | 12 | def create(attributes, options = {}) 13 | options[:body] = attributes if attributes.is_a?(::Hash) 14 | Connection.request("2.0/subscription/plans_create", options) 15 | end 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/subscription/user.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Subscription 5 | module User 6 | class << self 7 | def list(filters = {}, options = {}) 8 | options[:body] = filters if filters.is_a?(::Hash) 9 | Connection.request("2.0/subscription/users", options) 10 | end 11 | 12 | def cancel(subscription_id, options = {}) 13 | options[:body] = {subscription_id: subscription_id} 14 | Connection.request("2.0/subscription/users_cancel", options) 15 | end 16 | 17 | def update(subscription_id, attributes = {}, options = {}) 18 | attributes[:subscription_id] = subscription_id 19 | options[:body] = attributes 20 | Connection.request("2.0/subscription/users_update", options) 21 | end 22 | 23 | def preview_update(subscription_id, attributes = {}, options = {}) 24 | attributes[:subscription_id] = subscription_id 25 | options[:body] = attributes 26 | Connection.request("2.0/subscription/preview_update", options) 27 | end 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/transaction/checkout.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Transaction 5 | module Checkout 6 | class << self 7 | def list(id, options = {}) 8 | Connection.request("2.0/checkout/#{id}/transactions", options) 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/transaction/order.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Transaction 5 | module Order 6 | class << self 7 | def list(id, options = {}) 8 | Connection.request("2.0/order/#{id}/transactions", options) 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/transaction/product.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Transaction 5 | module Product 6 | class << self 7 | def list(id, options = {}) 8 | Connection.request("2.0/product/#{id}/transactions", options) 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/transaction/subscription.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Transaction 5 | module Subscription 6 | class << self 7 | def list(id, options = {}) 8 | Connection.request("2.0/subscription/#{id}/transactions", options) 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/paddle_pay/models/transaction/user.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Transaction 5 | module User 6 | class << self 7 | def list(id, options = {}) 8 | Connection.request("2.0/user/#{id}/transactions", options) 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/paddle_pay/util.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | module Util 5 | class << self 6 | def convert_hash_keys(value) 7 | case value 8 | when Array 9 | value.map { |v| convert_hash_keys(v) } 10 | when Hash 11 | value.map { |k, v| [underscore_key(k), convert_hash_keys(v)] }.to_h 12 | else 13 | value 14 | end 15 | end 16 | 17 | def convert_class_to_path(class_name) 18 | class_name.split("::").map { |v| to_snake_case(v) }.join("/") 19 | end 20 | 21 | private 22 | 23 | def underscore_key(k) 24 | to_snake_case(k.to_s).to_sym 25 | end 26 | 27 | def to_snake_case(string) 28 | string.gsub(/::/, "/") 29 | .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') 30 | .gsub(/([a-z\d])([A-Z])/, '\1_\2') 31 | .tr("-", "_") 32 | .downcase 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/paddle_pay/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PaddlePay 4 | VERSION = "0.3.0" 5 | end 6 | -------------------------------------------------------------------------------- /paddle_pay.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Maintain your gem's version: 4 | lib = File.expand_path("lib", __dir__) 5 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 6 | require "paddle_pay/version" 7 | 8 | # Describe your gem and declare its dependencies: 9 | Gem::Specification.new do |s| 10 | s.name = "paddle_pay" 11 | s.version = PaddlePay::VERSION 12 | s.summary = "A Ruby wrapper for the paddle.com API" 13 | s.description = "A Ruby wrapper for the paddle.com API" 14 | s.authors = ["Nicolas Metzger"] 15 | s.homepage = "https://github.com/devmindo/paddle_pay" 16 | s.license = "MIT" 17 | 18 | s.files = Dir["lib/**/*", "LICENSE", "README.md"] 19 | s.test_files = Dir["test/**/*"] 20 | 21 | s.require_paths = ["lib"] 22 | s.required_ruby_version = ">= 2.4" 23 | 24 | s.add_development_dependency "bundler", "~> 2.0" 25 | s.add_development_dependency "dotenv", "~> 2.7" 26 | s.add_development_dependency "minitest", "~> 5.8" 27 | s.add_development_dependency "minitest-reporters", "~> 1.1" 28 | s.add_development_dependency "rake", "~> 13.0" 29 | s.add_development_dependency "standardrb", "~> 1.0" 30 | s.add_development_dependency "vcr", "~> 5.0" 31 | s.add_development_dependency "webmock", "~> 3.0" 32 | 33 | s.add_runtime_dependency "faraday", [">= 1.10.0", "< 3.0"] 34 | end 35 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/configuration_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Configuration do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | end 10 | 11 | describe "when loading default configuration" do 12 | it "should have a base url" do 13 | assert !PaddlePay.config.vendors_url.nil? 14 | end 15 | 16 | it "should have a vendor id" do 17 | assert !PaddlePay.config.vendor_id.nil? 18 | end 19 | 20 | it "should have a vendor auth code" do 21 | assert !PaddlePay.config.vendor_auth_code.nil? 22 | end 23 | 24 | it "should use the production url if no environment is set" do 25 | assert_equal PaddlePay.config.vendors_url, "https://vendors.paddle.com/api" 26 | end 27 | end 28 | 29 | describe "when loading production configuration" do 30 | before do 31 | PaddlePay.config.environment = :production 32 | end 33 | 34 | it "should use the production url" do 35 | assert_equal PaddlePay.config.vendors_url, "https://vendors.paddle.com/api" 36 | end 37 | end 38 | 39 | describe "when loading development configuration" do 40 | before do 41 | PaddlePay.config.environment = :development 42 | end 43 | 44 | after do 45 | PaddlePay.config.environment = :production 46 | end 47 | 48 | it "should use the sandbox url" do 49 | assert_equal PaddlePay.config.vendors_url, "https://sandbox-vendors.paddle.com/api" 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/alert/webhook_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Alert::Webhook do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @webhook = PaddlePay::Alert::Webhook 10 | path = PaddlePay::Util.convert_class_to_path(@webhook.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when webhooks are requested" do 19 | it "should list all webhooks" do 20 | response = @webhook.history 21 | assert_instance_of Hash, response 22 | refute_nil response[:data] 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @webhook.history } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @webhook.history } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/product/license_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Product::License do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @license = PaddlePay::Product::License 10 | path = PaddlePay::Util.convert_class_to_path(@license.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when a license generation is requested" do 19 | it "should raise an error if license generation request is invalid" do 20 | license = {product_id: "594512", allowed_uses: 10} 21 | assert_raises PaddlePay::PaddlePayError do 22 | @license.generate(license) 23 | end 24 | end 25 | 26 | it "should return a license code if license generation request is valid" do 27 | license = {product_id: "594512", allowed_uses: 10} 28 | response = @license.generate(license) 29 | assert_instance_of Hash, response 30 | refute_nil response[:license_code] 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/product/pay_link_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Product::PayLink do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @pay_link = PaddlePay::Product::PayLink 10 | path = PaddlePay::Util.convert_class_to_path(@pay_link.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when a pay link generation is requested" do 19 | it "should raise an error if pay link generation request is invalid" do 20 | pay_link = {product_id: "NOTVALID"} 21 | assert_raises PaddlePay::PaddlePayError do 22 | @pay_link.generate(pay_link) 23 | end 24 | end 25 | 26 | it "should return an url if pay link generation request is valid" do 27 | pay_link = {product_id: "594512"} 28 | response = @pay_link.generate(pay_link) 29 | assert_instance_of Hash, response 30 | refute_nil response[:url] 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/product/payment_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Product::Payment do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @payment = PaddlePay::Product::Payment 10 | path = PaddlePay::Util.convert_class_to_path(@payment.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when the refund of a payment is requested" do 19 | it "should raise an error if the payment refund is invalid" do 20 | assert_raises PaddlePay::PaddlePayError do 21 | @payment.refund(1234567) 22 | end 23 | end 24 | 25 | it "should return success if the payment refund is valid" do 26 | response = @payment.refund(10710436) 27 | assert_instance_of Hash, response 28 | refute_nil response[:refund_request_id] 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/product/product_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Product do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @product = PaddlePay::Product 10 | path = PaddlePay::Util.convert_class_to_path(@product.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when products are requested" do 19 | it "should list all products" do 20 | list = @product.list 21 | assert_instance_of Hash, list 22 | assert_instance_of Array, list[:products] 23 | refute_nil list[:products].first[:id] if list[:products].count > 0 24 | end 25 | 26 | it "should raise an error if no vendor id is present" do 27 | PaddlePay.config.vendor_id = nil 28 | exception = assert_raises(PaddlePay::PaddlePayError) { @product.list } 29 | assert_equal exception.code, 107 # You don't have permission to access this resource 30 | end 31 | 32 | it "should raise an error if no vendor auth code is present" do 33 | PaddlePay.config.vendor_auth_code = nil 34 | exception = assert_raises(PaddlePay::PaddlePayError) { @product.list } 35 | assert_equal exception.code, 107 # You don't have permission to access this resource 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/subscription/charge_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Subscription::Charge do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @charge = PaddlePay::Subscription::Charge 10 | path = PaddlePay::Util.convert_class_to_path(@charge.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when a charge is created" do 19 | it "should raise an error if the charge is invalid" do 20 | assert_raises PaddlePay::PaddlePayError do 21 | @charge.create(12345678, "0.00", "Test") 22 | end 23 | end 24 | 25 | it "should return invoice id if the charge is valid" do 26 | response = @charge.create(3484448, "0.00", "Test") 27 | assert_instance_of Hash, response 28 | refute_nil response[:invoice_id] 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/subscription/modifier_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Subscription::Modifier do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @modifier = PaddlePay::Subscription::Modifier 10 | path = PaddlePay::Util.convert_class_to_path(@modifier.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when modifiers are requested" do 19 | it "should list all modifiers" do 20 | list = @modifier.list 21 | assert_instance_of Array, list 22 | refute_nil list.first[:modifier_id] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @modifier.list } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @modifier.list } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | 38 | describe "when the creation of a modifier is requested" do 39 | it "should raise an error if the modifier is invalid" do 40 | modifier = {subscription_id: 1234567, modifier_amount: "1.00", modifier_description: "Test"} 41 | assert_raises PaddlePay::PaddlePayError do 42 | @modifier.create(modifier) 43 | end 44 | end 45 | 46 | it "should return a modifier id if the modifier is valid" do 47 | modifier = {subscription_id: 3484448, modifier_amount: "1.00", modifier_description: "Test"} 48 | response = @modifier.create(modifier) 49 | assert_instance_of Hash, response 50 | refute_nil response[:modifier_id] 51 | end 52 | end 53 | 54 | describe "when the deletion of a modifier is requested" do 55 | it "should raise an error if the modifier deletion is invalid" do 56 | assert_raises PaddlePay::PaddlePayError do 57 | @modifier.delete(1234567) 58 | end 59 | end 60 | 61 | it "should return a product id if the modifier deletion is valid" do 62 | response = @modifier.delete(143433) 63 | assert_nil response # no response when request is successful 64 | end 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/subscription/payment_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Subscription::Payment do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @payment = PaddlePay::Subscription::Payment 10 | path = PaddlePay::Util.convert_class_to_path(@payment.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when payments are requested" do 19 | it "should list all payments" do 20 | list = @payment.list 21 | assert_instance_of Array, list 22 | refute_nil list.first[:id] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @payment.list } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @payment.list } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | 38 | describe "when the reschedule of a payment is requested" do 39 | it "should raise an error if the payment reschedule is invalid" do 40 | assert_raises PaddlePay::PaddlePayError do 41 | @payment.reschedule(10710436, "wrong date") 42 | end 43 | end 44 | 45 | it "should return success if the payment reschedule is valid" do 46 | response = @payment.reschedule(10710436, "2020-12-31") 47 | assert_nil response # no response when request is successful 48 | end 49 | end 50 | 51 | describe "when the refund of a payment is requested" do 52 | it "should raise an error if the payment refund is invalid" do 53 | assert_raises PaddlePay::PaddlePayError do 54 | @payment.refund(1234567) 55 | end 56 | end 57 | 58 | it "should return success if the payment refund is valid" do 59 | response = @payment.refund(10710436) 60 | assert_instance_of Hash, response 61 | refute_nil response[:refund_request_id] 62 | end 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/subscription/plan_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Subscription::Plan do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @plan = PaddlePay::Subscription::Plan 10 | path = PaddlePay::Util.convert_class_to_path(@plan.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when plans are requested" do 19 | it "should list all plans" do 20 | list = @plan.list 21 | assert_instance_of Array, list 22 | refute_nil list.first[:id] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @plan.list } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @plan.list } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | 38 | describe "when the creation of a plan is requested" do 39 | it "should raise an error if the plan is invalid" do 40 | plan = {plan_name: "Test", plan_trial_days: 30, plan_length: 1, plan_type: "month"} 41 | assert_raises PaddlePay::PaddlePayError do 42 | @plan.create(plan) 43 | end 44 | end 45 | 46 | it "should return a product id if the plan is valid" do 47 | plan = {plan_name: "Test", plan_trial_days: 30, plan_length: 1, plan_type: "month", main_currency_code: "USD", recurring_price_usd: "5.00"} 48 | response = @plan.create(plan) 49 | assert_instance_of Hash, response 50 | refute_nil response[:product_id] 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/subscription/user_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Subscription::User do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @user = PaddlePay::Subscription::User 10 | path = PaddlePay::Util.convert_class_to_path(@user.name) + "/#{name}" 11 | puts path 12 | VCR.insert_cassette(path) 13 | end 14 | 15 | after do 16 | VCR.eject_cassette 17 | end 18 | 19 | describe "when users are requested" do 20 | it "should list all users" do 21 | list = @user.list 22 | assert_instance_of Array, list 23 | refute_nil list.first[:user_id] if list.count > 0 24 | end 25 | 26 | it "should raise an error if no vendor id is present" do 27 | PaddlePay.config.vendor_id = nil 28 | exception = assert_raises(PaddlePay::PaddlePayError) { @user.list } 29 | assert_equal exception.code, 107 # You don't have permission to access this resource 30 | end 31 | 32 | it "should raise an error if no vendor auth code is present" do 33 | PaddlePay.config.vendor_auth_code = nil 34 | exception = assert_raises(PaddlePay::PaddlePayError) { @user.list } 35 | assert_equal exception.code, 107 # You don't have permission to access this resource 36 | end 37 | end 38 | 39 | describe "when an update preview is requested" do 40 | it "should raise an error if the subscription update preview is invalid" do 41 | subscription = {} 42 | assert_raises PaddlePay::PaddlePayError do 43 | @user.preview_update(3479984, subscription) 44 | end 45 | end 46 | 47 | it "should return a subscription id if the subscription update preview is valid" do 48 | subscription = {recurring_price: "10.00", currency: "USD", quantity: 1} 49 | response = @user.preview_update(3479984, subscription) 50 | assert_instance_of Hash, response 51 | refute_nil response[:subscription_id] 52 | end 53 | end 54 | 55 | describe "when an update is requested" do 56 | it "should raise an error if the subscription update is invalid" do 57 | subscription = {} 58 | assert_raises PaddlePay::PaddlePayError do 59 | @user.update(3479984, subscription) 60 | end 61 | end 62 | 63 | it "should return a subscription id if the subscription update is valid" do 64 | subscription = {recurring_price: "10.00", currency: "USD", quantity: 1} 65 | response = @user.update(3479984, subscription) 66 | assert_instance_of Hash, response 67 | refute_nil response[:subscription_id] 68 | end 69 | end 70 | 71 | describe "when a cancelation is requested" do 72 | it "should raise an error if the cancelation is invalid" do 73 | assert_raises PaddlePay::PaddlePayError do 74 | @user.cancel(1000000, {}) 75 | end 76 | end 77 | 78 | it "should return success if the cancelation is valid" do 79 | response = @user.cancel(3479984) 80 | assert_nil response # no response when request is successful 81 | end 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/transaction/checkout_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Transaction::Checkout do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @checkout = PaddlePay::Transaction::Checkout 10 | path = PaddlePay::Util.convert_class_to_path(@checkout.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when checkouts are requested" do 19 | it "should list all checkouts" do 20 | list = @checkout.list("57064784-chrec5910826421-58f0e94797") 21 | assert_instance_of Array, list 22 | refute_nil list.first[:checkout_id] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @checkout.list("57064784-chrec5910826421-58f0e94797") } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @checkout.list("57064784-chrec5910826421-58f0e94797") } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/transaction/order_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Transaction::Order do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @order = PaddlePay::Transaction::Order 10 | path = PaddlePay::Util.convert_class_to_path(@order.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when orders are requested" do 19 | it "should list all orders" do 20 | list = @order.list("14854225-10710435") 21 | assert_instance_of Array, list 22 | refute_nil list.first[:order_id] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @order.list("14854225-10710435") } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @order.list("14854225-10710435") } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/transaction/product_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Transaction::Product do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @product = PaddlePay::Transaction::Product 10 | path = PaddlePay::Util.convert_class_to_path(@product.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when products are requested" do 19 | it "should list all products" do 20 | list = @product.list(594_469) 21 | assert_instance_of Array, list 22 | refute_nil list.first[:product_id] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @product.list(594_469) } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @product.list(594_469) } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/transaction/subscription_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Transaction::Subscription do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @subscription = PaddlePay::Transaction::Subscription 10 | path = PaddlePay::Util.convert_class_to_path(@subscription.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when subscriptions are requested" do 19 | it "should list all subscriptions" do 20 | list = @subscription.list(3_484_448) 21 | assert_instance_of Array, list 22 | refute_nil list.first[:subscription] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @subscription.list(3_484_448) } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @subscription.list(3_484_448) } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/models/transaction/user_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Transaction::User do 6 | before do 7 | PaddlePay.config.vendor_id = ENV["PADDLE_VENDOR_ID"] 8 | PaddlePay.config.vendor_auth_code = ENV["PADDLE_VENDOR_AUTH_CODE"] 9 | @user = PaddlePay::Transaction::User 10 | path = PaddlePay::Util.convert_class_to_path(@user.name) + "/#{name}" 11 | VCR.insert_cassette(path) 12 | end 13 | 14 | after do 15 | VCR.eject_cassette 16 | end 17 | 18 | describe "when users are requested" do 19 | it "should list all users" do 20 | list = @user.list(17_368_056) 21 | assert_instance_of Array, list 22 | refute_nil list.first[:user] if list.count > 0 23 | end 24 | 25 | it "should raise an error if no vendor id is present" do 26 | PaddlePay.config.vendor_id = nil 27 | exception = assert_raises(PaddlePay::PaddlePayError) { @user.list(17_368_056) } 28 | assert_equal exception.code, 107 # You don't have permission to access this resource 29 | end 30 | 31 | it "should raise an error if no vendor auth code is present" do 32 | PaddlePay.config.vendor_auth_code = nil 33 | exception = assert_raises(PaddlePay::PaddlePayError) { @user.list(17_368_056) } 34 | assert_equal exception.code, 107 # You don't have permission to access this resource 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/util_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay::Util do 6 | describe "when convert hash keys" do 7 | it "should not convert strings" do 8 | assert_equal PaddlePay::Util.convert_hash_keys("string"), "string" 9 | end 10 | 11 | it "should convert hash keys to snake case" do 12 | assert_equal PaddlePay::Util.convert_hash_keys({testKey: "test"}), {test_key: "test"} 13 | end 14 | 15 | it "should convert multiple hash keys to snake case" do 16 | assert_equal PaddlePay::Util.convert_hash_keys({testKey: "test", secondKey: "test"}), {test_key: "test", second_key: "test"} 17 | end 18 | 19 | it "should convert hash keys in arrays to snake case" do 20 | assert_equal PaddlePay::Util.convert_hash_keys([{testKey: "test"}]), [{test_key: "test"}] 21 | end 22 | 23 | it "should convert abbreviations to lowercase keys" do 24 | assert_equal PaddlePay::Util.convert_hash_keys({USD: "test"}), {usd: "test"} 25 | end 26 | 27 | it "should convert multidimensional hashes" do 28 | assert_equal PaddlePay::Util.convert_hash_keys({testKey: {multiKey: "test"}}), {test_key: {multi_key: "test"}} 29 | end 30 | end 31 | 32 | describe "when convert simple class names" do 33 | it "should convert class names to snake case" do 34 | assert_equal PaddlePay::Util.convert_class_to_path("PaddlePay"), "paddle_pay" 35 | end 36 | 37 | it "should convert modules to path" do 38 | assert_equal PaddlePay::Util.convert_class_to_path("PaddlePay::Util"), "paddle_pay/util" 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /test/spec/paddle_pay/version_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "test_helper" 4 | 5 | describe PaddlePay do 6 | it "should has a version number" do 7 | assert !PaddlePay::VERSION.nil? 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require "dotenv/load" 4 | require "minitest/autorun" 5 | require "minitest/spec" 6 | require "minitest/reporters" 7 | require "webmock/minitest" 8 | require "vcr" 9 | require "paddle_pay" 10 | 11 | Minitest::Reporters.use! 12 | 13 | VCR.configure do |config| 14 | config.cassette_library_dir = "test/vcr_cassettes" 15 | config.hook_into :webmock 16 | config.filter_sensitive_data("") { ENV["PADDLE_VENDOR_ID"] } 17 | config.filter_sensitive_data("") { ENV["PADDLE_VENDOR_AUTH_CODE"] } 18 | end 19 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/alert/webhook/test_0001_should_list_all_webhooks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/alert/webhooks 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 11:00:40 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=ddceecf8417b1b4dba6068f986fcad7071590231640; expires=Mon, 22-Jun-20 33 | 11:00:40 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjZLNzJnNFl4eDhuWlYwb2JnWXZuWWRhOVpTeTArMHpyUzkyNjJUM1JZaFk9IiwidmFsdWUiOiJmTEU3bk9tTndNZ3dYNVB3XC9IVGIyZFhZdmxkZTBcL0NmeXRGUk14dnBcL0lpaXpFUE9reTJ0WXRHRW1OSnNETWlwVnJrbnFFalRwc083WHkwQmp3dHdWdz09IiwibWFjIjoiNTFlOTBjMjNjZmI1NWY3ODIyZjcwN2Y2MTgwYWYwNDg5NGYwOTc1ZjM1YjExYTk5MGI5MWI3NTU0MjFkMzA0OSJ9; 35 | expires=Sat, 23-May-2020 13:00:40 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e4649ba630c25-AMS 53 | Cf-Request-Id: 54 | - 02e2ca421200000c25a81eb200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"current_page":1,"total_pages":1,"alerts_per_page":10,"total_alerts":0,"query_head":"2020-05-23 58 | 11:00:40","data":[]}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 11:00:40 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/alert/webhook/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/alert/webhooks 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 11:00:40 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d9b910d0a0e1aea11d66f4b263df6fd6e1590231640; expires=Mon, 22-Jun-20 33 | 11:00:40 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InVIRHc0bFppdTlUOG1IWEphZ2JCY29FR1U1U3BkNHBUUUNkU2ZKYmozMzQ9IiwidmFsdWUiOiJ6UEdmS0NieWFqT3VrZnF1V1pkT3lMQU9UT2t4bG1zTlhzNjBINjRmc2lhYmpDYUZrdUtnTlVvSWp4UjY4SHc5RmN1NFZHR0FJVnZcL0ZXVGFtWlF4SEE9PSIsIm1hYyI6IjUzOGI1ZWMzY2QyMWZiZTMzYTQyYmVjMWNjYjUyZDcxOWE4OTQ4MWU4NDQ2MTc2ZTVjNmJhZTlmOTdkNjgxYjIifQ%3D%3D; 35 | expires=Sat, 23-May-2020 13:00:40 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e46474888fa60-AMS 53 | Cf-Request-Id: 54 | - 02e2ca408d0000fa607eaa2200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 11:00:40 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/alert/webhook/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/alert/webhooks 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 11:00:39 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d06f6025de7ffa22702151d6903f9e6731590231639; expires=Mon, 22-Jun-20 33 | 11:00:39 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkgxWWpxaG43dUV3WnFTMFlQQTlSaWkySG9RU0pZRFM2OE5BT0FZQWhXSUk9IiwidmFsdWUiOiJ5c2ZvQUM0ZlBXSE9rUW5xeFJYU2hTc09mM0pUUG53cDRleTB5bTZ1cmhkb2xablo3YjcwYmhWT1VEdkszKzh6dVRuZFlXT2Q1dlRKeHcyM0M1MUhQZz09IiwibWFjIjoiYzFkNzg5ZDIwMDVhMTM3M2U5NzcyMTQwMDBkZjBhZGRhNGFkMDc0OGMyOTIyY2ZkMTczZjY1YTllZGE5OTBmOCJ9; 35 | expires=Sat, 23-May-2020 13:00:39 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e46452f220b57-AMS 53 | Cf-Request-Id: 54 | - 02e2ca3f3500000b5783148200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 11:00:40 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0001_should_list_all_coupons.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/list_coupons 6 | body: 7 | encoding: UTF-8 8 | string: product_id=594469&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:05 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d09813ede30e51acf0b9c526634f248e81590306065; expires=Tue, 23-Jun-20 33 | 07:41:05 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IndGcGlXTWVlSDh2VjZtalhhQXQ5RlpqcUE3c1EyV3paMXFSUWhxUlhFeUU9IiwidmFsdWUiOiJYVGxiaGpKSjRoVEdaUGIyTTF2eTJPc0swck1jeTdQajBEenhLTERJekx3M3UzTzhObXFhSE05SDA4Yll5TnJIbjZqZDk5NmIwK0Q3cUxJeUk0THlYUT09IiwibWFjIjoiOTQzNDBjMGI4NDYxOGY2YzJlMjhjYzI1MDYwMDJhYmM1OTUxMmE4YWExMGVhNjY0Yzk5YmZkOThhZjc3MGZlNCJ9; 35 | expires=Sun, 24-May-2020 09:41:05 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59855f4e3ffc0c59-AMS 53 | Cf-Request-Id: 54 | - 02e739e4df00000c59d38cc200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"coupon":"9F9F78DA","description":"","discount_type":"percentage","discount_amount":"1.000000000","discount_currency":null,"allowed_uses":1,"times_used":0,"is_recurring":true,"expires":null}]}' 58 | http_version: null 59 | recorded_at: Sun, 24 May 2020 07:41:05 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0001_should_raise_an_error_if_the_coupon_deletion_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/delete_coupon 6 | body: 7 | encoding: UTF-8 8 | string: coupon_code=NOVALIDCOUPON&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:10 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d6b3a650626206a86595213a63230c13b1590306070; expires=Tue, 23-Jun-20 33 | 07:41:10 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Im9rWVpndHdHVWc1dVJIUk1UWFZRVmpTNFFBTEcxdHlLVUdTQ2JNVFwvbVY0PSIsInZhbHVlIjoidkwwejdzOVBuNG9zdTR3M05CYU05NHZ4aW9TRW9PaXFqVFhSNkJuc2lEdXIybWV6UmxVbWprbnVPZFkyd1RrcjhDOVhKWGQ2aHJQTElmcktaT1dPdlE9PSIsIm1hYyI6ImMwZjA4MDNiYjBjMzZhZmFhOGRlZGVhY2JiMjM4YTUzN2IyYWUzNTIyZTAxNDBmOTkzNGNhYWEyMGY2NWVmYWQifQ%3D%3D; 35 | expires=Sun, 24-May-2020 09:41:10 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59855f6aab640956-AMS 53 | Cf-Request-Id: 54 | - 02e739f6ac000009563381a200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":116,"message":"One or more required 58 | arguments are missing"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 07:41:10 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0001_should_raise_an_error_if_the_coupon_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.1/product/create_coupon 6 | body: 7 | encoding: UTF-8 8 | string: coupon_type=checkout&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:08 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d5110bc7279a4938e9e978284117c834f1590306067; expires=Tue, 23-Jun-20 33 | 07:41:07 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6ImZBbkNWZU84WHZwMzd2UkJ6bE5ZMHlQTW10TW4rQ2xmRWR1R1wvcjQzN2dNPSIsInZhbHVlIjoiRlU2eVJweEZhZEFKRFlnVThLQXA0aFN1SFV0NkE1OTdUa2hzK0puM1pwaVwvS3A0S0ZSQXlHZFZVelZldzVKZTdrV3JKdzhaS2lSUzNydHBob285SG9nPT0iLCJtYWMiOiI5MzJmZTk3YWIyZjdjYjRhOGZkYmViYTlkNTBjMTM3ZmQ3MjBhYzAzZTFkNGM1MWFlMjY4Njk1Y2M1M2U2Njc3In0%3D; 35 | expires=Sun, 24-May-2020 09:41:08 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59855f5c9bf90c2d-AMS 53 | Cf-Request-Id: 54 | - 02e739edde00000c2d29915200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":127,"message":"The given coupon type 58 | is not recognised. The only valid types are flat and percentage."}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 07:41:08 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0001_should_return_updated_0_if_the_coupon_group_update_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.1/product/update_coupon 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=20&group=NOVALIDGROUP&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:06 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '41' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d5df347850fd7fe59ed9250b424afc5051590306066; expires=Tue, 23-Jun-20 33 | 07:41:06 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InVPNnQ5dnQrc2tPakJtSzhpZEF1cGZHK0cwN2VNREU0Y2I4eUE0N0REQVk9IiwidmFsdWUiOiI3T2pEXC9mcSt3Y1ZMK2FDTWNzTDBISk82ZjhHNjJZbkdHK3dHM2V2am1cL1V0cDdcL01Yc1wvR1BscXZmZTB5NFllU2RrcURoeEdRbm5KcmlQMjN0NnZPdEE9PSIsIm1hYyI6ImM3ZWNmOWFkOWUxNmIwYWFkMGQ0M2Y0NGYzNTRhNjM3NTk5MTQ4ZmFiNzRiNTRiNzdjOTUwZGI5MDg0NDJlMTMifQ%3D%3D; 35 | expires=Sun, 24-May-2020 09:41:06 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 59855f555ca8c833-AMS 55 | Cf-Request-Id: 56 | - 02e739e9540000c833930ce200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":{"updated":0}}' 60 | http_version: null 61 | recorded_at: Sun, 24 May 2020 07:41:06 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0001_should_return_updated_0_if_the_coupon_update_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.1/product/update_coupon 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=20&coupon_code=NOVALIDCODE&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:04 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '41' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dc924ee7daf27fd66bacfcef71768d6b31590306064; expires=Tue, 23-Jun-20 33 | 07:41:04 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6ImozSWxVTklPajB3WXg1V0VXXC9hZ25aTWZnOWtTV2F0Z2dDeTVRYjhZYU0wPSIsInZhbHVlIjoiVnRVWmd4TzBNbkErQlwveGVXcE9VQmJTSHd4WVc2RERUTGhoR1hFN2lkVnRGNU53RDBsTEROMzIxeGd2Qkg0RmJ0RkNRdUZIV0VYcEpUNzY1aXR3OUdnPT0iLCJtYWMiOiJmNGU3ZGEwNzFjNWE1OWIwZjdlYWI5MTkwMGJkNTNlNjY4OGE4MTQxYmVjZWQzYmExZDQ2ODQ5OTljZTljZmM1In0%3D; 35 | expires=Sun, 24-May-2020 09:41:04 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 59855f46bd22c82f-AMS 55 | Cf-Request-Id: 56 | - 02e739e0310000c82fdc25d200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":{"updated":0}}' 60 | http_version: null 61 | recorded_at: Sun, 24 May 2020 07:41:04 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/list_coupons 6 | body: 7 | encoding: UTF-8 8 | string: product_id=594469&vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:05 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=de92652b4422e88e3d226b6757aa927011590306065; expires=Tue, 23-Jun-20 33 | 07:41:05 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6ImNjVnRVaWNkM1JQeFB2WTZpWUlDNVdOYk5KN25JTk1Qa0F3UEhrUnoyQWM9IiwidmFsdWUiOiJRNVVvelwvOG1QXC9oeHZZXC93Zm9kUVI2SmQ4TUNEXC9MaGJOZm43czIwemVqK096Sko5YTlnbE41UkpXWmZcL3FKM015RFc1dWxqSkJVd2txc2phakFkU1NRPT0iLCJtYWMiOiJiM2U4YzRhYjI5MGFjOGE3N2IxMzg3ZjRlNDc2MjE2N2NmZjVjMmU1ZTI4YzQ3ZWJhZThkN2E1ZTI1NWQxNDBmIn0%3D; 35 | expires=Sun, 24-May-2020 09:41:05 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59855f4c1cfbc82f-AMS 53 | Cf-Request-Id: 54 | - 02e739e3930000c82fe43a5200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 07:41:05 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0002_should_return_coupon_codes_if_the_coupon_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.1/product/create_coupon 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=10&coupon_type=checkout&discount_amount=100&discount_type=percentage&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:08 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d88c52e5c4b063e3c380e23ca390230dd1590306068; expires=Tue, 23-Jun-20 33 | 07:41:08 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IllOSmtKZlRnRkFwb01PaDZ1dGw4Ujd2YVwvUkloZ0NpU2E1N3J3U0pCOUEwPSIsInZhbHVlIjoic2ozZE9hbVhyYmNLMVd2UFROZmlZM1dWNEFXQVI3QkNtZjV0VDNwQyt2QTRCaVhoZnRPNWdUWWV2QlJleHVCTFBJMlVYQVlJVFl3WHZYXC9DTGhrUjBBPT0iLCJtYWMiOiJjYjA1OTA0OTlmYzFjNmU3YzI2NDFhOTFlYTkxZDkzOTUzZDZmNGJiZjE5NDc2ZTBjOTBiODQ4OWViODk3MDc2In0%3D; 35 | expires=Sun, 24-May-2020 09:41:08 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59855f5e89b9d8b1-AMS 53 | Cf-Request-Id: 54 | - 02e739ef180000d8b1ec883200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"coupon_codes":["55FB97E5"]}}' 58 | http_version: null 59 | recorded_at: Sun, 24 May 2020 07:41:08 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0002_should_return_success_if_the_coupon_deletion_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/delete_coupon 6 | body: 7 | encoding: UTF-8 8 | string: coupon_code=9F9F78DA&product_id=594470&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:48:57 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '32' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dc65bb6a3330fef37a343b0085d0825361590306536; expires=Tue, 23-Jun-20 33 | 07:48:56 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkczZXJEZ2Y4SDk0VElXaUFpWFwvalRKSmtNcktST0VSNysraVBZWjh3aFNzPSIsInZhbHVlIjoiMVh6SnYzQWtyRURQOFk4QXJVM2sxcmVYbjhoa1hQSXVoK2NUSjlEMnc1VSt2SmdlODUzbzlYejhhcWcwUjFLYTEwZjZkWDhYUFdmQklNVCtoaElLUWc9PSIsIm1hYyI6IjhlNWNkZjZiNDZjNTI3MWQ2ZTk4ZmYyNTQ3ZWJkMWQ0YzZjZWVlMWJlODZiYjk0NjJhY2FhODBjZDMyN2UyMWIifQ%3D%3D; 35 | expires=Sun, 24-May-2020 09:48:57 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 59856acfb9830c89-AMS 55 | Cf-Request-Id: 56 | - 02e74115cf00000c89f295a200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":null}' 60 | http_version: null 61 | recorded_at: Sun, 24 May 2020 07:48:57 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0002_should_return_updated_0_if_the_coupon_group_update_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.1/product/update_coupon 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=30&group=Testgroup&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:07 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '41' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dec2f9d43c75e067473d56354034118c91590306067; expires=Tue, 23-Jun-20 33 | 07:41:07 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InVEeFF5XC9cL2tcL29vMTFCZDlpVnVZY1lTR0hGUlRZb2ZaeFNLdTVQZ2xGZ1k9IiwidmFsdWUiOiIzRklSNmJcL3JVSGxGbVptRGJHMlRuOXBCMHBINU1pcFVFMjlZMUZpUUxFUm5GVmtYeGxTTTQzWVNDZmhoTzVLWDBleHQ4bm9DdUJLT1lER2xmOHlUeWc9PSIsIm1hYyI6IjkyM2QwZWRjZTZiYzI1M2E0ZjdiZjlhMjYxOGE3NjQ1MTMwZmJjNzZlZDZmZWY5NzIzNTQwN2YzYjUyZjIzYzIifQ%3D%3D; 35 | expires=Sun, 24-May-2020 09:41:07 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 59855f57ba7efa3c-AMS 55 | Cf-Request-Id: 56 | - 02e739eacf0000fa3ca794b200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":{"updated":1}}' 60 | http_version: null 61 | recorded_at: Sun, 24 May 2020 07:41:07 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0002_should_return_updated_0_if_the_coupon_update_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.1/product/update_coupon 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=20&coupon_code=7D0E7A68&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:04 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '41' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d91f77e0eda8d65e168aa83329a063c6f1590306064; expires=Tue, 23-Jun-20 33 | 07:41:04 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjU4Wk9jZkdxdHFLQUxzVFExaEFGTmNNdFFyZ2pNR1wvZGxcL05SSDF2UTl3bz0iLCJ2YWx1ZSI6ImVlenAxUExYTXBzT2oxS1YzZmRRVFpUUGlFZDFmaTliWDY1bStMN0Erd1ZUaW5hSzhWelNqaWc0N0YzclBsdDBwMUpRS1Q5SndJVkJzSEpOOFJQZVpnPT0iLCJtYWMiOiJlMTExOWViYzY0MGZhOTU5NmZjNmM1NTNjNjg3MTE3NWFmMjY3MTk4N2M1ZjhmN2UxMTc2MzdhY2ZmNDlhZTEzIn0%3D; 35 | expires=Sun, 24-May-2020 09:41:04 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 59855f48e9c70bf1-AMS 55 | Cf-Request-Id: 56 | - 02e739e19000000bf1c0988200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":{"updated":1}}' 60 | http_version: null 61 | recorded_at: Sun, 24 May 2020 07:41:04 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/coupon/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/list_coupons 6 | body: 7 | encoding: UTF-8 8 | string: product_id=594469&vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 07:41:06 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d51393965217c2cb02471900ffa4df3d61590306066; expires=Tue, 23-Jun-20 33 | 07:41:06 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Ik52NGgxNVg1YXBMQmd4bjFNdk1obytCMFlVTlBnK2xQclh4ZVRsZkpQOWs9IiwidmFsdWUiOiJzOTVYaHhVXC80dkt5d2R3V0s1TzF3SUx2Tm5MVVhqQUxMOE5yeEdmNGp1NnJSM2QzRkduTWVoNkF6UW1DbWtRVnN4eUxcL3pxMnlWMFphOUd3UXVMcGd3PT0iLCJtYWMiOiI2NmI1YjcxYWNjMGQ2MTEwOTZkYTgzYTU2MDdiNjA1ZDFmMjM2YjA0ODUzNmFlNmRhMjU1YzA4NDRkNGU0ZTIyIn0%3D; 35 | expires=Sun, 24-May-2020 09:41:06 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59855f50cac09c2d-AMS 53 | Cf-Request-Id: 54 | - 02e739e67b00009c2dd4359200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 07:41:06 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/license/test_0001_should_raise_an_error_if_license_generation_request_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/generate_license 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=10&product_id=594512&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:04:16 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d57f65beca4a7923f9a2922cf5af0cbcd1590307456; expires=Tue, 23-Jun-20 33 | 08:04:16 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InJyQnErTnNYZVkyKzZkaGE3QVJjTXJVSU04UWI5VnRQblBtVGhhQ1FiZkk9IiwidmFsdWUiOiJ6cGppZ0ZYWTN5NXI1anZyK2RBdDJhM2VlZ0ZcL0JuMTZEeU1ESGNPTHlvZzlxb2JpQmMzeHhxTGhrMzlRb3lsT3NwVzRiZDFxYk0zVDBrN1FoNHdcLzBnPT0iLCJtYWMiOiIwMzY5Y2ZmNWE3MDZkNzcyMGNhZGY4ODZlNGU4MjJmMDU1ZmM0MWZlYzgyZjcwYWI2NjM0OGZhZGQ5YmJiMGE3In0%3D; 35 | expires=Sun, 24-May-2020 10:04:16 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 598581443f00faa0-AMS 53 | Cf-Request-Id: 54 | - 02e74f1ea60000faa02f258200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":108,"message":"Unable to find requested 58 | product"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 08:04:16 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/license/test_0002_should_return_a_license_code_if_license_generation_request_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/generate_license 6 | body: 7 | encoding: UTF-8 8 | string: allowed_uses=10&product_id=594512&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:04:35 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d406d2f73541cf0d938aa45d371d982871590307475; expires=Tue, 23-Jun-20 33 | 08:04:35 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IndiYUE5OGZMalRpZmZ1bkJJZzl2ZFdVWjlcL1dBRGpZVWZQZFg4Zk9wVDZjPSIsInZhbHVlIjoiaTZCT0Z2c0ZNNVwvOTVPR1hMWFdjTlJzTSs4aVZnaFVoWXd1SGllZVdnODNkU0ZKUzZEeDJNam8rOHFZR0lYSm9CTjN3MnVXTHhIVmJvR2o2Unp1OHl3PT0iLCJtYWMiOiJhZDJmZjUzOWZmMmU3ZDExYmEyOTIyNGY4OTBhZjdhNDEzZmFjZWJkNGQ0ZTViYmFiZDk1N2RkY2Y4Y2M3MTJkIn0%3D; 35 | expires=Sun, 24-May-2020 10:04:35 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 598581baf8b49c99-AMS 53 | Cf-Request-Id: 54 | - 02e74f68d600009c99a8885200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"license_code":"2DEDF6A4-86420251-0927C417-43523113-CA22C29B", 58 | "expires_at":"2018-10-10"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 08:04:35 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/pay_link/test_0001_should_raise_an_error_if_pay_link_generation_request_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/generate_pay_link 6 | body: 7 | encoding: UTF-8 8 | string: product_id=NOTVALID&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:11:02 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d7d829ce0a5c9ab3def049252ec941d7a1590307862; expires=Tue, 23-Jun-20 33 | 08:11:02 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkxrTUsxNU1hRmRvT0dWZDlcLzBtUHhVSjRKQUFLVWZqTmYycTV1OXlhSWtJPSIsInZhbHVlIjoiSHpTSThzaTR1eThieE5QaVhXOVJBRUxBUCsxem1ZSWZsWHR3UWNvdzBhdSt6MXJJVkFqS1Rzd2pxWW1IczhQWk9GMEthZHN0aHE1bldKd29tVFdFd3c9PSIsIm1hYyI6ImRhZWQ4OGMzOWJiNDc5MjY1MTVlZjAzZTY3NGQzNWY4NzJlMGI3M2UxZWQzMGM5NTY1ZDU0MTQwZmFmMmYxYmMifQ%3D%3D; 35 | expires=Sun, 24-May-2020 10:11:02 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59858b2c1dbbfa78-AMS 53 | Cf-Request-Id: 54 | - 02e7554f8e0000fa78dbb68200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":108,"message":"Unable to find requested 58 | product"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 08:11:02 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/pay_link/test_0002_should_return_an_url_if_pay_link_generation_request_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/generate_pay_link 6 | body: 7 | encoding: UTF-8 8 | string: product_id=594512&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:11:03 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d613051f16189ecaed67f921e0b93be0e1590307862; expires=Tue, 23-Jun-20 33 | 08:11:02 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6ImpuclA3WVZ5TGVoVDJla1lFYnFyc3ZrNVREUFR2OGJvUFNpdzZDWXNBSnM9IiwidmFsdWUiOiJ2XC9yclp4N3RLNU1SM0Y4YldYYUJnUWVGdVBnWkRCMzhxMjQ1UUExSE9hajJZbGhBSGZWdDhZR21DeTJoVVB6R0x4ckczQTNMaDNjOWZZdVZ1ZHhIZHc9PSIsIm1hYyI6ImVjZDE3Y2ExNWQ3MDc5YTJmODc0MzRjOTA5ODg1OWU2MDk5ZDg3MWIyZDM5OWY4OTJjNDEzMTRlZDJhMTJjY2YifQ%3D%3D; 35 | expires=Sun, 24-May-2020 10:11:03 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59858b2f6821fa70-AMS 53 | Cf-Request-Id: 54 | - 02e755519c0000fa7006b51200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"url":"https:\/\/checkout.paddle.com\/checkout\/custom\/eyJ0IjoiVGVzdCIsImkiOiJodHRwczpcL1wvc3RhdGljLnBhZGRsZS5jb21cL2Fzc2V0c1wvaW1hZ2VzXC9jaGVja291dFwvZGVmYXVsdF9wcm9kdWN0X2ljb24ucG5nIiwiciI6bnVsbCwiY20iOiIiLCJyZSI6MSwicCI6NTk0NTEyLCJjYyI6W10sInkiOiIiLCJxIjoxLCJkIjoxLCJhIjpbXSwidiI6IjExNDExNiIsImR3IjpmYWxzZSwicyI6IjYzYTE0ZjBlYjc4MzJhYmNjNWJjZWQ3YWQ1NjJjYmRjNTEzZGZjN2I3OTUxODU5NmIwZmYzZDgzYjcwMjY1MjQyMGMzYTUxNzFjYjE4YTlmMmUwMWQwNTUwYzliMzg3ZmRiYWU2MWE4MWJmNTc0MTMzY2IxOWJmMzBmNDNiYmEwIn0="}}' 58 | http_version: null 59 | recorded_at: Sun, 24 May 2020 08:11:03 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/payment/test_0001_should_raise_an_error_if_the_payment_refund_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/payment/refund 6 | body: 7 | encoding: UTF-8 8 | string: order_id=1234567&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 16:00:59 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=da04a1a969b2d71446340494129a959c01590336059; expires=Tue, 23-Jun-20 33 | 16:00:59 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Ikk0SWIxOXNWYUU5ZU9hVmdzdG5TblNhOUlUaVg1T3c1eThCbHQycGRyNmc9IiwidmFsdWUiOiIyZ1J1Nkg3amNDakdUYWMwQ1EwSUxNTklaWUNnb0ZUM1JpTStUK3oxR3Y4bE5RWk1IeTdLWVZXSjhFNUcybkZNd3ptNjljZTJaQXROQjJsT3YzUUtQQT09IiwibWFjIjoiNmYzMjNiYzQ2OTkzMjhlYzQ1NjRlOTk1ZGMwMWUxN2IxNzAzODM4OThjODNiNjVjYzFiYzM3YjUyNTRkOWE0ZiJ9; 35 | expires=Sun, 24-May-2020 18:00:59 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59883b926bf4bdb9-AMS 53 | Cf-Request-Id: 54 | - 02e9038f7d0000bdb9c634a200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":172,"message":"The transaction can 58 | no longer be refunded."}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 16:00:59 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/payment/test_0002_should_return_success_if_the_payment_refund_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/payment/refund 6 | body: 7 | encoding: UTF-8 8 | string: order_id=10710436&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 16:00:59 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d079c68c608f354ab9ae8c3059c42d3861590336059; expires=Tue, 23-Jun-20 33 | 16:00:59 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkhiVHViNlwvQldOelNNaURkSjBjTWVGMFU3amtwXC93cWhcL3daK3kwcTU4RlU9IiwidmFsdWUiOiJVNzJFQWZXVzFLdkVzVGtiZjNzYTRjYTJVN2hxWCtLOG13UGRMSnVwOGJBRm9aYWtVbTJBSFd4Sm10c2FzbTJPOFRVNWo1a2tUcm9aZUU1V3BEYmJxZz09IiwibWFjIjoiMzUxMWI0MWFhOGNlNzYzMjU0MTQzMDJlZGU3YzM0ZDMzODU1OTg4NjE0MjVjMjM2ZDU0Y2M5ZjI4NjBlY2ZjYiJ9; 35 | expires=Sun, 24-May-2020 18:00:59 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59883b94ec17bdbe-AMS 53 | Cf-Request-Id: 54 | - 02e90391110000bdbe61250200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"refund_request_id":12345}}' 58 | http_version: null 59 | recorded_at: Sun, 24 May 2020 16:00:59 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/test_0001_should_list_all_products.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/get_products 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:13:43 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d994e85da48851c81e26654b8bdd48d2d1590308023; expires=Tue, 23-Jun-20 33 | 08:13:43 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InBJMFErQkVWM3U0OUw5UnhiUWpGbzNrM1VaZzVtWmxvM3lvenI3SWV2UTA9IiwidmFsdWUiOiJxbE9USm9zRCsyR2poVEZIaSt5ZnIxM2ZRWnNMVEN3OHMzYUlSMjc5TitadGF0YThJVjhRWFp6bzArMmorQUpcL0tGSGR0QWI1ckZ6d1I4bWRyaWd3cUE9PSIsIm1hYyI6ImEyODU3ZWNjMjU2YzhhZmQwNWQxZjgxZjhkM2E5ZmEzMWY0ZTU3NzJiZGE0MDZlNmRiZjYxNDgxMmM1YjBmODQifQ%3D%3D; 35 | expires=Sun, 24-May-2020 10:13:43 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59858f1cbe089cbd-AMS 53 | Cf-Request-Id: 54 | - 02e757c5ee00009cbd6a8a6200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"total":1,"count":1,"products":[{"id":594512,"name":"Test","description":"","base_price":null,"sale_price":null,"screenshots":[],"icon":"https:\/\/static.paddle.com\/assets\/images\/checkout\/default_product_icon.png"}]}}' 58 | http_version: null 59 | recorded_at: Sun, 24 May 2020 08:13:43 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/get_products 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:13:44 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d5227adb1eb7a3424945ce989cca04e411590308024; expires=Tue, 23-Jun-20 33 | 08:13:44 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IlIxSVRGOTN6THloSW5aaU9paklySTJQVUt6SXhpdFd3OWludFZQNHZoVkk9IiwidmFsdWUiOiJLSkpSWW9TNzZGdDI1OVp3NmozcTdxcXpSc0UrMlhsWk1Gd3N6Q2ZtQzJOQ3pGb3k1MmVjMm04M2d4N3IzYnZpZU5LMFRYR1lYVjJEYUdlZHpOeTV2dz09IiwibWFjIjoiMjRjMzFjYzBiYjMyY2VhMTAwNzU2YmZjMWNiMjRjZTBmN2FhYTAzOGUxYTE1ODlkNGNhZWM3NjkwOWExZTA3OSJ9; 35 | expires=Sun, 24-May-2020 10:13:44 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59858f1f5c250c25-AMS 53 | Cf-Request-Id: 54 | - 02e757c79700000c25b4ace200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 08:13:44 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/product/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/get_products 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 08:13:44 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d18aecbcff92d9ff3f692f0112a564b151590308024; expires=Tue, 23-Jun-20 33 | 08:13:44 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InR2QWJ5djRsT1ZHT0ozdmxzanlDb2hDTFJOY0FQVjRhTVROYldyRmthbWM9IiwidmFsdWUiOiIyamJVZEVIMzRGalNaRmcrRldmeml3M1g2ZmNIdWdiZllWVTllbUNTcmZDcXVoeU1cL0hteTlFVGFxRGk0OURXZXowXC9meUkwN3JlTVd4NnUxWGtcL1pKZz09IiwibWFjIjoiZGRhZDU0Y2MyYjgxYTQxZDA4NDc4NzZjYzc0MGZmYzg4ZmRiOWMxMTYyYzcyOGVkZjIwNzc3M2ExNmIzYzNlYyJ9; 35 | expires=Sun, 24-May-2020 10:13:44 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59858f2269a89c51-AMS 53 | Cf-Request-Id: 54 | - 02e757c97d00009c51e82a6200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 08:13:44 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/charge/test_0001_should_raise_an_error_if_the_charge_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/12345678/charge 6 | body: 7 | encoding: UTF-8 8 | string: amount=0.00&charge_name=Test&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 08:58:33 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dee51c76e84c433788e04be74a13925de1590224313; expires=Mon, 22-Jun-20 33 | 08:58:33 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Ikhta1VXNnN2YVk2dVwvY21xZlVcL05TXC9XYlhQTlFaZjNIaGEwb3lGMDRGUUU9IiwidmFsdWUiOiJoazc4R0tHcit2U3JNNk9SK1dxWk50eStRSktqNVFwYkdNZVk3ZExqSWdlSW5ub3N1TUs4czNjeTVFbW5nMmhDd2wxMzVzMmsyQmh5REdhd0w1OEFoZz09IiwibWFjIjoiZTFmMjE2MWUzZWUzNTllM2FkMmI3MzQyMjA3YmM1ZmQzYzE1ZDA2NzQ1OGFmMzMyZGQ3YThhYjVkYjE5NDM4NiJ9; 35 | expires=Sat, 23-May-2020 10:58:33 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d93643a0a0b43-AMS 53 | Cf-Request-Id: 54 | - 02e25a72a400000b43f7898200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":119,"message":"Unable to find requested 58 | subscription"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 08:58:33 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/charge/test_0002_should_return_invoice_id_if_the_charge_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/3484448/charge 6 | body: 7 | encoding: UTF-8 8 | string: amount=0.00&charge_name=Test&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 08:58:32 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d23c8105f2a125babb7296808c7b14a801590224312; expires=Mon, 22-Jun-20 33 | 08:58:32 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjIwanBsU2V4TE5zQndXdVVcL3RWbHFCZG43ZVwvVGloZCtPQmZvSEpVT3poWT0iLCJ2YWx1ZSI6IkZyVXFGSFwvVG1oY3lOQlNJanUwXC9PZFBcLzlzK3lvVTJcL2tCYmJ3dzRXOUJiNEVlMmRDbkVNam13WFVTeGJEU2NzTlZoS0o4U3U5TWk1VGcza3R4ZmJHQT09IiwibWFjIjoiMzdjOGM0NjNhMGE0OTcwZGYyM2ZlM2Y3ODdlMmM5MjE1MTViNjk5N2I4NDdkZGNmZWU2NTYwM2E4NmEwZDI1YyJ9; 35 | expires=Sat, 23-May-2020 10:58:32 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d93609ba472b1-AMS 53 | Cf-Request-Id: 54 | - 02e25a7063000072b10aa71200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"invoice_id":1,"subscription_id":1,"amount":"10.00", 58 | "currency":"USD","payment_date":"2018-09-21","receipt_url":"https://my.paddle.com/receipt/1-1/3-chre3a53a2724c6-42781cb91a"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 08:58:32 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0001_should_list_all_modifiers.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:04:57 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '30' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d192a07f0a8f1b60d724af1ae19e9da8e1590224697; expires=Mon, 22-Jun-20 33 | 09:04:57 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjdvZFEzTVRcLzlkbFFJb0dzYkhuenBUOFwvZlBMUVJuWHN3ZjBxUWptRHVUVT0iLCJ2YWx1ZSI6IlRNMUdMeUFDYXBaWTNCK3VNSENvZXZUNkNrRlNKekxUa2tZQm4wY3JzNHQrdjR2aE9cL3lVZXJGZllMREQ2VXlMT0ZMbzFhOTY0YUNjVUwrQ1htRW14dz09IiwibWFjIjoiMzM2OWUxZjM2NmViOGU1YWM1ZTg0NTIxOWM0MTQyMWMzM2U3ZTllZjYwMWRhNWQ4NDQyMmFlOGFmZGYwZGZiMCJ9; 35 | expires=Sat, 23-May-2020 11:04:57 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 597d9cc5385e72e7-AMS 55 | Cf-Request-Id: 56 | - 02e2604f42000072e7129be200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":[]}' 60 | http_version: null 61 | recorded_at: Sat, 23 May 2020 09:04:57 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0001_should_raise_an_error_if_the_modifier_deletion_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers/delete 6 | body: 7 | encoding: UTF-8 8 | string: modifier_id=1234567&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:12:19 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dcd182923231f032c91d7ebfd38851af41590225138; expires=Mon, 22-Jun-20 33 | 09:12:18 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkZRUUR2ejVZOHhGKzdUMmFsS1h3QjhlM3BTNnZWQmlsZEFvMzF1Q1JZTGc9IiwidmFsdWUiOiJVV3ljVEE4M2JlQ0ljVVJMczI3T2hlVk9EZzFvWjFmNnNlTVNNVndJUkZkY1lWclhxXC9oR1NQY1wvS0lydWFVM2MrWTA4ODBIZlFuOTFGdWtneWhqR3VRPT0iLCJtYWMiOiJjMDNiOTk2ZTU0NWVkMGUyMDdhMjI5NGNlNDljOWI2MDUwM2ZiZjU1ZDcxZWE5NzgxZTE5MGY0MjczMGJmZDc5In0%3D; 35 | expires=Sat, 23-May-2020 11:12:19 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597da78dea2ffa94-AMS 53 | Cf-Request-Id: 54 | - 02e2670cac0000fa94ba236200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":123,"message":"Unable to find requested 58 | modifier"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:12:19 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0001_should_raise_an_error_if_the_modifier_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers/create 6 | body: 7 | encoding: UTF-8 8 | string: modifier_amount=1.00&modifier_description=Test&subscription_id=1234567&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:12:20 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d97d8972a64fb1579bb2298f287615fa01590225139; expires=Mon, 22-Jun-20 33 | 09:12:19 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjdCakNcL3BOTW9ScXRKMHU1OXpMbXhvdmlZM2Vwb0lNUVlvWVZhU0ZlNUJjPSIsInZhbHVlIjoiREMyXC8xaHVQUHI3U3hVMVd1OEdLVlJaTVBKeU1MRVZ4QnBhZjFVNGFPSnNLVUdCT1dmT3dBTm5lXC9DQ0piT0R2d1pIdEpncDU2XC95TjRTcGsyR1dOYmc9PSIsIm1hYyI6IjQzYzg2Njg0MzNlNGY5NzRiODQxOGEyOGYwZDc2NDg1MWY4YWNlNDc0NjQ2YWY5YWM0YTc2MWQ1YzMyNWQ0MzYifQ%3D%3D; 35 | expires=Sat, 23-May-2020 11:12:20 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597da794abe7fa48-AMS 53 | Cf-Request-Id: 54 | - 02e26710ec0000fa48e234a200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":119,"message":"Unable to find requested 58 | subscription"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:12:20 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:04:56 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=df209f3917ccac2abc1489b5d62d0488c1590224696; expires=Mon, 22-Jun-20 33 | 09:04:56 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Imd0dUFvQk1adVNhVWhcL2VMbk9tYjQ1RG5GczEyblJVTE8xbGdyRWdvQkNVPSIsInZhbHVlIjoiVTMyWDl6bFZhUVdPRmhyMU1EYnAwMFdyUWU4aTNaRDB2eXpKdGlRajhSbkNkVUhxcUZLZnl4OXh1anpvblZERHZPa3QyTnRSODJRdzh0RFdOZFRzbFE9PSIsIm1hYyI6IjE3ZmEzODhlODliYjY3NzM3MmU3OWEwMDUwNjM4OWE3ZTUyNmFjNGIwYzYyMWZlZTgxNWFiNjQzOWNiYTUwYTQifQ%3D%3D; 35 | expires=Sat, 23-May-2020 11:04:56 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d9cc32f0cfa78-AMS 53 | Cf-Request-Id: 54 | - 02e2604dfc0000fa78ccaa8200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:04:57 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0002_should_return_a_modifier_id_if_the_modifier_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers/create 6 | body: 7 | encoding: UTF-8 8 | string: modifier_amount=1.00&modifier_description=Test&subscription_id=3484448&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:12:21 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dc75b910a061d299a7effdf7a1ca20ce11590225141; expires=Mon, 22-Jun-20 33 | 09:12:21 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InB0b0RrTnZUSVNoeThSVW9MaDdqY1Z3a0pkUEljZk5icVk2TTArSkVEZEk9IiwidmFsdWUiOiJQVzZCOVU4UERSalZtbDBTeCtqdlRydEQrc3prTTZBdXNCNHlmR2VtRkFHYm8yUHZzZE1XK0NjQitrbmREbGd6QTh3bVFFUjNQVFNDZlMxOTZ2aU0zdz09IiwibWFjIjoiYWNmMWY0MjQwNTRkMjk5ZTJmNjQzNDgxMzdmYzE2ZjZmNmJhZGJkOGNjMGIxOTg0Y2Y1OWFmNWUxOTVkNjQ3MSJ9; 35 | expires=Sat, 23-May-2020 11:12:21 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597da79b48ed0c79-AMS 53 | Cf-Request-Id: 54 | - 02e267150c00000c7933863200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"subscription_id":3484448,"modifier_id":143433}}' 58 | http_version: null 59 | recorded_at: Sat, 23 May 2020 09:12:21 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0002_should_return_a_product_id_if_the_modifier_deletion_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers/delete 6 | body: 7 | encoding: UTF-8 8 | string: modifier_id=143433&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:16:39 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '32' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=da31a70aaebd4a88930c27d29453361f81590225398; expires=Mon, 22-Jun-20 33 | 09:16:38 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkZLOVl5Z1BUbUw0d2hjWGtNUWVNK1hMbzZjSEQ1MVBLWXRpRmc0bXQzN3M9IiwidmFsdWUiOiJUUXFUblNzNVwvU2FBMW5Ceko2cGRBV0FWWmdLMWJkT3dZK3VxVG1mdXRMVmJMREtqbEFNRE54NmdVZkZGK1pFVWVcL2NMa0ZSM3lUSTNQQk9nN1BCTDVRPT0iLCJtYWMiOiIyYTNlZTZjYzhmNTY2ODRhNmZmMzk3NWUyYzQwNmQwN2E2ZDM3NDFjNDllZDIyNjRlN2JmNTdiYmJhYTllNDQ5In0%3D; 35 | expires=Sat, 23-May-2020 11:16:39 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597dade4fcf50bcd-AMS 53 | Cf-Request-Id: 54 | - 02e26b031b00000bcded84a200000001 55 | body: 56 | encoding: UTF-8 57 | string: '{"success":true,"response":null}' 58 | http_version: null 59 | recorded_at: Sat, 23 May 2020 09:16:39 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/modifier/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/modifiers 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:04:57 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d8a716d5f7ae4044c2d68e8a0f53ed4641590224697; expires=Mon, 22-Jun-20 33 | 09:04:57 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InRuU2w2d0FvVytjRW02VlFuSVk3N0pSK3pkeGZtMncrRnB5VEdcL3JudVhBPSIsInZhbHVlIjoiV2YrNWxGdFNVcldNd1htb0k5SmFMWUY1bTdWZ2VJbUFMUHRIU05QeVo4UU1XN2Y5bk5oZ2pMbEd4TWFsNERkY1c4aFBCb1BXb002QVhhUDkwS0RjVEE9PSIsIm1hYyI6IjcwNWU1MzgwZDU0MjA4YjgzMzkyZmE5OTAwZTFhODQ5YTJhY2RhYmNlMzQzZDRmMTNiMmY1YTRmOTc2ZjFiMDcifQ%3D%3D; 35 | expires=Sat, 23-May-2020 11:04:57 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d9cc77f92c85b-AMS 53 | Cf-Request-Id: 54 | - 02e26050ae0000c85b1938b200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:04:57 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/payment/test_0001_should_list_all_payments.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/payments 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 08:49:14 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d6c905006f51ffd45d46977df92555ec31590223754; expires=Mon, 22-Jun-20 33 | 08:49:14 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkdzRERGMzhudlNBUldVNWpaWTVSR2JibmVQcFhEWk1wV2NHS08yUDh5bGs9IiwidmFsdWUiOiJ1c0JFMjNWdHFOUUYwM1J3ajVRUW9nNUFNM243bVEzXC90ZDVIYWFxQmNcLzlzMitGUldGbHlUOVFnUnh6Y2ZGTTJyRkJ6UFwvUEorNmZKSFE3MUt1K1BDdz09IiwibWFjIjoiZmNkMGRhMGE4ZGM5NmI4MDA1MWIxNTkwM2MwMzk0Yjk5MjVhZDlkMjVlZjUxZWRlZDJiZWI3ZmFkYWQzZmRiYyJ9; 35 | expires=Sat, 23-May-2020 10:49:14 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d85c329c3fa4c-AMS 53 | Cf-Request-Id: 54 | - 02e251edf50000fa4cee852200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"id":10693223,"subscription_id":3479984,"amount":0,"currency":"USD","payout_date":"2020-05-22","is_paid":1,"is_one_off_charge":false,"receipt_url":"https:\/\/my.paddle.com\/receipt\/14841377-10493223\/57013079-chre0d7968b883c-94b82a41db"},{"id":10710435,"subscription_id":3484448,"amount":0,"currency":"USD","payout_date":"2020-05-23","is_paid":1,"is_one_off_charge":false,"receipt_url":"https:\/\/my.paddle.com\/receipt\/14854225-10710435\/57064784-chrec5910826421-48f0e98797"},{"id":10710436,"subscription_id":3484448,"amount":0,"currency":"USD","payout_date":"2020-06-23","is_paid":0,"is_one_off_charge":false}]}' 58 | http_version: null 59 | recorded_at: Sat, 23 May 2020 08:49:14 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/payment/test_0001_should_raise_an_error_if_the_payment_refund_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/payment/refund 6 | body: 7 | encoding: UTF-8 8 | string: order_id=1234567&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 15:52:48 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d7d6f99b7d24d4cba60db76ff484d58f71590335567; expires=Tue, 23-Jun-20 33 | 15:52:47 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Im5MQ0dvZFczdTdESElyZ3FDanJxU1FJODBrMFduc3ljRjRYNnpMM2hoOTA9IiwidmFsdWUiOiIyaXh5TW43TzZLVlhOVDBwNHRwSVpIajdCZWtHZlRjdERmMGVqeDcybXN4VkFqREViMkNSR0FPWXhqWTFoOXQzN0dsVzVDQzBIM1BRMWNvdTkyb3ZNdz09IiwibWFjIjoiMmQ0NjFkOThiYjczYzViZjk5YzM0YTA2M2EyMjFlOTMxZjMyMTk4NjkyNzVhMjlmOTEwZTZlMWEzYTA1N2UyOCJ9; 35 | expires=Sun, 24-May-2020 17:52:48 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59882f9368f6c85f-AMS 53 | Cf-Request-Id: 54 | - 02e8fc101c0000c85fcc103200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":172,"message":"The transaction can 58 | no longer be refunded."}}' 59 | http_version: null 60 | recorded_at: Sun, 24 May 2020 15:52:48 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/payment/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/payments 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 08:34:17 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d3566a071cdd73e0009e54a80687c08b31590222857; expires=Mon, 22-Jun-20 33 | 08:34:17 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6ImJzYmRLY0FsYXdHZTl1MXArNTN3NEg4RER2VDY4bXU3WkFIS0xzem40MDA9IiwidmFsdWUiOiJabnBKTThKQ1AxVzh3VnU2NWxESWI2UHc1bUs5clpVS0x1S044K0JNTzZlV05KSGlMeXhvRFdldTBOZG1SYkQ4VmtPQ0NaZFRwSFlCTHhkRlhGM3BVQT09IiwibWFjIjoiMDIzNzY5ZWQ5NGVjOWFjNTZkMjY3Njg3NjU5N2YwMDUyMzQ0YmMwN2JmNmJkZDc3NDU2MDJjMWM2NDA3MjE4NiJ9; 35 | expires=Sat, 23-May-2020 10:34:17 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d6fdc19af0b6b-AMS 53 | Cf-Request-Id: 54 | - 02e2443d9000000b6bb5299200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 08:34:17 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/payment/test_0002_should_return_success_if_the_payment_refund_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/payment/refund 6 | body: 7 | encoding: UTF-8 8 | string: order_id=10710436&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sun, 24 May 2020 15:52:48 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d718a73dd3ca9f373ba6b29c30dc19cf41590335568; expires=Tue, 23-Jun-20 33 | 15:52:48 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InlCOUpKMzhcL2RMQmhIK1pNeFVnRGxwUlRsOFwvRG1wVWcwMEJmY21sb1pldz0iLCJ2YWx1ZSI6IlA4c3A5T0Z3clZJXC9SWkVYOXFjVzRhelVcL21zbjg2ekdDTFJ5SnVubVwveFYyemxQRzU0cVdVSzIrMmVPMDY2UE9sV2xOSUF3Q0phVXU4bVwveXRVS1JuQT09IiwibWFjIjoiM2ZhMjM2OTNmOGFjODQ5NDAxMTA0OTYwYTRiNDgyMTc2ZmIwOGU3MjhlYThjNTBhZDljYjllZjhlODdlMThmNCJ9; 35 | expires=Sun, 24-May-2020 17:52:48 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59882f95aed70b6f-AMS 53 | Cf-Request-Id: 54 | - 02e8fc118600000b6f68bae200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"refund_request_id":12345}}' 58 | http_version: null 59 | recorded_at: Sun, 24 May 2020 15:52:48 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/payment/test_0002_should_return_success_if_the_payment_reschedule_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/payments_reschedule 6 | body: 7 | encoding: UTF-8 8 | string: date=2020-12-31&payment_id=10710436&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 08:50:42 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '32' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d69ac14ea4a637b45801bbb60a2c6333a1590223842; expires=Mon, 22-Jun-20 33 | 08:50:42 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InlhalluaDJ2RlI4aWt6bVIrQ2Q4N3ZYaFZUTWJEMWE0VXpGbEJXU3RhZjg9IiwidmFsdWUiOiJkNkNjTXE2MkJkUmRFNHgrZURFNlJ2OTZNYk80Z1dOekZkdnp3RG1ZS0E0Q0xiVDNFUDY5UTdXejc2MTVzUEJwWTY2VE8rVis1dDhxcVVZUUV0YUw4dz09IiwibWFjIjoiMzg2ZmY0Y2QzNjczOTFlZWJjYmYwZTM2MzIxMDcxNzk0OGY0NDI2YTViNmQ2MThiYTM4NjJhZmZhNWE4MjE4NiJ9; 35 | expires=Sat, 23-May-2020 10:50:42 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 597d87e4bf9772b1-AMS 55 | Cf-Request-Id: 56 | - 02e25342ee000072b10a290200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":null}' 60 | http_version: null 61 | recorded_at: Sat, 23 May 2020 08:50:42 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/payment/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/payments 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 08:34:18 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d7d551f8af48cefd206011ac510caa8c61590222857; expires=Mon, 22-Jun-20 33 | 08:34:17 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InNsRXpRdnJDTU1CTnUzNmtjQTZCbkN5WmFmR2piWnphSjI3SWIrWktVUUU9IiwidmFsdWUiOiJRSkJZTVVVXC9iXC8zc3FGeFpRd0Q4U0wrU3NxOThtV0hhMXhCMWVFYVhWcURWNVg5Z2ZcL3VBckFrSFp2T2c5SGlzNGRyS1lPZmwrbHVcL2JETCtOakR4WlE9PSIsIm1hYyI6IjA2MmQyNWIzNjE3NjRiYmNkNDViM2ZjNmUzNjc0NTJkZDhmNDJkYmMyYTBkY2U4OThiYjJhMDM3Yzc3M2UzZGIifQ%3D%3D; 35 | expires=Sat, 23-May-2020 10:34:18 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597d6fde4e270c89-AMS 53 | Cf-Request-Id: 54 | - 02e2443eea00000c89e7026200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 08:34:18 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/plan/test_0001_should_raise_an_error_if_the_plan_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/plans_create 6 | body: 7 | encoding: UTF-8 8 | string: plan_length=1&plan_name=Test&plan_trial_days=30&plan_type=month&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 16:06:14 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d18ace1acb974c6f9b395516c9a1c60181590163574; expires=Sun, 21-Jun-20 33 | 16:06:14 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjNBZkoya2ZYemVmMW5MOEJ4VUVmd3lySko5eUV3SXNhOThXNEV6ZmpGMWs9IiwidmFsdWUiOiJ1cThuSWE4dTZjeUZ3UEFUNjNCS1ROUU00ZGNuOFl1NURBb3k0Q0RNV0VyajNVYURGTk1YeStRWmMydDU5bUljTkZcL0Z4WVRJcGF4enlRSmJFYzdlYmc9PSIsIm1hYyI6IjUzM2YzOTViZDgzMmFkZDVhMjNjMzhhNmEyMTNiMmNmZWZhYTZkOWUxMzgyNWMzODc4ZWY1ZThhOTE5Y2UxYTAifQ%3D%3D; 35 | expires=Fri, 22-May-2020 18:06:14 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 5977c8821b1b0b4b-AMS 53 | Cf-Request-Id: 54 | - 02debba54c00000b4b6bb2f200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":125,"message":"Main currency price 58 | was not provided"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 16:06:14 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/plan/test_0002_should_be_successful_if_the_plan_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/plans_create 6 | body: 7 | encoding: UTF-8 8 | string: main_currency_code=USD&plan_length=1&plan_name=Test&plan_trial_days=30&plan_type=month&recurring_price_usd=5.00&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 16:08:52 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d905f33e902fda4917c3808d6020449ce1590163732; expires=Sun, 21-Jun-20 33 | 16:08:52 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - _calq_vendor_d=eyJIYXNUcmFja2VkIjpmYWxzZSwiSXNBbm9uIjp0cnVlLCJhY3RvciI6ImEzYzM2ZDBlYTMzNWNlNmEwOTNjNThiMTc3MzE4ZWYxIn0%3D; 35 | expires=Fri, 05-Jun-2020 11:28:59 GMT; Max-Age=1192807; path=/; domain=.paddle.com;SameSite=none;Secure 36 | - paddle_session_vendor=eyJpdiI6Imd0ZFowWDFvTXJHUm0yRUFPRmd2WjZNbGlTV1hvSDFxTU1JTmVITm9Ycjg9IiwidmFsdWUiOiJGNHRUbUxvenRqRXk4MU5sV1dLTnFCbDZ1c2RXMVJXbDlXZlp6MnRsSjA1MTRuVzhtR2VUYjBJQVRFSnBOMmhcL1doWDJiQitvRGJcL3hGdWFDTUVvOE53PT0iLCJtYWMiOiJkOGQ1OGRkZjM2NWM5MDk4NzY5ZWUyMGY0NjNjZGM4ZGM0MDVmMzE2OTgwNTZjZTYxOWEzMzNjOTNkZmUzMmYwIn0%3D; 37 | expires=Fri, 22-May-2020 18:08:52 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 38 | secure; HttpOnly;SameSite=none;Secure 39 | X-Powered-By: 40 | - PHP/7.2.31 41 | Cache-Control: 42 | - no-cache 43 | X-Frame-Options: 44 | - sameorigin 45 | P3p: 46 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 5977cc602aeafaa8-AMS 55 | Cf-Request-Id: 56 | - 02debe101b0000faa81c3f7200000001 57 | body: 58 | encoding: ASCII-8BIT 59 | string: '{"success":true,"response":{"product_id":594469}}' 60 | http_version: null 61 | recorded_at: Fri, 22 May 2020 16:08:52 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/plan/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/plans 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 12:18:53 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d27696a629cf30bb53daca92cf3477a861590149933; expires=Sun, 21-Jun-20 33 | 12:18:53 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InptbDB1Z1dVTCt5RFZtWEswa2pzK0ZnUHJKUGxDeHV0eW5cLzR1SnZ1dlNVPSIsInZhbHVlIjoiMjF1aFBtYjJrNUVkdlRWR3RSNzdWbzVFYWxaR2VaN3ZzVmFDZW5CWHBSSE1sTnRUTWc4V3M4RzJOZkhFS09LNUpDTE5rNkYrOGtRalwvR2wxVzY3SlpBPT0iLCJtYWMiOiI4NjE4ZTlhODE4ZWI3YWI5NGE2NTY4ZTU0MTQ4NjI3NjYyMTg4NTU1ZThhNzBmZTAyYjQ4YWI4ZjIyODcwNzA2In0%3D; 35 | expires=Fri, 22-May-2020 14:18:53 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59767b7c0d18bdaf-AMS 53 | Cf-Request-Id: 54 | - 02ddeb81850000bdafafab9200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 12:18:53 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/plan/test_0002_should_return_a_product_id_if_the_plan_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/plans_create 6 | body: 7 | encoding: UTF-8 8 | string: main_currency_code=USD&plan_length=1&plan_name=Test&plan_trial_days=30&plan_type=month&recurring_price_usd=5.00&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 16:26:42 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d245fe7b5ffe02832ced4f2ee3193e9f91590164802; expires=Sun, 21-Jun-20 33 | 16:26:42 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - _calq_vendor_d=eyJIYXNUcmFja2VkIjpmYWxzZSwiSXNBbm9uIjp0cnVlLCJhY3RvciI6ImYxZDM4ZTljODBiYzQ2OTI5MGM1YzMwZjQ1MjBlOWRjIn0%3D; 35 | expires=Fri, 05-Jun-2020 11:28:36 GMT; Max-Age=1191714; path=/; domain=.paddle.com;SameSite=none;Secure 36 | - paddle_session_vendor=eyJpdiI6IkRSck5KdGVaUVpKZXRtMlh4R2FLa1czcTVDNEUzQTRIZDZGeUxUUXZsQlE9IiwidmFsdWUiOiI4YmVSd25tUlJXR0Z4WFBJelJCbXNlK1JwSUdDVEI4SUJ2WERFQlNtXC9QNldIUCsyclZQYm9Wc3g0SmpEd3dUNDRPTG83dTJDdkRCVU16Q2tlcTFGMVE9PSIsIm1hYyI6IjE1ZjA5NWY2YjI2YWU1MWYzYjIyMzhlNDMwNGM2ZmY0YWUwMDIwZjQxZDFiYzA3OGU2YWJiYzM0YmQ2NDZmMTcifQ%3D%3D; 37 | expires=Fri, 22-May-2020 18:26:42 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 38 | secure; HttpOnly;SameSite=none;Secure 39 | X-Powered-By: 40 | - PHP/7.2.31 41 | Cache-Control: 42 | - no-cache 43 | X-Frame-Options: 44 | - sameorigin 45 | P3p: 46 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 5977e67edb1372b1-AMS 55 | Cf-Request-Id: 56 | - 02dece6343000072b1fb88c200000001 57 | body: 58 | encoding: ASCII-8BIT 59 | string: '{"success":true,"response":{"product_id":594470}}' 60 | http_version: null 61 | recorded_at: Fri, 22 May 2020 16:26:43 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/plan/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/plans 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 12:18:53 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d374c4b7a9a22ebc9166d0129d91fd6be1590149933; expires=Sun, 21-Jun-20 33 | 12:18:53 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Ikh1UWNuR1RIWmRqZkhTUmlMcEF6SE9yc1pHa3VQcGVZdFVlSW03R3Z2TFE9IiwidmFsdWUiOiJkaXJwZ1J5V2VzQ1FCd0ZXZG5GUnppVWMyczFPSXQ5ZDkyblhBeHlwV0pXaDBES0xwb29MbjFSMnFMSE9lSHVPMXVmKzhIcko3Ykl5N1o4UkZQTUhqZz09IiwibWFjIjoiZjZlYjljYzRiOTczNWIxYjNlMjEwNGIwMjk4MzE1ODc2ZTRkMTFjY2U4OWNjMDc4NmEyMTE1ZDY1ZTY3MzI1NSJ9; 35 | expires=Fri, 22-May-2020 14:18:53 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59767b7a0b810c19-AMS 53 | Cf-Request-Id: 54 | - 02ddeb804100000c19800e1200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 12:18:53 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0001_should_list_all_users.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 16:29:40 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d73fef5266f772f6d9c4b3894c4a88eda1590164979; expires=Sun, 21-Jun-20 33 | 16:29:39 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkFzZXBQWDhXazBNemFTa21PZ1M2eVRkWEZPT0RcLzRDZmYrUE5Kbk1GdUlJPSIsInZhbHVlIjoiNE0zOFdmOGpma3hoWmZDelNTeTJ4OHBxT0hPN2hvNUFWXC9jTUlpWHMyQ1FpYWg3YkNRRm5PK1ZkV3JlT2ZqcVEwWnZGN1wvMFNTRnVwMUN3NytVZWNPUT09IiwibWFjIjoiM2NiNDAyZDZhNDhlN2ZlMjc1YTU1YjkxZDU3YzE5YTEwNDE5OGZmYzgyNTMyODIwZmI1OTFlYzhmYWU4ZDU0NiJ9; 35 | expires=Fri, 22-May-2020 18:29:40 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 5977ead4ec06c863-AMS 53 | Cf-Request-Id: 54 | - 02ded119130000c863ccab8200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"subscription_id":3479984,"plan_id":594469,"user_id":17368056,"user_email":"test@example.com","marketing_consent":false,"update_url":"https:\/\/checkout.paddle.com\/subscription\/update?user=17368056&subscription=3479984&hash=173a39c6f694abd07ce2ef14bba39546375343cf7078e2fc5cefcc2c5ac89d29","cancel_url":"https:\/\/checkout.paddle.com\/subscription\/cancel?user=17368056&subscription=3479984&hash=85ea42ca76e49ab9cee8cde56ea07e3fcac6c35efa3e9bc0e53284602e17a56d","state":"active","signup_date":"2020-05-22 58 | 16:21:38","last_payment":{"amount":0,"currency":"USD","date":"2020-05-22"},"linked_subscriptions":[],"payment_information":{"payment_method":"card","card_type":"visa","last_four_digits":"0065","expiry_date":"06\/2024"},"next_payment":{"amount":5.95,"currency":"USD","date":"2020-06-22"}}]}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 16:29:40 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0001_should_raise_an_error_if_the_cancelation_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users_cancel 6 | body: 7 | encoding: UTF-8 8 | string: subscription_id=1000000&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 17:18:15 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d68639405926499ad831b1e858b3549231590167895; expires=Sun, 21-Jun-20 33 | 17:18:15 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Ik1KdUxERHkxM1NvV1BUZWI5b3piYktvUkZZSDBMWEZ6Q1BvS0F5bjRzREk9IiwidmFsdWUiOiJFbTJ3dDBFRU9ndnFJbE4zaDgzdXRsU3VROTdRUVRyd2I5OW14ZkdRalNka3E1djNLXC9tYVhLbHgyMUptc2RrMk5uTzN4K3RyQ3loKzZWckZvQ1ZURUE9PSIsIm1hYyI6IjRhM2ZlZWY1Njc3NGQyMmRlNjliMjQ4MDljYmY4YjA5OGJmMGI4YmU5OWM2MTI5MGY3YTIxZGM3NTdjMmFiM2EifQ%3D%3D; 35 | expires=Fri, 22-May-2020 19:18:15 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59783203dd4cc771-AMS 53 | Cf-Request-Id: 54 | - 02defd96670000c771da09f200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":119,"message":"Unable to find requested 58 | subscription"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 17:18:15 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0001_should_raise_an_error_if_the_subscription_update_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users_update 6 | body: 7 | encoding: UTF-8 8 | string: subscription_id=3479984&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 17:05:59 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d8782e054913e9f02cbf8a29ccbee58601590167159; expires=Sun, 21-Jun-20 33 | 17:05:59 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InV0QXlOekx2ME1kOGd4ZUFPRUJMcHdCaThkbDcyamhXc0dnTVBmcUlaeU09IiwidmFsdWUiOiIrTnJTVjJGRjZFaHZzS0FBR2RoRzVhdWlcL2l3NWgxNlk0aW5wN3VJY1R0c1wvQjZXdjQrM1VpRXFUd2ZmZ3ZlU09RKzdUZldvc3A5amhoS1g0K1hcL1l2QT09IiwibWFjIjoiYjAzMGZhZWMxZjdkOGI2ZGRjYmJhYzVlNjhkNmI2YmUwMjVlODQyYzA4YmIyMzZkNTM4MzdkNTZiNGRhZDFmOCJ9; 35 | expires=Fri, 22-May-2020 19:05:59 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 5978200c3ead0c05-AMS 53 | Cf-Request-Id: 54 | - 02def25ba700000c05bcbc8200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":116,"message":"One or more required 58 | arguments are missing"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 17:05:59 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0001_should_raise_an_error_if_the_subscription_update_preview_is_invalid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/preview_update 6 | body: 7 | encoding: UTF-8 8 | string: subscription_id=3479984&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 17:06:00 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=defdf1dcb1b0d2198b3866292792385591590167160; expires=Sun, 21-Jun-20 33 | 17:06:00 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6ImdUQTVWQzRGQW54Vyt6N21nR25yRmZDajVLQzlLYmpjZTlyM2RHS1FRalU9IiwidmFsdWUiOiJLeWpzbjR3OUpBREJBTFM1a0s5REh5SElxMmxxU0h6Sk5EWm1xREwrUzVlYzNJRUJ2bzg5elJNTXZra3pKRVZGbW01OVZkNEJjQzg3XC83ZDI3YUo3OGc9PSIsIm1hYyI6IjBmNjQ2YjAwMTE3M2Y4YzY2MjU0OWVkZDZlYTc5NDg5MTZhMTQyZGMyOWE3OWZmNTYyNTliYWM3NDc5ZjEyYWQifQ%3D%3D; 35 | expires=Fri, 22-May-2020 19:06:00 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59782011becf0b63-AMS 53 | Cf-Request-Id: 54 | - 02def25f0e00000b63999ac200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":116,"message":"One or more required 58 | arguments are missing"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 17:06:00 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 16:29:39 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d4f9721eb2acc1ce5a3e9c2ac1ee1ca7d1590164979; expires=Sun, 21-Jun-20 33 | 16:29:39 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InVqeUw3K0dFODNDSmYydFwvN25rSVpNNXhKM0NhOVpnOEpxbmJkMXlLM2hBPSIsInZhbHVlIjoiaG5Ed2FkTDRZSVRFbWNkZElOMkhFNUR1U0dvdFN1dnRnbUh3VkNOdTRLU3paQ0tDeWxNejg5bVJsaGJRdzh2cExKSGRKQVU1VVJoWnFtUHFXKzlWMnc9PSIsIm1hYyI6ImYzZDg2YTc5ODg2NWQ2M2E3M2FiY2FiZmY0Yzc3OWEzNDcyZjY0NWZlYzY1MjMyZjhjZGVmZDJlZmZlYmZiODYifQ%3D%3D; 35 | expires=Fri, 22-May-2020 18:29:39 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 5977ead2aadd0c79-AMS 53 | Cf-Request-Id: 54 | - 02ded117ac00000c7913840200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 16:29:39 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0002_should_return_a_subscription_id_if_the_subscription_update_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users_update 6 | body: 7 | encoding: UTF-8 8 | string: currency=USD&quantity=1&recurring_price=10.00&subscription_id=3479984&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 17:06:00 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d30f5f92caff4a7af6e7c6e8bb5351bd21590167160; expires=Sun, 21-Jun-20 33 | 17:06:00 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IndXR1o5YlE0RXBBUHo0Q3labG5wQ1p1Y2lLWVZmQ2VMMUFhOWJPVm83aWs9IiwidmFsdWUiOiI1RWZmaUVPY1wvV3pXMWJsNjJUSEE3K0RtTkhOOUltRm9DSXVxdDZueW1pMXlIZnRVTlh1V05SQXYrT1N5d3dnNWpoUEQ5cjFsVmhtN3F1cjcyOWVBa0E9PSIsIm1hYyI6ImEzZjUxNGNhZDAwMzgxNTYyNGJlOWNiZWY3YmU3MDFkODQ3NjU0NmYwYWIwZjQ5NzhkYzRhZmY0YmE4YzY1YTEifQ%3D%3D; 35 | expires=Fri, 22-May-2020 19:06:00 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 5978200e8a26bdf5-AMS 53 | Cf-Request-Id: 54 | - 02def25d190000bdf5d78d7200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"subscription_id":3479984,"user_id":17368056,"plan_id":594469,"next_payment":{"amount":17.85,"currency":"USD","date":"2020-06-22"}}}' 58 | http_version: null 59 | recorded_at: Fri, 22 May 2020 17:06:00 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0002_should_return_a_subscription_id_if_the_subscription_update_preview_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/preview_update 6 | body: 7 | encoding: UTF-8 8 | string: currency=USD&quantity=1&recurring_price=10.00&subscription_id=3479984&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 17:06:01 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d90183d9434dbdb5047cecdba6c8da4f91590167160; expires=Sun, 21-Jun-20 33 | 17:06:00 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjJkOHpHMWVYZ2dDZEJXZU04UmEwVGRBT2xxK0VXNmZSNFJtbDNWV0hCWU09IiwidmFsdWUiOiJlOFpVUitUbVljVFFZNVpzM0lzd2RNdXkwblVNWlp1XC9oVDVpc0VlKzZmSDI4MXBSRnBHZ2RBZFIwZ0ROcHc5a1crRnE3ZEljU2F4VTMzWnp3S09vSFE9PSIsIm1hYyI6IjhjYzNmZDgxOGFhZWYwMGNlM2NlZTg1YTgxNmQxYTJkZTU0ZGY0MTU5MmRmYjlkNGNiMzA5NjRlZTY5N2Y5MDEifQ%3D%3D; 35 | expires=Fri, 22-May-2020 19:06:01 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 59782013ce419c45-AMS 53 | Cf-Request-Id: 54 | - 02def2605e00009c4593985200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":{"subscription_id":3479984,"user_id":17368056,"plan_id":594469,"next_payment":{"amount":11.9,"currency":"USD","date":"2020-06-22"}}}' 58 | http_version: null 59 | recorded_at: Fri, 22 May 2020 17:06:01 GMT 60 | recorded_with: VCR 5.1.0 61 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0002_should_return_success_if_the_cancelation_is_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users_cancel 6 | body: 7 | encoding: UTF-8 8 | string: subscription_id=3479984&vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 17:42:36 GMT 25 | Content-Type: 26 | - application/json 27 | Content-Length: 28 | - '32' 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d2f828e7e6234ba80eca317b87ba20c3d1590169356; expires=Sun, 21-Jun-20 33 | 17:42:36 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InprdXp0M0hLellCNFBRZUpucXZJVVhLNWtseUFGT3BJVG9WY1NlT2c0Szg9IiwidmFsdWUiOiJjTHVSb0h6Q2szY1dFZXc0cTZnSWdVbUdSVTZzWUxOMUVtRDZIMHArRGpkMUloM0t1NUtudWV6Q1YrSE1pbmpSR1NcLzdJZXA5NFNFeHJFcUd3dStwb0E9PSIsIm1hYyI6IjI2ZWRjMmU4N2Q5YjA4MWFkMjhlMWVlODFmYzAxNzRkMzAxMGFiNTliZjczZTg5YWUyNjFlMWY1ZTBlNmI1NWQifQ%3D%3D; 35 | expires=Fri, 22-May-2020 19:42:36 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Accept-Ranges: 46 | - bytes 47 | Cf-Cache-Status: 48 | - DYNAMIC 49 | Expect-Ct: 50 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 51 | Server: 52 | - cloudflare 53 | Cf-Ray: 54 | - 597855addc20bf82-AMS 55 | Cf-Request-Id: 56 | - 02df13e0a40000bf82ed312200000001 57 | body: 58 | encoding: UTF-8 59 | string: '{"success":true,"response":null}' 60 | http_version: null 61 | recorded_at: Fri, 22 May 2020 17:42:36 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/subscription/user/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/users 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Fri, 22 May 2020 16:29:40 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dbce9431a3658af4cc2654935c2b10ccd1590164980; expires=Sun, 21-Jun-20 33 | 16:29:40 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InlXRHZROUowNUVcL3NJWkpIVEFrWXlnXC96ejAyUDluWDg2Y2Z3YlkxU3gybz0iLCJ2YWx1ZSI6IjV6QjBNendvQUJwc3FkejFReVBCcWRGSTIwMGFFcWtPWU5HSklUOXZnQkFvSldqbGVMTGx1MlNJSUtiWEQ1MGplNzN3NERhczRZWjBRcWVXKzdvN0x3PT0iLCJtYWMiOiIyNGI5NDhjOTdhN2Q0NjUzMWNkNGIyNDdlNGEyNzE5NzIyNDA3MmRlMjEwOWI5MzExODI5OTQ2NzliOTI4N2E3In0%3D; 35 | expires=Fri, 22-May-2020 18:29:40 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 5977ead77840c79d-AMS 53 | Cf-Request-Id: 54 | - 02ded11aa70000c79d5b223200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Fri, 22 May 2020 16:29:40 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/checkout/test_0001_should_list_all_checkouts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/checkout/57064784-chrec5910826421-58f0e94797/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:29:33 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=da41445a4bdf48265b36beed855f32cdc1590226173; expires=Mon, 22-Jun-20 33 | 09:29:33 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Im5VTU8wcG9ZbW1wXC9sRGFnZHg3MVFKMVVyUmttdXNucXBZTGtSZ0huWkFBPSIsInZhbHVlIjoiZjlCak5qRVNSampxWmkwVHNaZXc3eUdCSlNiWnlEU3FIbDN5OXNSK042bTBSWkYzNWxvek5RVlpHXC80RW1aeE9EclB5aCtFSVdmcmpiVlwvK05VZm9kdz09IiwibWFjIjoiNjljMGRkMzYxZmQwMzgzMDQ1MjMzNDRmYmQ2N2ZhZjc0MzBlYjM2MDQ2YWNhMjY3NTFhZWNmODQ5N2E4YTY1MCJ9; 35 | expires=Sat, 23-May-2020 11:29:33 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597dc0cfbd5d0bed-AMS 53 | Cf-Request-Id: 54 | - 02e276d5d200000bedababa200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"order_id":"14854225-10710435","checkout_id":"57064784-chrec5910826421-58f0e94797","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-23 58 | 08:47:55","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3484448,"status":"active"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14834225-10710435\/57064784-chrec4900826421-58f0e94797"}]}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:29:33 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/checkout/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/checkout/57064784-chrec5910826421-58f0e94797/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:29:33 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dc43f5c91c4196b00211fc67a7e95e9f71590226173; expires=Mon, 22-Jun-20 33 | 09:29:33 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkFuZHdId3NjeXlJeTFPeGhudFFWdlwvNGFSNFNSeHV5RXMreWRSXC85NXYyOD0iLCJ2YWx1ZSI6IjFlcXozZmlxeTJTRW5WbkJlSXpxTk1DMGdPYlhtSEtNeVN5OWVVTk5nQjlPOVVWbUtucUtXXC8yZzFtS2VzaGxEYjZcL0EzUGtHblR4ekhra2VjNzZhOWc9PSIsIm1hYyI6IjZhZGVlMjIxM2Q0MDE4OTk1ZTBkY2RjOWJiMjcxZWQ5Mjc0ZTI3ODgwNDkzZTI1M2ZiYzMxNzAzMTkxZmUzYjIifQ%3D%3D; 35 | expires=Sat, 23-May-2020 11:29:33 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597dc0d26aeabdcd-AMS 53 | Cf-Request-Id: 54 | - 02e276d77e0000bdcd47a86200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:29:34 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/checkout/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/checkout/57064784-chrec5910826421-58f0e94797/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:29:34 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d01b3cf41a6134780801711d1aa6e4d161590226174; expires=Mon, 22-Jun-20 33 | 09:29:34 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InZsK3pGaUh1bGxVcFpCU3Fzd0ZGRzFuM1IwcksyaklvbHBxcEFSN0duXC9rPSIsInZhbHVlIjoiVkVaUEJCRTVWUGpXaUd3dGFaaWprb0VGWlBFcXlMU0hpV1B1czF3SWxQSUpMMUhNQ2xkdjd3ZTVaUmhDVmFlZ3ByYXZxemd0WE00SU9xXC9CSmIrOWtRPT0iLCJtYWMiOiI0NjQ4ZTliMzQ5NjAxZjI3NjExMTcxNGNjOTdiYTUwM2VlOWJiNWE3MGE3NzhhNWVlMDVmMmRiYzY0NWQ4OWI5In0%3D; 35 | expires=Sat, 23-May-2020 11:29:34 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597dc0d50c690c79-AMS 53 | Cf-Request-Id: 54 | - 02e276d92200000c793b134200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:29:34 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/order/test_0001_should_list_all_orders.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/order/14854225-10710435/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:47:35 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d1be66dc3bf97583580423fffd8a2d1aa1590227255; expires=Mon, 22-Jun-20 33 | 09:47:35 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IiszZlwvaU5MS2k1N243OWczVU5sNmtZaVBDVVdvbVwvWnNjb1M1RjBaTFRNYz0iLCJ2YWx1ZSI6IjdiXC95bk9CTXl5XC94MTNiR3QxRkdtV2VtSEJJVHhqaStRZlltS2dsVkRWM2RacDVrWXVHcGNCS0JcL2NRVVJOT3pScnJOMmJwc0NKYmlNSlwvV3FtMTVwZz09IiwibWFjIjoiNzc1YWFjM2YwM2M0NjE2NDI3Y2FlNTZmOWIzNDcxNDI4ZDJlNzlhYjQ1YjM2YTcxZjg2Nzg4NDIyN2QxYTUwYyJ9; 35 | expires=Sat, 23-May-2020 11:47:35 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597ddb385ac60bed-AMS 53 | Cf-Request-Id: 54 | - 02e287573600000bedb8059200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"order_id":"14854225-10710435","checkout_id":"57064784-chrec5910826421-58f0e94797","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-23 58 | 08:47:55","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3484448,"status":"active"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14854225-10700435\/57064784-chrec5910d26421-58f0e94697"}]}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:47:35 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/order/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/order/14854225-10710435/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:47:36 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d5659848209cbe82a0fc1fc249dea8dc41590227255; expires=Mon, 22-Jun-20 33 | 09:47:35 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkNlb01aRHBOQ2xWRFZ6eVhhMERPeE1INElcL2NoR2dnQ1BzeUpUWDNNZHZvPSIsInZhbHVlIjoiQ0NoQmpXK29SRzlpQVVGSmM5cGU1WG9lNEpzdnZON0VTd1NjdWZyMDNCM0JPRGJkcUN3T0JJNURoUGVWa2pPQ0NYbGs1VDZ2YmZCNlBDTzRGRU5qUUE9PSIsIm1hYyI6IjYwMjUxNTNkNDVjMmExOTdmOTY4MDJiNmYwOTY3NGI5MTJhZWZmMWZjOWI0N2ExMGU0NjhhMGVkNGI4MzgyMjIifQ%3D%3D; 35 | expires=Sat, 23-May-2020 11:47:36 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597ddb3d7cb7fa70-AMS 53 | Cf-Request-Id: 54 | - 02e2875a680000fa700f37b200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:47:36 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/order/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/order/14854225-10710435/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 09:47:35 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=df4adbd7782151159cf9aa41f447b12b81590227255; expires=Mon, 22-Jun-20 33 | 09:47:35 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Ikl0ZDFCZW1qRnFSK2VBNEMwQmJqT0ViVVEzQVdkOVlyNU9lZnMzWEw0NEU9IiwidmFsdWUiOiJlSVwvcXoxY3hidGxSVWlxanFaaERvKzZpb0hkTkVmXC9qTFFZQlp3VGs1d25ITWJPUldGc3NyRjM1VVplVmVybEJLMjExd01JWVVzXC9jNmlJQ1ZIY3JlZz09IiwibWFjIjoiZjZjMDQyNmExOGZlODE5MjU3NzU5NzQ0M2QwMmYyM2I0MzFkYTcwMThhYTg2NjI3NDU1MmMyMmViMjBkMzQ3MSJ9; 35 | expires=Sat, 23-May-2020 11:47:35 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597ddb3aef95bdeb-AMS 53 | Cf-Request-Id: 54 | - 02e28758cd0000bdeb56a4e200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 09:47:35 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/product/test_0001_should_list_all_products.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/594469/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:43:39 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d59e73a2e61f68df7996c2ccd93870b141590230618; expires=Mon, 22-Jun-20 33 | 10:43:38 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IlwvdGN2RHhueXd4NW1HRFRFaEIzd1dzZ2phRit2Y3NNSG1MMVJ3blV4VUVnPSIsInZhbHVlIjoiZkVoOVppYVFPdmdiYjNzZmQ2QU9UU0ZnZmZ5QVFXVmRzWDFXUFVNVG1hUnBzQmFqMFc2ZnVROEM3NmtqWFBDNWtQZjNDV2xuaStCdDU5dDNNOE13Z0E9PSIsIm1hYyI6IjdiZjNhNDM3ODExZTg3YWRhZjVkNTFmOGJhN2MyNGJmMjBhYjJlZTQyMmU2ZjYxOWNkMDZhMTU4YWUwMTg1NDkifQ%3D%3D; 35 | expires=Sat, 23-May-2020 12:43:39 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e2d57be3bc795-AMS 53 | Cf-Request-Id: 54 | - 02e2baaad70000c7954519b200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"order_id":"14854225-10710435","checkout_id":"57064784-chrec5910826421-58f0e94797","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-23 58 | 08:47:55","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3484448,"status":"active"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14854225-10710435\/57064784-chrec5910826421-58f0e93787"},{"order_id":"14841377-10693223","checkout_id":"57013079-chre0d8968b883c-94b82a41db","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-22 59 | 16:21:39","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3479984,"status":"deleted"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14841377-10693223\/57013079-chre0d8958b883c-94b82b41db"}]}' 60 | http_version: null 61 | recorded_at: Sat, 23 May 2020 10:43:39 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/product/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/594469/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:43:39 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dc2d59bd1cc9b983ce6d936482bcc1f4a1590230619; expires=Mon, 22-Jun-20 33 | 10:43:39 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6InMrT1wvQ2Y0Skg5SkJWbVBudSswMEFqUVEyZitXS1VUOTFxYkdcL1pIajJLaz0iLCJ2YWx1ZSI6InZEc1wvYkJLREhEaDJYZEFkRkNjU0ZcL2tKRGxhUHNcL0E4dkd0bXdHRFwvZlJtbVRcL2JYbTQ2cjNZMVpieldWT2hrN25RZVp5RHNRR2NNNmpKXC9mYXJsbUJ3PT0iLCJtYWMiOiJiNTk1OWU2OTZlZDQyNmE1Y2Y3YTc5MjQ0MzBkNWY5MDQzZjU3MDk2YjkyMzE1ZTk2ODA4MTQ3MjRiYTYzOWVjIn0%3D; 35 | expires=Sat, 23-May-2020 12:43:39 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e2d5a8e380bf1-AMS 53 | Cf-Request-Id: 54 | - 02e2baac9600000bf19e973200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:43:39 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/product/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/product/594469/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:43:39 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d9c8fd180b4a7c9e7f6c8113dae69d6421590230619; expires=Mon, 22-Jun-20 33 | 10:43:39 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6Imk1YkFuUTVZaVVkTFBKczZQS1g4N292VUNHNVFNdks3MGVkYnVSdkgrWG89IiwidmFsdWUiOiJcL1RuZW9Vc2lsTHJ2dUZiMXZPY2huXC9RaUw1UWU3aVV0eDRIXC9mSUxLcHRSV3dPUmFiTW9IOVY3eGtlM2hPNnlJVFF3SERpSkNWTmxvMGRvTFI5TDhsdz09IiwibWFjIjoiY2NjN2RjODZmMzFmYzc1YWJmZTE0ZDA0Yjc2OTU4OGFhNzk4ODc3OTUwN2Q5YWViN2MzYzE1ZGE4ZDFjNDRiMSJ9; 35 | expires=Sat, 23-May-2020 12:43:39 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e2d5d1b349d42-AMS 53 | Cf-Request-Id: 54 | - 02e2baae3200009d42a6b6b200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:43:39 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/subscription/test_0001_should_list_all_subscriptions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/3484448/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:52:16 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d374fd9c631784a0a3a6a9c145f6c28461590231136; expires=Mon, 22-Jun-20 33 | 10:52:16 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkpJXC9oWENtVk9qUDFXYlJjZDM4RGlqcU9zOXlMMUw4cW9VWTNwbmZOY3dRPSIsInZhbHVlIjoiWDJEM2gwTXpiTXc5R2ViajIyOHNaK1FEMjhhWlZhVVBwTEZ1TjNqSk41SkdNSHFSTERkZHFpeURcL1BNSmRyb3lcL0hOdzd2UUJVS0tKOUZRbWRMTWprZz09IiwibWFjIjoiM2QyYThhN2QxODI4MDk2ZGM3MDE0YzAwOWRjODE3ZGRmN2JhMDIxMmIyMzhkN2Y4YmE5NzFlZTZjM2FmMjMwZSJ9; 35 | expires=Sat, 23-May-2020 12:52:16 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e39facc56fa3c-AMS 53 | Cf-Request-Id: 54 | - 02e2c290b90000fa3ca927b200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"order_id":"14854225-10710435","checkout_id":"57064784-chrec5910826421-58f0e94797","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-23 58 | 08:47:55","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3484448,"status":"active"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14854225-10710435\/57064784-chrec5910816421-58f0e34797"}]}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:52:16 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/subscription/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/3484448/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:52:17 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dee7cff3bfc5d978ef5e5899d691caf111590231136; expires=Mon, 22-Jun-20 33 | 10:52:16 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjkxZnlRUzdWK1FqaHV0bFwvVG9Memc3cmVLc2xWT09jaXVNaUJPS003K1p3PSIsInZhbHVlIjoiMDh1RzBpQTg0dHptMzQ5bXRpQ0JwOEhCbDVWYXJUVlRHUkdmOG8ybkxNb1kwQTBYOEpSVzFxSjZxQjBZNU4zQ0RBWW1jeVdcLzlLNCtPTDg3RGZqVUlBPT0iLCJtYWMiOiJjODkwMTYxMmQ2NTEyMGQwZGZlMTQyN2QxOGE1OWZiZjEzYmI5MDQxYjJlYjFiMGQ2MWMwNGY3OTdlMGQ5ZTliIn0%3D; 35 | expires=Sat, 23-May-2020 12:52:16 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e39fd5a7afa44-AMS 53 | Cf-Request-Id: 54 | - 02e2c292590000fa44c1a5f200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:52:17 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/subscription/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/subscription/3484448/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:52:16 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d0861317302adabcf0b0c3ad9d209e7c61590231135; expires=Mon, 22-Jun-20 33 | 10:52:15 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjVTXC9cL2x4R0R3cXhGRmNUWVFSV3phVys2bXQzeXhaTjk4bjFsXC9pckRxMjg9IiwidmFsdWUiOiIzUWxRcE5YM2s1V0M1UDcrWGxWbzNcL3hUcUhDVE1vdVIzcTdIbFdtTnQ4TjR2dCtVUUN3UWVVdmU4ZitOSWlmdkE1eEdoWGhBUDdJSDRTMElPd2VITnc9PSIsIm1hYyI6IjVhOTk0NDI0MWMwMWI4OGE5M2QwMzVkMDFmZDZhMmMxZjFhZmYzZWU0OWFkNjc3NjM5ZDI4NjRkMGNhZjYzNmYifQ%3D%3D; 35 | expires=Sat, 23-May-2020 12:52:15 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e39f6b9adbdd2-AMS 53 | Cf-Request-Id: 54 | - 02e2c28e300000bdd2058ac200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:52:16 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/user/test_0001_should_list_all_users.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/user/17368056/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:55:14 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=dcf2981dafe5d3d63c23225edafc86db81590231314; expires=Mon, 22-Jun-20 33 | 10:55:14 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjFEbFFqMjg5OGtadjVTSHlONzRSVEJSVnlOYmJhXC82VEhwM2k0UUxyenpFPSIsInZhbHVlIjoiZzZEVUhiT0hNTEdnUXNZc2prekdtT25aeldTc3VIOGZSZkVCYytYYTd4V2pKeTBPU1loWWZQcFlkcll3ZkVUUFFPRTJCeCtLOXROQVhZb3JoSDRkNEE9PSIsIm1hYyI6ImEwN2JmOTk4MzRiNDg3ZTYwMzQ4MjMxZDY2NjIwNzMxYjZhMmFmNzMzZjk0OTUyYzFkNzc2YzYxMGIyYmZmZGIifQ%3D%3D; 35 | expires=Sat, 23-May-2020 12:55:14 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e3e538a6172f3-AMS 53 | Cf-Request-Id: 54 | - 02e2c54830000072f3e7127200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":true,"response":[{"order_id":"14854225-10710435","checkout_id":"57064784-chrec5910826421-58f0e94797","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-23 58 | 08:47:55","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3484448,"status":"active"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14854225-10710435\/57063784-chrec5910826421-58f0e94697"},{"order_id":"14841377-10693223","checkout_id":"57013079-chre0d8968b883c-94b82a41db","amount":"0.00","currency":"USD","status":"completed","created_at":"2020-05-22 59 | 16:21:39","passthrough":null,"product_id":594469,"is_subscription":true,"is_one_off":false,"subscription":{"subscription_id":3479984,"status":"deleted"},"user":{"user_id":17368056,"email":"test@example.com","marketing_consent":false},"receipt_url":"https:\/\/my.paddle.com\/receipt\/14841378-10693223\/57013179-chre0d8968b883c-94b82a31db"}]}' 60 | http_version: null 61 | recorded_at: Sat, 23 May 2020 10:55:14 GMT 62 | recorded_with: VCR 5.1.0 63 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/user/test_0002_should_raise_an_error_if_no_vendor_id_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/user/17368056/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code=&vendor_id 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:55:15 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d7a3d9389d7ff4d7ca4b28e8b0e6766dc1590231315; expires=Mon, 22-Jun-20 33 | 10:55:15 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IjJjOCtoemRJcVVVNE9mNVRDNnVPTnJwTVAxWUd3bDdBcStPTEo1XC9VNktFPSIsInZhbHVlIjoiU2I2OWg2QnoreDdXVnNSVXN5WFM3d29KOU1XMXVQQ3c0NzlXMm1IZlUyeWJCT2F3NUI4SHo1Sml4MHdmN0NcLzNpc20zZldNa1ZVRzlFZ2RtVnJUWEZBPT0iLCJtYWMiOiIwM2VjYjY5NTUxMWRiOWM5MDcyYTc0MDg1ZDA5NjEyZGE1OGQ2ZTVjY2VkYTE1ZDc2YjQ1NGViYmRkNzlmNTgyIn0%3D; 35 | expires=Sat, 23-May-2020 12:55:15 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e3e588d08d8f9-AMS 53 | Cf-Request-Id: 54 | - 02e2c54b560000d8f9858ea200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:55:15 GMT 61 | recorded_with: VCR 5.1.0 62 | -------------------------------------------------------------------------------- /test/vcr_cassettes/paddle_pay/transaction/user/test_0003_should_raise_an_error_if_no_vendor_auth_code_is_present.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://vendors.paddle.com/api/2.0/user/17368056/transactions 6 | body: 7 | encoding: UTF-8 8 | string: vendor_auth_code&vendor_id= 9 | headers: 10 | User-Agent: 11 | - Faraday v1.0.1 12 | Content-Type: 13 | - application/x-www-form-urlencoded 14 | Accept-Encoding: 15 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 16 | Accept: 17 | - "*/*" 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Date: 24 | - Sat, 23 May 2020 10:55:15 GMT 25 | Content-Type: 26 | - application/json 27 | Transfer-Encoding: 28 | - chunked 29 | Connection: 30 | - keep-alive 31 | Set-Cookie: 32 | - __cfduid=d05655ffad2c7ac2931a98bcc58c4e4211590231314; expires=Mon, 22-Jun-20 33 | 10:55:14 GMT; path=/; domain=.paddle.com; HttpOnly; SameSite=Lax 34 | - paddle_session_vendor=eyJpdiI6IkpSNU81TmtyeHJKaklUYkdpZUpDNlBKdXBQNldvNHhYcWs4OWNYXC9SZXhjPSIsInZhbHVlIjoiYnBVVHVuT2RrcFhsQnpwSGNGSUlpWk5iUGtUalFQZStadDlrOW1IcGNDVVBPVmE5NDVzVklcL216d2tMVHluWlU3cHI5cUczV0U5cWpLNkJiUWhWTDJRPT0iLCJtYWMiOiJiMGE3OTFkY2U1YjM3OTU2MzA1ODdmMGI0MGEzYmViMThiY2IwNDE4YWQzMzFlMDZkNjg2ZjQzMmQxZjA1NDQwIn0%3D; 35 | expires=Sat, 23-May-2020 12:55:15 GMT; Max-Age=7200; path=/; domain=vendors.paddle.com; 36 | secure; HttpOnly;SameSite=none;Secure 37 | X-Powered-By: 38 | - PHP/7.2.31 39 | Cache-Control: 40 | - no-cache 41 | X-Frame-Options: 42 | - sameorigin 43 | P3p: 44 | - CP="CAO CUR ADMa DEVa TAIa OUR DELa STP ONL NAV STA PUR" 45 | Cf-Cache-Status: 46 | - DYNAMIC 47 | Expect-Ct: 48 | - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" 49 | Server: 50 | - cloudflare 51 | Cf-Ray: 52 | - 597e3e56abf10c15-AMS 53 | Cf-Request-Id: 54 | - 02e2c54a2700000c159fadc200000001 55 | body: 56 | encoding: ASCII-8BIT 57 | string: '{"success":false,"error":{"code":107,"message":"You don''t have permission 58 | to access this resource"}}' 59 | http_version: null 60 | recorded_at: Sat, 23 May 2020 10:55:15 GMT 61 | recorded_with: VCR 5.1.0 62 | --------------------------------------------------------------------------------