Skip to content
This repository was archived by the owner on Mar 21, 2020. It is now read-only.

Commit 5ce0b1d

Browse files
committed
fix invoice number
1 parent 613ae2f commit 5ce0b1d

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
amount="10.00"
99
currency="USD"
1010
:client="paypal"
11-
:dev="true">
11+
:dev="true"
12+
:invoiceNumber="'201705051001'">
1213
</SimplePayPal>
1314

1415
<h2>PayPal Advanced (Requires PayPal REST Integration)</h2>

src/components/SimplePayPal.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,20 @@
6767
transactions: []
6868
}
6969
70-
if (invoice !== null) {
71-
payment = Object.assign(payment, { invoiceNumber: invoice })
72-
}
73-
74-
payment.transactions.push({
70+
let transaction = {
7571
amount: {
7672
total: vue.amount,
7773
currency: vue.currency
7874
}
79-
})
75+
}
76+
77+
if (invoice !== null) {
78+
transaction = Object.assign(transaction, { 'invoice_number': invoice })
79+
}
8080
81-
return paypal.rest.payment.create(this.props.env, this.props.client, payment)
81+
return paypal.rest.payment.create(this.props.env, this.props.client, {
82+
transactions: [ transaction ]
83+
})
8284
},
8385
8486
// Display a "Pay Now" button rather than a "Continue" button

0 commit comments

Comments
 (0)