File: paypal.php

package info (click to toggle)
phabricator 0~git20190207-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 71,728 kB
  • sloc: php: 552,244; sql: 16,997; ansic: 3,619; yacc: 2,503; sh: 754; xml: 519; lex: 488; cpp: 221; python: 186; makefile: 177; sed: 66
file content (24 lines) | stat: -rwxr-xr-x 819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env php
<?php

require_once dirname(__FILE__).'/../__init_script__.php';

// NOTE: These credentials are global test credentials provided by PayPal.

$future = id(new PhutilPayPalAPIFuture())
  ->setHost('https://api-3t.sandbox.paypal.com/nvp')
  ->setAPIUsername('sdk-three_api1.sdk.com')
  ->setAPIPassword('QFZCWN5HZM8VBG7Q')
  ->setAPISignature('A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU');

$future->setRawPayPalQuery(
  'SetExpressCheckout',
  array(
    'PAYMENTREQUEST_0_AMT'            => '1.23',
    'PAYMENTREQUEST_0_CURRENCYCODE'   => 'USD',
    'RETURNURL'                       => 'http://www.example.com/?return=1',
    'CANCELURL'                       => 'http://www.example.com/?cancel=1',
    'PAYMENTREQUEST_0_PAYMENTACTION'  => 'Sale',
  ));

print_r($future->resolve());