MCPcopy Create free account
hub / github.com/codecombat/codecombat / payment

Function payment

app/core/services/paypal.js:42–65  ·  view source on GitHub ↗
(data, actions)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

translateNameMethod · 0.80

Tested by

no test coverage detected