Jump to content

Paypal CC End Point


Recommended Posts

This is just a guess, but if you look in \projectfolder\vendors\components\gateways\nonmerchant\paypal_payments_standard\paypal_payments_standard.php you will find 

PaypalPaymentsStandard extends NonmerchantGateway

It looks like you are required to have a Blesta invoice to pay to use this gateway, so you will probably need to generate an invoice first.

On line 232 there is buildProcess where I found this information. It looks like it's building the request to paypal. Maybe someone else can shed some more light.

Link to comment
Share on other sites

I found this -

So I tried accessing an endpoint via the attached image method in postman and it looks like we are on the right track. Looks like the arguments are as follows -

"contact_info" => $contact_info, "amount" => $amount, "currency" => $currency, "invoice_amounts" => $invoice_amounts, "options" => $options, "gateway_id" => $gateway_id

This method and docblock can be found in \components\gateway_payments\gateway_payments.php

     * Returns an array of HTML markup used to render capture and pay requests for non-merchant gateways
     * @param array $contact_info An array of contact info including:
     *  - id The contact ID
     *  - client_id The ID of the client this contact belongs to
     *  - user_id The user ID this contact belongs to (if any)
     *  - contact_type The type of contact
     *  - contact_type_id The ID of the contact type
     *  - first_name The first name on the contact
     *  - last_name The last name on the contact
     *  - title The title of the contact
     *  - company The company name of the contact
     *  - address1 The address 1 line of the contact
     *  - address2 The address 2 line of the contact
     *  - city The city of the contact
     *  - state An array of state info including:
     *      - code The 2 or 3-character state code
     *      - name The local name of the country
     *  - country An array of country info including:
     *      - alpha2 The 2-character country code
     *      - alpha3 The 3-cahracter country code
     *      - name The english name of the country
     *      - alt_name The local name of the country
     *  - zip The zip/postal code of the contact
     * @param float $amount The amount to charge this contact
     * @param string $currency The current to charge
     * @param array $invoice_amounts An array of invoices, each containing:
     *  - id The ID of the invoice being processed
     *  - amount The amount being processed for this invoice (which is included in $amount)
     * @param array $options An array of options including:
     *  - description The Description of the charge
     *  - return_url The URL to redirect users to after a successful payment
     *  - recur An array of recurring info including:
     *      - start_date The date/time in UTC that the recurring payment begins
     *      - amount The amount to recur
     *      - term The term to recur
     *      - period The recurring period (day, week, month, year, onetime) used
     *        in conjunction with term in order to determine the next recurring payment
     * @param int $gateway_id The ID of the nonmerchant gateway to fetch,
     *  if null will return all nonmerchant gateways for the currency
     * @return array An array of HTML, indexed by the gateway name



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...