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 | |
class CouponDemo_AutoGen_Model_Api2_Coupon extends Mage_Api2_Model_Resource | |
{ | |
} |
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=<callerID> | |
&PWD=<callerPswd> | |
&SIGNATURE=<callerSig> | |
&METHOD=DoExpressCheckoutPayment | |
&VERSION=93 | |
&TOKEN=<tokenValue> | |
&PAYERID=<payerID> # customer's unique PayPal ID | |
&PAYMENTREQUEST_0_PAYMENTACTION=SALE # payment type | |
&PAYMENTREQUEST_0_AMT=19.95 # transaction amount |
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
<?php | |
/* Coupon AutoGen REST API | |
* | |
* @category CouponDemo | |
* @package CouponDemo_AutoGen | |
* @author Chuck Hudson (used with permission). For more recipes, see Chuck's book http://shop.oreilly.com/product/0636920023968.do | |
*/ | |
class CouponDemo_AutoGen_Model_Api2_Coupon_Rest_Admin_V1 extends CouponDemo_AutoGen_Model_Api2_Coupon | |
{ |
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
<config> | |
<api2> | |
<resource_groups> | |
<autogen translate="title" module="CouponDemo_AutoGen"> | |
<title>CouponDemo API</title> | |
<sort_order>10</sort_order> | |
</autogen> | |
</resource_groups> | |
<resources> | |
<autogen translate="title" module="CouponDemo_AutoGen"> |
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
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<CouponDemo_AutoGen> | |
<version>0.1.0</version> | |
</CouponDemo_AutoGen> | |
</modules> | |
<global> | |
<models> | |
<autogen> |
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
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<CouponDemo_AutoGen> | |
<active>true</active> | |
<codePool>community</codePool> | |
</CouponDemo_AutoGen> | |
</modules> | |
</config> |
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
//download the complete php code sample from https://github.com/paypal/paypal-access | |
/** | |
* Get Access Token | |
* | |
* After the user is forwarded back to the application callback (defined in | |
* the application at devportal.x.com) and the code parameter is available on | |
* the query string, exchange the code parameter for an access token. | |
* | |
*/ |
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>" |