Skip to content

Commit 27bda2f

Browse files
committed
Added item_list to samples [ci skip]
1 parent ec24b5e commit 27bda2f

File tree

4 files changed

+41
-7
lines changed

4 files changed

+41
-7
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ PayPal::SDK::REST.set_config(
101101
:postal_code => "43210",
102102
:country_code => "US" }}}]},
103103
:transactions => [{
104+
:item_list => {
105+
:items => [{
106+
:name => "item",
107+
:sku => "item",
108+
:price => "1",
109+
:currency => "USD",
110+
:quantity => 1 }]},
104111
:amount => {
105112
:total => "1.00",
106113
:currency => "USD" },

samples/payment/create_with_credit_card.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
# the above types and intent as 'sale'
1212
@payment = Payment.new({
1313
:intent => "sale",
14-
14+
1515
# ###Payer
1616
# A resource representing a Payer that funds a payment
1717
# Use the List of `FundingInstrument` and the Payment Method
1818
# as 'credit_card'
1919
:payer => {
2020
:payment_method => "credit_card",
21-
21+
2222
# ###FundingInstrument
2323
# A resource representing a Payeer's funding instrument.
2424
# Use a Payer ID (A unique identifier of the payer generated
2525
# and provided by the facilitator. This is required when
2626
# creating or using a tokenized funding instrument)
2727
# and the `CreditCardDetails`
2828
:funding_instruments => [{
29-
29+
3030
# ###CreditCard
3131
# A resource representing a credit card that can be
3232
# used to fund a payment.
@@ -38,7 +38,7 @@
3838
:cvv2 => "874",
3939
:first_name => "Joe",
4040
:last_name => "Shopper",
41-
41+
4242
# ###Address
4343
# Base Address used as shipping or billing
4444
# address in a payment. [Optional]
@@ -53,7 +53,16 @@
5353
# payment - what is the payment for and who
5454
# is fulfilling it.
5555
:transactions => [{
56-
56+
57+
# Item List
58+
:item_list => {
59+
:items => [{
60+
:name => "item",
61+
:sku => "item",
62+
:price => "1",
63+
:currency => "USD",
64+
:quantity => 1 }]},
65+
5766
# ###Amount
5867
# Let's you specify a payment amount.
5968
:amount => {

samples/payment/create_with_credit_card_token.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535
# is fulfilling it
3636
:transactions => [{
3737

38+
# Item List
39+
:item_list => {
40+
:items => [{
41+
:name => "item",
42+
:sku => "item",
43+
:price => "1",
44+
:currency => "USD",
45+
:quantity => 1 }]},
46+
3847
# ###Amount
3948
# Let's you specify a payment amount.
4049
:amount => {

samples/payment/create_with_paypal.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,23 @@
2727
# A transaction defines the contract of a
2828
# payment - what is the payment for and who
2929
# is fulfilling it.
30-
:transactions => [ {
30+
:transactions => [{
31+
32+
# Item List
33+
:item_list => {
34+
:items => [{
35+
:name => "item",
36+
:sku => "item",
37+
:price => "5",
38+
:currency => "USD",
39+
:quantity => 1 }]},
3140

3241
# ###Amount
3342
# Let's you specify a payment amount.
3443
:amount => {
3544
:total => "5",
3645
:currency => "USD" },
37-
:description => "This is the payment transaction description." } ] } )
46+
:description => "This is the payment transaction description." }]})
3847

3948
# Create Payment and return status
4049
if @payment.create

0 commit comments

Comments
 (0)