This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>Testing a PayPal Payments Standard Button</title> | |
</head> | |
<body> | |
<h2>Buy Strings!</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// STEP 1: read POST data | |
// Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. | |
// Instead, read raw POST data from the input stream. | |
$raw_post_data = file_get_contents('php://input'); | |
$raw_post_array = explode('&', $raw_post_data); | |
$myPost = array(); | |
foreach ($raw_post_array as $keyval) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=merchant_user_name | |
&PWD=merchant_password | |
&SIGNATURE=merchant_signature | |
&METHOD=DoCapture | |
&VERSION=95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP Headers | |
------------ | |
-H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name_here" | |
-H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password_here" | |
-H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature_here" | |
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" | |
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" | |
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID | |
Endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://api.paypal.com/v1/identity/openidconnect/tokenservice \ | |
-u "<your_app_id>:<your_app_secret>" \ | |
-d "client_id=&grant_type=authorization_code&code=<code>&redirect_uri=<urlencoded_return_url>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP Headers | |
------------ | |
-H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name_here" | |
-H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password_here" | |
-H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature_here" | |
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" | |
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" | |
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID | |
Endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/******************************************************************** | |
File name: rest_test.php | |
Description: | |
A PHP test script that calls the Coupon AutoGen extension | |
to Magento's REST API. | |
The Coupon AutoGen API takes: | |
-- the rule ID of the "Generate Coupons" rule to execute | |
-- the number of coupon codes to generate | |
-- the length of each coupon code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s --insecure https://api-3t.sandbox.paypal.com/nvp -d | |
"USER=<Caller_ID> | |
&PWD=<Caller_Pswd> | |
&SIGNATURE=<Caller_Sig> | |
&METHOD=DoExpressCheckoutPayment | |
&VERSION=93 | |
&TOKEN=<Token> # TOKEN value returned from SetExpressCheckout | |
&PAYERID=<PayerID> # PAYERID value returned from GetExpressCheckoutDetails | |
&PAYMENTREQUEST_0_AMT=250 # first payment details | |
&PAYMENTREQUEST_0_CURRENCYCODE=USD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=insert_merchant_user_name_here | |
&PWD=insert_merchant_password_here | |
&SIGNATURE=insert_merchant_signature_value_here | |
&METHOD=CreateBillingAgreement | |
&VERSION=86 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//download the complete java code sample from https://github.com/paypal/paypal-access | |
/** | |
* Gets Access token by going to token service. Code is left blank so that user can fill it up manually. | |
* | |
* @return - Access token | |
*/ | |
private static String getAccessToken(String authorizationCode) { | |
StringBuilder tokenUrl = new StringBuilder( | |
"https://api.paypal.com/v1/identity/openidconnect/tokenservice"); |
NewerOlder