(data, actions)
| 40 | commit: true, |
| 41 | // payment() is called when the button is clicked |
| 42 | payment (data, actions) { |
| 43 | // Make a call to the REST api to create the payment |
| 44 | onPaymentStarted() |
| 45 | const paymentData = { |
| 46 | payment: { |
| 47 | transactions: [ |
| 48 | { |
| 49 | amount: { total: product.adjustedPriceStringNoSymbol(), currency: 'USD' }, |
| 50 | item_list: { |
| 51 | items: [{ |
| 52 | sku: product.id, |
| 53 | name: product.translateName(), |
| 54 | quantity: 1, |
| 55 | price: product.adjustedPriceStringNoSymbol(), |
| 56 | currency: 'USD' |
| 57 | }] |
| 58 | }, |
| 59 | description // Is this what shows up on their credit card, or so? TODO: Translate? |
| 60 | } |
| 61 | ] |
| 62 | } |
| 63 | } |
| 64 | return actions.payment.create(paymentData) |
| 65 | }, |
| 66 | // onAuthorize() is called when the buyer approves the payment |
| 67 | onAuthorize (data, actions) { |
| 68 | // Pass the payment info along, so we can tell the server to execute it |
nothing calls this directly
no test coverage detected