Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Stripe / Magento / PHP

[es] :: PHP :: Stripe / Magento / PHP

[ Pregleda: 1328 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

vanja71
PHP Developer
Beograd

Član broj: 257124
Poruke: 10
*.static.sbb.rs.

Sajt: www.WebDesign.co.rs


Profil

icon Stripe / Magento / PHP21.03.2013. u 13:35 - pre 134 meseci


Koristio sam Inchoo ekstenziju za povezivanje Magenta i Stripe-a. Inchoo komponenta je jednostavna i bazirana je na https://github.com/stripe/stripe-php. Kada testiram extenzij, ona radi bas kako treba.

Ali potreban mi je Stripe connect, zbog 'application_fee' odnosno provizije i tu nastaje problem.

Prema tutorialu stripe.com/docs/connect/oauth koristim https://gist.github.com/afeng/3507366

i dalje sve radi lepo.

Prema stripe.com/docs/connect/collecting-fees imamo sledeci kod :


// Get the credit card details submitted by the form

$token = $_POST['stripeToken'];

// Create the charge on Stripe's servers - this will charge the user's card
$charge = Stripe_Charge::create(array(
"amount" => 1000, // amount in cents
"currency" => "usd",
"card" => $token,
"description" => "[email protected]"),
"application_fee" => 123 // amount in cents
),
ACCESS_TOKEN // user's access token from the Stripe Connect flow
);

Ali ACCESS_TOKEN je problem,zato sto kad koristim onaj koji sam dobio u prethodnom koraku 'stripe.com/docs/connect/oauth'

dobijem gresku:

OAuth based requests must use card tokens from Stripe.js, but card details were directly provided.

Zasto i gde moram da koristim Stripe.js? Sve radi savrseno sa ovom bibliotekom do 'ACCESS_TOKEN'-a // user's access token from the Stripe Connect flow

Vec imam ACCESS_TOKEN

iz (stripe.com/docs/connect/oauth)
{
"token_type": "bearer",
"stripe_publishable_key": PUBLISHABLE_KEY,
"scope": "read_write",
"livemode": "false",
"stripe_user_id": USER_ID,
"refresh_token": REFRESH_TOKEN,
"access_token": ACCESS_TOKEN
}

Ovaj problem nije do magenta, vec negde gresim sa Stripe-om (i PHP-om).

Ako vec u ovom trenutku mora da se stavi Stripe.js (pise da mora, iako sve radi i bez njega do ovog trenutka), sta da radim sa njim???

Hvala
 
Odgovor na temu

357_97

Član broj: 53056
Poruke: 104
*.dynamic.sbb.rs.



+5 Profil

icon Re: Stripe / Magento / PHP21.03.2013. u 23:06 - pre 134 meseci
Nisam koristio Stripe ali mozda ovaj clanak (januar 2013) pomogne!
 
Odgovor na temu

[es] :: PHP :: Stripe / Magento / PHP

[ Pregleda: 1328 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.