I hereby claim:
- I am saranyan on github.
- I am saranyan (https://keybase.io/saranyan) on keybase.
- I have a public key whose fingerprint is 51E0 7B3A 9317 6503 722C 2648 8D6B 045B ECCC C1B5
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
//Full source code is available at https://github.com/saranyan/PayPal-Code-Examples | |
//--------------------------------------------------------------------- | |
//Step 1 - Initialize. | |
//Do this before anything else. | |
public void initLibrary() { | |
PayPal pp = PayPal.getInstance(); | |
if (pp == null) { | |
// This is the main initialization call that takes in your Context, |
@namespace("com.x.service.catalog") | |
/** | |
* Protocol for the Catalog Service | |
* ================================ | |
*/ | |
protocol CatalogService { | |
//----------------------------------------------------------------------------------------------------- | |
// Request & Response: Product Types |
java -jar avro-tools-1.5.4.jar idl catalog.avdl /tmp/catalog.avpr |
{ | |
"protocol" : "CatalogService", | |
"namespace" : "com.x.service.catalog", | |
"types" : [ { | |
"type" : "record", | |
"name" : "GetProductTypesMessage", | |
"fields" : [ { | |
"name" : "locale", | |
"type" : [ "null", "string" ] | |
} ], |
CONTRACT_PROTOCOL_JSON = <<-EOS | |
{ | |
"protocol" : "CatalogService", | |
"namespace" : "com.x.service.catalog", | |
"types" : [ { | |
"type" : "record", | |
"name" : "GetProductTypesMessage", | |
"fields" : [ { | |
"name" : "locale", | |
"type" : [ "null", "string" ] |
if Rails.env.production? | |
PAYPAL_ACCOUNT = 'production@gmail.com' | |
else | |
PAYPAL_ACCOUNT = 'development@gmail.com' | |
ActiveMerchant::Billing::Base.mode = :test | |
end |
#from http://www.ruby-forum.com/topic/163331#817338 | |
#this code will also work if you are not using active merchant. | |
if request.post? | |
#new | |
@params = params | |
@params[:cmd] = "_notify-validate" | |
@params.delete(:action) | |
@params.delete(:controller) | |
url = URI.parse("https://www.paypal.com/cgi-bin/webscr") |
#include <stdio.h> | |
#include "mylibrary.h" | |
int main(){ | |
char x[10]; | |
double d = 10.0; | |
double *dp = &d; | |
double dd[3]; | |
printf("tf0 - %lf\n",calculate_something(1,2.33)); |
#include "mylibrary.h" | |
#include <stdio.h> | |
double calculate_something(int a, float b) | |
{ | |
return a+b; | |
} | |
const char* test_function_1(const char *w) | |
{ |