forked from dkd/paymill-ruby
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from l0ck3/master
Adds code samples for the API Reference
- Loading branch information
Showing
60 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ | |
*.a | ||
mkmf.log | ||
spec/cassettes | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill.api_key = "<YOUR_PRIVATE_KEY>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Paymill::Client.create( | ||
email: 'lovely-client@example.com', | ||
description: 'Lovely Client' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Client.find('client_88a388d9dd48f86c3136') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Client.all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
client = Paymill::Client.find('client_88a388d9dd48f86c3136') | ||
client.delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
client = Paymill::Client.find('client_88a388d9dd48f86c3136') | ||
client.email = 'lovely-client@example.com' | ||
client.description = 'My Lovely Client' | ||
client.update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Paymill::Offer.create( | ||
amount: 4200, | ||
currency: 'EUR', | ||
interval: '1 MONTH', | ||
name: 'Nerd Special', | ||
trial_period_days: 0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Offer.find('offer_40237e20a7d5a231d99b') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Offer.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# with subscriptions: | ||
offer = Paymill::Offer.find('offer_40237e20a7d5a231d99b') | ||
offer.delete_with_subscriptions() | ||
|
||
# without subscriptions: | ||
offer = Paymill::Offer.find('offer_40237e20a7d5a231d99b') | ||
offer.delete_without_subscriptions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
offer = Paymill::Offer.find('offer_40237e20a7d5a231d99b') | ||
|
||
offer.name = 'Extended Special' | ||
offer.interval = '1 MONTH' | ||
offer.currency = 'USD' | ||
offer.amount = '3333' | ||
|
||
offer.update( update_subscriptions: true ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Payment.create( token: '098f6bcd4621d373cade4e832627b4f6' ) |
4 changes: 4 additions & 0 deletions
4
samples/payments/create_new_credit_card_payment_with_token_and_client.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Paymill::Payment.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
client: 'client_88a388d9dd48f86c3136' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Payment.create( token: '12a46bcd462sd3r3care4e8336ssb4f5' ) |
4 changes: 4 additions & 0 deletions
4
samples/payments/create_new_debit_payment_with_token_and_client.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Paymill::Payment.create( | ||
token: '12a46bcd462sd3r3care4e8336ssb4f5', | ||
client: 'client_88a388d9dd48f86c3136' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not yet implemented |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Payment.find( 'pay_3af44644dd6d25c820a8' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Payment.all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
payment = Paymill::Payment.find( 'pay_ea98515b29437b046207ea45' ) | ||
payment.delete |
8 changes: 8 additions & 0 deletions
8
samples/preauthorizations/create_new_preauthorization_with_payment.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
payment = Paymill::Payment.create(token: '098f6bcd4621d373cade4e832627b4f6') | ||
|
||
Paymill::Preauthorization.create( | ||
payment: payment.id, | ||
amount: 4200, | ||
currency: 'EUR', | ||
description: 'description example' | ||
) |
6 changes: 6 additions & 0 deletions
6
samples/preauthorizations/create_new_preauthorization_with_token.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Paymill::Preauthorization.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
amount: 4200, | ||
currency: 'EUR', | ||
description: 'description example' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Preauthorization.find('preauth_31eb90495837447f76b7') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Preauthorization.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
preauthorization = Paymill::Preauthorization.find('preauth_31eb90495837447f76b7') | ||
preauthorization.delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
transaction = Paymill::Transaction.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
amount: 4200, | ||
currency: 'USD' | ||
) | ||
|
||
Paymill::Refund.create( | ||
transaction, | ||
amount: 4200, | ||
description: 'Sample Description' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Refund.find('refund_87bc404a95d5ce616049') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Refund.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.cancel() |
15 changes: 15 additions & 0 deletions
15
samples/subscriptions/create_new_subscription_with_an_offer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
payment = Paymill::Payment.create(token: '098f6bcd4621d373cade4e832627b4f6') | ||
offer = Paymill::Offer.create( | ||
amount: 3333, | ||
currency: 'EUR', | ||
interval: '1 WEEK', | ||
name: 'Nerd Special', | ||
trial_period_days: 30 | ||
) | ||
|
||
Paymill::Subscription.create( | ||
payment: payment, | ||
offer: offer, | ||
period_of_validity: '2 YEAR', | ||
start_at: 2.days.from_now | ||
) |
19 changes: 19 additions & 0 deletions
19
samples/subscriptions/create_new_subscription_with_an_offer_and_different_values.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
payment = Paymill::Payment.create(token: '098f6bcd4621d373cade4e832627b4f6') | ||
offer = Paymill::Offer.create( | ||
amount: 4200, | ||
currency: 'EUR', | ||
interval: '1 MONTH', | ||
name: 'Nerd Special', | ||
trial_period_days: 30 | ||
) | ||
|
||
Paymill::Subscription.create( | ||
payment: payment, | ||
offer: offer, | ||
amount: 3000, | ||
currency: 'EUR', | ||
interval: '1 week, monday', | ||
name: 'Example Subscription', | ||
period_of_validity: '2 YEAR', | ||
start_at: 2.days.from_now | ||
) |
13 changes: 13 additions & 0 deletions
13
samples/subscriptions/create_new_subscription_without_an_offer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
client = Paymill::Client.create(email: 'client@example.com') | ||
payment = Paymill::Payment.create(token: '098f6bcd4621d373cade4e832627b4f6', client: client) | ||
|
||
Paymill::Subscription.create( | ||
payment: payment, | ||
client: client, | ||
name: 'Example Subscription', | ||
amount: 3000, | ||
currency: 'EUR', | ||
interval: '1 week,monday', | ||
period_of_validity: '2 YEAR', | ||
start_at: 2.days.from_now | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.remove() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Subscription.find("sub_dc180b755d10da324864") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Subscription.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pause: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.pause | ||
|
||
#play: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.play |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.payment = 'pay_95ba26ba2c613ebb0ca8' | ||
subscription.currency = 'USD' | ||
subscription.interval = '1 month,friday' | ||
subscription.name = 'Changed Subscription' | ||
subscription.trial_end = false | ||
subscription.update | ||
|
||
# for limit / unlimit use | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.unlimit | ||
subscription.limit('12 MONTH') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#amount temporary: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.update_amount_once(1234) | ||
|
||
#amount permanently: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
subscription.update_amount_permanently(1234) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#offer with no refund and unchanged capture date: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
offer = Offer.create(name: 'Foo', amount: 4990, currency: 'EUR', interval: '2 WEEK') | ||
subscription.update_offer_without_changes(offer) | ||
|
||
#offer with refund and unchanged capture date: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
offer = Offer.create(name: 'Foo', amount: 4990, currency: 'EUR', interval: '2 WEEK') | ||
subscription.update_offer_with_refund(offer) | ||
|
||
#offer with refund and capture date: | ||
subscription = Paymill::Subscription.find('sub_dea86e5c65b2087202e3') | ||
offer = Offer.create(name: 'Foo', amount: 4990, currency: 'EUR', interval: '2 WEEK') | ||
subscription.update_offer_with_refund_and_capture_date(offer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Paymill::Transaction.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
amount: 4200, currency: 'EUR', | ||
description: 'Test Transaction', | ||
fee_amount: 4200, | ||
fee_payment: 'pay_a818b847db6ce5ff636f', | ||
fee_currency: 'EUR' | ||
) |
12 changes: 12 additions & 0 deletions
12
samples/transactions/create_new_transaction_with_client_and_payment.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
client = Paymill::Client.create(email: 'mail@example.com') | ||
payment = Paymill::Payment.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
client: client | ||
) | ||
|
||
Paymill::Transaction.create( | ||
payment: payment, | ||
client: client, | ||
amount: 4200, | ||
currency: 'EUR' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
payment = Paymill::Payment.create(token: '098f6bcd4621d373cade4e832627b4f6') | ||
transaction = Paymill::Transaction.create( | ||
payment: payment, | ||
amount: 4200, | ||
currency: 'EUR', | ||
description: 'Test Transaction' | ||
) |
10 changes: 10 additions & 0 deletions
10
samples/transactions/create_new_transaction_with_preauthorization.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
preauthorization = Paymill::Preauthorization.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
amount: 4200, | ||
currency: 'EUR' | ||
) | ||
transaction = Transaction.create( | ||
preauthorization: preauthorization, | ||
amount: 4200, | ||
currency: 'EUR' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Paymill::Transaction.create( | ||
token: '098f6bcd4621d373cade4e832627b4f6', | ||
amount: 4200, | ||
currency: 'EUR', | ||
description: 'Test Transaction' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Transaction.find('tran_023d3b5769321c649435') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Transaction.find('tran_023d3b5769321c649435') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Transaction.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
transaction = Paymill::Transaction.find('tran_023d3b5769321c649435') | ||
transaction.description = 'My updated transaction description' | ||
transaction.update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Paymill::Webhook.create( | ||
email: 'webhook@example.com', | ||
event_types: ['transaction.succeeded', 'transaction.failed'], | ||
active: false | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Paymill::Webhook.create( | ||
url: 'http://example.com', | ||
event_types: ['transaction.succeeded', 'transaction.failed'] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Not implemented yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Paymill::Webhook.find('hook_40237e20a7d5a231d99b') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
webhook = Paymill::Webhook.find(active_webhook_id) | ||
webhook.delete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
webhook = Paymill::Webhook.find(active_webhook_id) | ||
webhook.email = 'mail@example.com' | ||
webhook.update() |