خرید بک لینک

Vote count: 0

I get the following response from Paypal after a successful transaction:

array (size=37)
  'payer_email' => string '[email protected]' (length=27)
  'payer_id' => string 'CM3HZRBZPR7ZS' (length=13)
  'payer_status' => string 'VERIFIED' (length=8)
  'first_name' => string 'First' (length=6)
  'last_name' => string 'Surname' (length=4)
  'address_name' => string 'xxxxxxx' (length=11)
  'address_street' => string 'xxxxxx' (length=14)
  'address_city' => string 'xxxxxx' (length=13)
  'address_state' => string 'xxxxxx' (length=13)
  'address_country_code' => string 'GB' (length=2)
  'address_zip' => string 'xxxxx' (length=7)
  'residence_country' => string 'GB' (length=2)
  'txn_id' => string '1NL36739Y22912102' (length=17)
  'mc_currency' => string 'GBP' (length=3)
  'mc_fee' => string '18.56' (length=5)
  'mc_gross' => string '540.00' (length=6)
  'protection_eligibility' => string 'ELIGIBLE' (length=8)
  'payment_fee' => string '18.56' (length=5)
  'payment_gross' => string '540.00' (length=6)
  'payment_status' => string 'Completed' (length=9)
  'payment_type' => string 'instant' (length=7)
  'item_name1' => string 'Front Row Seats' (length=15)
  'item_number1' => string '27' (length=2)
  'quantity1' => string '4' (length=1)
  'mc_gross_1' => string '480.00' (length=6)
  'item_name2' => string 'Middle seats' (length=12)
  'item_number2' => string '27' (length=2)
  'quantity2' => string '2' (length=1)
  'mc_gross_2' => string '60.00' (length=5)
  'num_cart_items' => string '2' (length=1)
  'txn_type' => string 'cart' (length=4)
  'payment_date' => string '2017-05-15T12:59:36Z' (length=20)
  'business' => string 'xxxxxxxxx' (length=21)
  'receiver_id' => string '5RV8VG77C2SCC' (length=13)
  'notify_version' => string 'UNVERSIONED' (length=11)
  'custom' => string '2' (length=1)
  'verify_sign' => string 'AFcWxV21C7fd0v3bYYYRCpSSRl31AI1bmOJ-4coNEpEu0juBQ7wxRWzV' (length=56)

How can I loop over the number of items from this response? I would expect a better structured response but this PayPal.

Any Ideas?

My code for the success function:

    public function actionPaypalSuccess()
        {
            $request = Yii::$app->request;
            $params = $request->bodyParams;

            // SUCCESS
            if(isset( $params['payment_status']) && 
                 $params['payment_status'] == 'Completed'){

                    // loop goes here

            }
      }
asked 26 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 25 ارديبهشت 1396 ساعت: 20:20

صفحه بندی