lib/mangopay/pay_in.rb in mangopay-3.23.0 vs lib/mangopay/pay_in.rb in mangopay-3.24.0

- old
+ new

@@ -19,10 +19,11 @@ module Card # See http://docs.mangopay.com/api-references/payins/payins-card-web/ class Web < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/card/#{CGI.escape(class_name.downcase)}" end def self.extended(pay_in_id) @@ -38,10 +39,11 @@ end # See http://docs.mangopay.com/api-references/payins/payindirectcard/ class Direct < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/card/#{CGI.escape(class_name.downcase)}" end end @@ -50,10 +52,11 @@ module PreAuthorized # See http://docs.mangopay.com/api-references/payins/preauthorized-payin/ class Direct < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/preauthorized/direct" end def self.create_pre_authorized_deposit_pay_in(params, idempotency_key = nil) @@ -66,10 +69,11 @@ module BankWire # See http://docs.mangopay.com/api-references/payins/payinbankwire/ class Direct < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/bankwire/direct" end end @@ -81,18 +85,20 @@ module DirectDebit # See http://docs.mangopay.com/api-references/payins/direct-debit-pay-in-web/ class Web < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/directdebit/#{CGI.escape(class_name.downcase)}" end end # See https://docs.mangopay.com/api-references/payins/direct-debit-pay-in-direct/ class Direct < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/directdebit/#{CGI.escape(class_name.downcase)}" end end @@ -103,24 +109,34 @@ # See https://docs.mangopay.com/api-references/payins/paypal-payin/ # # <b>DEPRECATED</b>: 'create' function is now deprecated. # Please use the 'create_v2' function - MangoPay::PayIn::PayPal::Web.create_new(params) class Web < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/paypal/#{CGI.escape(class_name.downcase)}" end def self.create_v2(params, idempotency_key = nil) MangoPay.request(:post, "#{MangoPay.api_path}/payins/payment-methods/paypal", params, {}, idempotency_key) end + + # Add tracking information to a PayPal PayIn (add the tracking number and carrier for LineItems shipments.) + # Caution – Tracking information cannot be edited + # You can’t modify the TrackingNumber, Carrier, or NotifyBuyer once added. + # You can only send a unique tracking number once. + def self.add_paypal_tracking_information(pay_in_id, params, idempotency_key = nil) + MangoPay.request(:put, "#{MangoPay.api_path}/payins/#{pay_in_id}/trackings", params, {}, idempotency_key) + end end end module Payconiq class Web < Resource include HTTPCalls::Create + def self.url(*) "#{MangoPay.api_path}/payins/payconiq/#{CGI.escape(class_name.downcase)}" end end