Set up one-time payments

DocsLimited

Last updated: Apr 10th, 8:25pm

To set up one-time payments using Apple Pay on the Web, integrate Apple Pay as a payment method on the checkout page. Refer to the Apple Pay Developer Documentation to learn more about adding Apple Pay as a payment option.

After buyers authorize the payment, set up your client-side code to invoke the createOrder function in your server-side code to create an order and capture the payment.

Create a new order and capture payment

To indicate Apple Pay as the payment method, include the apple_pay object in the payment_source of the POST v2/checkout/orders request body.

API endpoint:Create order

  1. Sample request
  2. Sample response
1curl -v -X POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/capture' \
2-H 'Content-Type: application/json' \
3-H 'Authorization: Bearer ' \
4-H 'PayPal-Request-Id: 123e4567-e89b-12d3-a456-426655440010' \
5-d '{
6 "intent": "CAPTURE",
7 "purchase_units": [
8 {
9 "reference_id": "REFID-000-1001",
10 "amount": {
11 "currency_code": "CAD",
12 "value": "10.00"
13 },
14 "payee": {
15 "email_address": "[email protected]"
16 },
17 "shipping": {
18 "name": {
19 "full_name": "Firstname Lastname"
20 },
21 "address": {
22 "address_line_1": "123 Main St",
23 "admin_area_2": "Anytown",
24 "admin_area_1": "CA",
25 "postal_code": "12345",
26 "country_code": "US"
27 }
28 },
29 "payment_instruction": {
30 "platform_fees": [
31 {
32 "amount": {
33 "currency_code": "CAD",
34 "value": "1.00"
35 },
36 "payee": {
37 "email_address": "[email protected]"
38 }
39 }
40 ],
41 "disbursement_mode": "INSTANT",
42 "payee_pricing_tier_id": "999ZAE"
43 }
44 }
45 ],
46 "payment_source": {
47 "apple_pay": {
48 "id": "DSF32432423FSDFS",
49 "name": "Firstname Lastname",
50 "email_address": "[email protected]",
51 "phone_number": {
52 "country_code": "1",
53 "national_number": "5555555555"
54 },
55 "decrypted_token": {
56 "transaction_amount": {
57 "currency_code": "USD",
58 "value": "10.00"
59 },
60 "tokenized_card": {
61 "number": "1111111111111111",
62 "expiry": "2022-02",
63 "billing_address": {
64 "address_line_1": "123 Main St",
65 "admin_area_2": "Anytown",
66 "admin_area_1": "CA",
67 "postal_code": "12345",
68 "country_code": "US"
69 }
70 },
71 "device_manufacturer_id": "040010030273",
72 "payment_data_type": "3DSECURE",
73 "payment_data": {
74 "cryptogram": "SaDA0Gw9cR37j8xrZP6VFCJpa",
75 "eci_indicator": "7"
76 }
77 }
78 }
79 }
80}'