yukon 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05faf8ee84fe24ecf2976509d6185131261f5050
4
- data.tar.gz: d65b2936bc9bba5c9cc79c49acb5776c9e2ac6cf
3
+ metadata.gz: 0ceeea4b08c9631e4ef0e84193558995177a1f14
4
+ data.tar.gz: 85568c60dac14bbbba12bfc17ada4a9642d273bb
5
5
  SHA512:
6
- metadata.gz: 37c9d223ac079a5cb37c3b0c65f41c2533673b9266acc617c41456d65b75fb274f05e9ee60b527474a19558e79df5383cd387fa47964ee1dfded915a973fbbb7
7
- data.tar.gz: 0e5faca7b71745640f3a1fa2082bff7770981faa153ea4725852c9af361866d16e592b038b81b40904498c481972ac00ccd710e9644cbb9a535d362e060088db
6
+ metadata.gz: c576b606ba24b6f416f26d1a2bcef39bf1a2f7897eb262b11f0bb7d4f421394235a19c5fb6560fe5d15e51d7e3c0942b2b2c4d722b18b567762db29daf790191
7
+ data.tar.gz: 932a6ea1b7d0c895c8634de54d67c06f5f5c40166357919f39987196c6a6be81fedbd95616fc76a3fa21e53bac518236bcc95a667224b223564059cb1669e871
data/bin/console CHANGED
@@ -3,6 +3,9 @@
3
3
  require "bundler/setup"
4
4
  require "yukon"
5
5
 
6
+ require_relative '../lib/yukon/payment_processor'
7
+ require_relative '../lib/yukon/payment_gateway'
8
+
6
9
  # You can add fixtures and/or initialization code here to make experimenting
7
10
  # with your gem easier. You can also use a different console, if you like.
8
11
 
@@ -10,6 +13,8 @@ require "yukon"
10
13
  # require "pry"
11
14
  # Pry.start
12
15
 
16
+ include Yukon
17
+
13
18
  Yukon.configuration do |config|
14
19
  config.login = 'jb-us-seller_api1.paypal.com'
15
20
  config.password = 'WX4WTU3S8MY44S7F'
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-3t.sandbox.paypal.com/2.0/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |-
9
+ <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xmlns:n1="urn:ebay:apis:eBLBaseComponents" env:mustUnderstand="0"><n1:Credentials><n1:Username>jb-us-seller_api1.paypal.com</n1:Username><n1:Password>WX4WTU3S8MY44S7F</n1:Password><n1:Subject>sell_1342421142_biz@gmail.com</n1:Subject><n1:Signature>AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy</n1:Signature></n1:Credentials></RequesterCredentials></env:Header><env:Body><SetExpressCheckoutReq xmlns="urn:ebay:api:PayPalAPI">
10
+ <SetExpressCheckoutRequest xmlns:n2="urn:ebay:apis:eBLBaseComponents">
11
+ <n2:Version>72</n2:Version>
12
+ <n2:SetExpressCheckoutRequestDetails>
13
+ <n2:ReturnURL>http://www.rubyplus.com</n2:ReturnURL>
14
+ <n2:CancelURL>http://www.rubyplus.com/about</n2:CancelURL>
15
+ <n2:ReqBillingAddress>0</n2:ReqBillingAddress>
16
+ <n2:NoShipping>0</n2:NoShipping>
17
+ <n2:AddressOverride>0</n2:AddressOverride>
18
+ <n2:SolutionType>Sole</n2:SolutionType>
19
+ <n2:LandingPage>Billing</n2:LandingPage>
20
+ <n2:PaymentDetails>
21
+ <n2:OrderTotal currencyID="USD">2.00</n2:OrderTotal>
22
+ <n2:Custom>custom</n2:Custom>
23
+ <n2:ButtonSource>ActiveMerchant</n2:ButtonSource>
24
+ <n2:PaymentAction>Sale</n2:PaymentAction>
25
+ </n2:PaymentDetails>
26
+ </n2:SetExpressCheckoutRequestDetails>
27
+ </SetExpressCheckoutRequest>
28
+ </SetExpressCheckoutReq>
29
+ </env:Body></env:Envelope>
30
+ headers:
31
+ Content-Type:
32
+ - application/x-www-form-urlencoded
33
+ Accept-Encoding:
34
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
35
+ Accept:
36
+ - "*/*"
37
+ User-Agent:
38
+ - Ruby
39
+ response:
40
+ status:
41
+ code: 200
42
+ message: OK
43
+ headers:
44
+ Date:
45
+ - Sat, 29 Aug 2015 04:00:40 GMT
46
+ Server:
47
+ - Apache
48
+ Connection:
49
+ - close
50
+ Content-Length:
51
+ - '1788'
52
+ Set-Cookie:
53
+ - X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
54
+ - X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dappdispatcher_apit%26TIME%3D1747902805;
55
+ domain=.paypal.com; path=/; Secure; HttpOnly
56
+ Content-Type:
57
+ - text/xml; charset=utf-8
58
+ body:
59
+ encoding: UTF-8
60
+ string: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
61
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
62
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
63
+ xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
64
+ xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
65
+ xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes"
66
+ xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"><SOAP-ENV:Header><Security
67
+ xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></Security><RequesterCredentials
68
+ xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"><Credentials
69
+ xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"><Username
70
+ xsi:type="xs:string"></Username><Password xsi:type="xs:string"></Password><Signature
71
+ xsi:type="xs:string"></Signature><Subject xsi:type="xs:string"></Subject></Credentials></RequesterCredentials></SOAP-ENV:Header><SOAP-ENV:Body
72
+ id="_0"><SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI"><Timestamp
73
+ xmlns="urn:ebay:apis:eBLBaseComponents">2015-08-29T04:00:41Z</Timestamp><Ack
74
+ xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack><CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">71d59036f1f91</CorrelationID><Version
75
+ xmlns="urn:ebay:apis:eBLBaseComponents">72</Version><Build xmlns="urn:ebay:apis:eBLBaseComponents">000000</Build><Token
76
+ xsi:type="ebl:ExpressCheckoutTokenType">EC-6SV390482G2024348</Token></SetExpressCheckoutResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
77
+ http_version:
78
+ recorded_at: Sat, 29 Aug 2015 04:00:41 GMT
79
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,82 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-3t.sandbox.paypal.com/2.0/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |-
9
+ <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xmlns:n1="urn:ebay:apis:eBLBaseComponents" env:mustUnderstand="0"><n1:Credentials><n1:Username>bogus</n1:Username><n1:Password>bogus</n1:Password><n1:Subject>sell_1342421142_biz@gmail.com</n1:Subject><n1:Signature>bogus</n1:Signature></n1:Credentials></RequesterCredentials></env:Header><env:Body><SetExpressCheckoutReq xmlns="urn:ebay:api:PayPalAPI">
10
+ <SetExpressCheckoutRequest xmlns:n2="urn:ebay:apis:eBLBaseComponents">
11
+ <n2:Version>72</n2:Version>
12
+ <n2:SetExpressCheckoutRequestDetails>
13
+ <n2:ReturnURL>http://www.rubyplus.com</n2:ReturnURL>
14
+ <n2:CancelURL>http://www.rubyplus.com/about</n2:CancelURL>
15
+ <n2:ReqBillingAddress>0</n2:ReqBillingAddress>
16
+ <n2:NoShipping>0</n2:NoShipping>
17
+ <n2:AddressOverride>0</n2:AddressOverride>
18
+ <n2:SolutionType>Sole</n2:SolutionType>
19
+ <n2:LandingPage>Billing</n2:LandingPage>
20
+ <n2:PaymentDetails>
21
+ <n2:OrderTotal currencyID="USD">2.00</n2:OrderTotal>
22
+ <n2:Custom>custom</n2:Custom>
23
+ <n2:ButtonSource>ActiveMerchant</n2:ButtonSource>
24
+ <n2:PaymentAction>Sale</n2:PaymentAction>
25
+ </n2:PaymentDetails>
26
+ </n2:SetExpressCheckoutRequestDetails>
27
+ </SetExpressCheckoutRequest>
28
+ </SetExpressCheckoutReq>
29
+ </env:Body></env:Envelope>
30
+ headers:
31
+ Content-Type:
32
+ - application/x-www-form-urlencoded
33
+ Accept-Encoding:
34
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
35
+ Accept:
36
+ - "*/*"
37
+ User-Agent:
38
+ - Ruby
39
+ response:
40
+ status:
41
+ code: 200
42
+ message: OK
43
+ headers:
44
+ Date:
45
+ - Sat, 29 Aug 2015 03:57:25 GMT
46
+ Server:
47
+ - Apache
48
+ Connection:
49
+ - close
50
+ Content-Length:
51
+ - '2056'
52
+ Set-Cookie:
53
+ - X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
54
+ - X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dappdispatcher_apit%26TIME%3D2771247445;
55
+ domain=.paypal.com; path=/; Secure; HttpOnly
56
+ Content-Type:
57
+ - text/xml; charset=utf-8
58
+ body:
59
+ encoding: UTF-8
60
+ string: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
61
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
62
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
63
+ xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
64
+ xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
65
+ xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes"
66
+ xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"><SOAP-ENV:Header><Security
67
+ xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></Security><RequesterCredentials
68
+ xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"><Credentials
69
+ xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"><Username
70
+ xsi:type="xs:string"></Username><Password xsi:type="xs:string"></Password><Signature
71
+ xsi:type="xs:string"></Signature><Subject xsi:type="xs:string"></Subject></Credentials></RequesterCredentials></SOAP-ENV:Header><SOAP-ENV:Body
72
+ id="_0"><SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI"><Timestamp
73
+ xmlns="urn:ebay:apis:eBLBaseComponents">2015-08-29T03:57:25Z</Timestamp><Ack
74
+ xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack><CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">46760d0b19da</CorrelationID><Errors
75
+ xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType"><ShortMessage
76
+ xsi:type="xs:string">Security error</ShortMessage><LongMessage xsi:type="xs:string">Security
77
+ header is not valid</LongMessage><ErrorCode xsi:type="xs:token">10002</ErrorCode><SeverityCode
78
+ xmlns="urn:ebay:apis:eBLBaseComponents">Error</SeverityCode></Errors><Version
79
+ xmlns="urn:ebay:apis:eBLBaseComponents">72</Version><Build xmlns="urn:ebay:apis:eBLBaseComponents">000000</Build></SetExpressCheckoutResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
80
+ http_version:
81
+ recorded_at: Sat, 29 Aug 2015 03:57:25 GMT
82
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,23 @@
1
+ module Yukon
2
+ class CredentialsChecker
3
+
4
+ def self.check(login, password, signature)
5
+ Yukon.configuration do |config|
6
+ config.login = login
7
+ config.password = password
8
+ config.signature = signature
9
+ config.mode = :test
10
+ end
11
+
12
+ payment_processor = PaymentProcessor.new('sell_1342421142_biz@gmail.com')
13
+ response = payment_processor.set_express_checkout(200,
14
+ '127.0.0.1',
15
+ 'http://www.rubyplus.com',
16
+ 'http://www.rubyplus.com/about',
17
+ 'custom')
18
+ response.success?
19
+ end
20
+
21
+ end
22
+
23
+ end
@@ -6,7 +6,7 @@ module Yukon
6
6
 
7
7
  # Pre-requisite - Rails app must configure the login, password and signature in config/initializers/yukon.rb
8
8
  #
9
- # Argument : seller's email address
9
+ # Argument : seller_email : Email address of the seller
10
10
  #
11
11
  # Returns ActiveMerchant::Billing::PaypalExpressGateway object
12
12
  def self.create(seller_email)
@@ -14,7 +14,6 @@ module Yukon
14
14
  # ip : Buyer IP address
15
15
  # return_url : URL to return after completing the purchase
16
16
  # cancel_return_url : URL to return if purchase is cancelled
17
- # seller_email : Email address of the seller
18
17
  # notify_url : IPN notification URL (optional)
19
18
  # custom : custom variable
20
19
  #
data/lib/yukon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yukon
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yukon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bala Paranj
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-26 00:00:00.000000000 Z
11
+ date: 2015-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -128,10 +128,13 @@ files:
128
128
  - bin/setup
129
129
  - config/paypal-sample.yml
130
130
  - config/paypal.yml
131
+ - fixtures/vcr_cassettes/correct_credentials.yml
132
+ - fixtures/vcr_cassettes/credentials.yml
131
133
  - fixtures/vcr_cassettes/payments.yml
132
134
  - fixtures/vcr_cassettes/purchase.yml
133
135
  - fixtures/vcr_cassettes/step2.yml
134
136
  - lib/yukon.rb
137
+ - lib/yukon/credentials_checker.rb
135
138
  - lib/yukon/payment_gateway.rb
136
139
  - lib/yukon/payment_processor.rb
137
140
  - lib/yukon/version.rb