示例#1
0
    //Payment intent. Must be set to sale for immediate payment, authorize to authorize a payment for capture later, or order to create an order. Required.
    protected $payer;
    //Source of the funds for this payment represented by a PayPal account or a direct credit card. Required.
    protected $state;
    //Payment state. Must be one of the following: created; approved; failed; pending; canceled; expired, or in_progress.
    protected $cancelUrl;
    //Set of redirect URLs you provide only for PayPal-based payments. Returned only when the payment is in created state. Required for PayPal payments.
    protected $returnUrl;
    //Set of redirect URLs you provide only for PayPal-based payments. Returned only when the payment is in created state. Required for PayPal payments.
    protected $items;
    //Items and related shipping address within a transaction.
    protected $approvalUrl;
    public function preparePayment($domain)
    {
        return Driver::preparePayment($this, $domain);
    }
    public function createInvoice($domain)
    {
        return Driver::createInvoice($this, $domain);
    }
    public static function executePayment($paymentId, $payerId, $domain)
    {
        return Driver::executePayment($paymentId, $payerId, $domain);
    }
    public static function getPayment($id, $domain)
    {
        return Driver::getPayment($id, $domain);
    }
}
Configuration::defaults('Bread\\PayPal\\Payment', array('create' => array('type' => 'Bread\\Types\\DateTime'), 'update' => array('type' => 'Bread\\Types\\DateTime'), 'payer' => array('type' => 'Bread\\PayPal\\Payer'), 'items' => array('type' => 'Bread\\PayPal\\Item', 'multiple' => true)));
示例#2
0
 protected static function getApiContext($domain)
 {
     //{live, $sandbox}
     $mode = Configuration::get(Payment::class, 'api.mode', $domain);
     $clientID = Configuration::get(Payment::class, "api.{$mode}.clientId", $domain);
     $clientSecret = Configuration::get(Payment::class, "api.{$mode}.clientSecret", $domain);
     $api = new ApiContext(new OAuthTokenCredential($clientID, $clientSecret));
     $api->setConfig(array('mode' => $mode, 'cache.enabled' => true));
     return $api;
 }
示例#3
0
文件: Payer.php 项目: breadphp/paypal
    //PayPal assigned Payer ID.
    protected $salutation;
    //Salutation of the payer.
    protected $firstName;
    //First name of the payer.
    protected $middleName;
    //Middle name of the payer.
    protected $lastName;
    //Last name of the payer.
    protected $street;
    //Line 1 of the address (e.g., Number, street, etc). 100 characters max. Required.
    protected $city;
    //City name. 50 characters max. Required.
    protected $country;
    //2-letter country code. 2 characters max. Required.
    protected $state;
    //2-letter code for US states, and the equivalent for other countries. 100 characters max.
    protected $mail;
    //Email address representing the payer. 127 characters max.
    protected $phone;
    //Phone number representing the payer. 20 characters max.
    protected $paymentMethod;
    //Payment method used. Must be either credit_card or paypal. Required.
    protected $status;
    //Status of the payer’s PayPal account. Only supported when the payment_method is set to paypal. Allowed values: VERIFIED or UNVERIFIED.
    protected $creditCard;
    //A resource representing a credit card that can be used to fund a payment.
    protected $company;
}
Configuration::defaults('Bread\\PayPal\\Payer', array('creditCard' => array('type' => 'Bread\\PayPal\\CreditCard')));
示例#4
0
<?php

namespace Bread\Satisfaction;

use Bread\Configuration\Manager as Configuration;
use Bread\REST;
class Model extends REST\Model
{
    const VOTE_LOW = '1';
    const VOTE_MEDIUM_LOW = '3';
    const VOTE_MEDIUM_HIGH = '5';
    const VOTE_HIGH = '7';
    protected $created;
    protected $vote;
    protected $text;
    protected $mail;
    protected $firstName;
    protected $lastName;
    protected $birthDate;
}
Configuration::defaults('Bread\\Satisfaction\\Model', array('properties' => array('created' => array('type' => 'Bread\\Types\\DateTime'), 'vote' => array('type' => 'integer'), 'birthdate' => array('type' => 'Bread\\Types\\DateTime'))));