Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ adyen.checkout.version = 50
- payment_methods
- payments
- payments.details
- payment_links

**checkout utility:**
- origin_keys
Expand Down
17 changes: 17 additions & 0 deletions docs/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ <h2 id="availablemethods">Available methods</h2>
<li>payments</li>

<li>payments.details</li>

<li>payment_links</li>
</ul>

<h2 id="authentication">Authentication</h2>
Expand Down Expand Up @@ -99,7 +101,22 @@ <h2 id="usagecheckoutapi">Usage - Checkout API</h2>

<p>A successful call to payment_methods will return a list of supported payment methods along with redirect URL's so that you can send your shoppers directly to the issuer's site without losing control of front-end styling / logic.</p>

You can also create a link to Adyen's hosted payment form:

<pre><code class="ruby language-ruby">response = adyen.checkout.payment_links('{
"amount": {
"value": 1500,
"currency": "EUR"
},
"countryCode": "US",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"reference": "YOUR_REFERENCE"
}')</code></pre>

<p>A successful call to payment_links will return a url, which directs a user to Adyen's hosted payment form.</p>
</section>


<footer>
<p>This project is maintained by <a href="https://github.com/Adyen">Adyen</a></p>
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
Expand Down
3 changes: 2 additions & 1 deletion lib/adyen/services/checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def initialize(client, version = DEFAULT_VERSION)
service = 'Checkout'
method_names = [
:payment_methods,
:payment_session
:payment_session,
:payment_links
]

super(client, version, service, method_names)
Expand Down
1 change: 1 addition & 0 deletions spec/checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
# format is defined in spec_helper
test_sets = [
["payment_session", "publicKeyToken", "8115054323780109"],
["payment_links", "url", "https://checkoutshopper-test.adyen.com"],
["payments", "resultCode", "Authorised"]
]

Expand Down
9 changes: 9 additions & 0 deletions spec/mocks/requests/Checkout/payment_links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"amount": {
"currency": "USD",
"value": 1000
},
"countryCode": "US",
"merchantAccount": "TestMerchant",
"reference": "Merchant Reference"
}
9 changes: 9 additions & 0 deletions spec/mocks/responses/Checkout/payment_links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"amount": {
"currency": "USD",
"value": 1000
},
"expiresAt": "2019-12-14T10:05:29Z",
"reference": "Merchant Reference",
"url": "https://checkoutshopper-test.adyen.com"
}
1 change: 1 addition & 0 deletions spec/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
expect(described_class.action_for_method_name(:origin_keys)).to eq 'originKeys'
expect(described_class.action_for_method_name(:payment_methods)).to eq 'paymentMethods'
expect(described_class.action_for_method_name(:payment_session)).to eq 'paymentSession'
expect(described_class.action_for_method_name(:payment_links)).to eq 'paymentLinks'
expect(described_class.action_for_method_name(:refund)).to eq 'refund'
expect(described_class.action_for_method_name(:store_detail)).to eq 'storeDetail'
expect(described_class.action_for_method_name(:store_detail_and_submit_third_party)).to eq 'storeDetailAndSubmitThirdParty'
Expand Down